feat(backup): MinIO S3 backup target on Proxmox host for Velero + CNPG

Stand up a single-node/single-drive MinIO S3 endpoint on the Proxmox host as the
off-cluster backup target for Velero (R-STATE-03) and CloudNativePG (R-IDP-05).

Ansible (author + executed):
- roles/minio_backup_target + playbooks/backup-minio.yml — idempotent, additive only:
  ZFS dataset Storage/k3s-backups (zstd, quota=100G, /mnt/Storage/k3s-backups, no
  sharenfs); minio system user; pinned+checksummed MinIO/mc binaries (fetched on the
  controller since the host has no WAN, copied to host); hardened systemd unit bound to
  the host's cluster-reachable LAN IP (auto-discovered) on :9000; velero + cnpg buckets;
  a non-root access key scoped by IAM policy to only those two buckets.
- inventory: new [proxmox_hosts] group ([email protected].2.102); overrides the cluster-wide
  ansible_user. Does not disturb existing k3s node entries.
- group_vars/proxmox_hosts/vault.yml (ansible-vault): root + scoped MinIO creds.

GitOps hand-off:
- platform/backup/minio-credentials.sops.yaml (+ .example) — SOPS/age-encrypted endpoint +
  scoped key/secret for the Velero/CNPG wiring (WS-STORAGE/WS-SEC). Not yet wired into a
  kustomization (left for the consuming agents).

Verified live: dataset props correct; minio active+enabled bound to 192.168.1.9:9000;
S3 endpoint http://192.168.1.9:9000/minio/health/ready returns 200 from an in-cluster pod;
buckets velero+cnpg present; scoped key created+policy attached; re-run is idempotent.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
jakman85andClaude Opus 4.8 committed 2026-08-28 22:15:05 -05:00
1 parent 748e9ca55d
commit ac32f01f7b
13 files changed
+609

No files matched your search

@@ -0,0 +1,62 @@
---
# roles/minio_backup_target — a single-node, single-drive MinIO S3 target on the Proxmox
# host, used ONLY as an off-cluster backup bucket store for Velero + CloudNativePG (ADR-0003,
# R-STATE-03 / R-IDP-05). This is a BACKUP TARGET, not primary storage — single drive is fine.
#
# SAFETY: every task in this role is additive and idempotent. It creates ONE new ZFS dataset,
# ONE system user, ONE systemd service and two buckets. It never touches existing datasets,
# sharenfs, pvesm storage, VMs or firewall. See tasks/main.yml for the guards.
# ── MinIO / mc release pins (Renovate-friendly; both are AGPL community builds) ───────────────
# The Proxmox host has NO outbound internet (PiHole-only DNS, no default route to WAN), so the
# binaries are fetched on the ANSIBLE CONTROLLER and copied to the host (tasks/main.yml).
minio_backup_target_minio_version: "RELEASE.2025-09-07T16-13-09Z"
minio_backup_target_minio_sha256: "7c5bd8512c6e966455b1d198209358b2d191c77a83ab377c4073281065fb855f"
minio_backup_target_minio_url: "https://dl.min.io/server/minio/release/linux-amd64/archive/minio.{{ minio_backup_target_minio_version }}"
minio_backup_target_mc_version: "RELEASE.2025-08-13T08-35-41Z"
minio_backup_target_mc_sha256: "01f866e9c5f9b87c2b09116fa5d7c06695b106242d829a8bb32990c00312e891"
minio_backup_target_mc_url: "https://dl.min.io/client/mc/release/linux-amd64/archive/mc.{{ minio_backup_target_mc_version }}"
# Controller-side cache the binaries land in before being copied to the host (delegate_to localhost).
minio_backup_target_controller_cache: "/tmp/minio-backup-target-cache"
# ── ZFS dataset (backup drive) ────────────────────────────────────────────────────────────────
# Host convention is Storage/<purpose> mounted at /mnt/Storage/<purpose>. NO sharenfs.
minio_backup_target_zfs_dataset: "Storage/k3s-backups"
minio_backup_target_mountpoint: "/mnt/Storage/k3s-backups"
minio_backup_target_zfs_compression: "zstd"
minio_backup_target_zfs_quota: "100G"
# MinIO writes its drive (incl. .minio.sys) into a subdir of the dataset, keeping the dataset
# root clean and owned by root.
minio_backup_target_data_dir: "{{ minio_backup_target_mountpoint }}/data"
# ── Service identity ────────────────────────────────────────────────────────────────────────
minio_backup_target_user: "minio"
minio_backup_target_group: "minio"
minio_backup_target_minio_bin: "/usr/local/bin/minio"
minio_backup_target_mc_bin: "/usr/local/bin/mc"
minio_backup_target_env_file: "/etc/default/minio"
# ── Network binding ──────────────────────────────────────────────────────────────────────────
# MinIO's S3 API must bind the host address the k3s pods can reach (the 192.168.1.0/24 LAN;
# nodes are .50/.51/.52). tasks/main.yml auto-discovers the host's address in this CIDR prefix
# and asserts it exists; override minio_backup_target_bind_address to pin it explicitly.
minio_backup_target_lan_prefix: "192.168.1."
minio_backup_target_bind_address: "" # "" ⇒ auto-discover from facts (see tasks)
minio_backup_target_api_port: 9000
minio_backup_target_console_port: 9001
# ── Buckets + scoped (non-root) access key ────────────────────────────────────────────────────
# Velero and CNPG each get a bucket; a single non-root user scoped to ONLY these two buckets is
# handed to the cluster (SOPS). Root creds stay on the host for admin.
minio_backup_target_buckets:
- velero
- cnpg
minio_backup_target_policy_name: "k3s-backup-rw"
# Credentials come from the vaulted group_vars (inventory/group_vars/proxmox_hosts/vault.yml):
# minio_backup_target_root_user, minio_backup_target_root_password,
# minio_backup_target_access_key, minio_backup_target_secret_key
# They are intentionally NOT defaulted here so a missing vault fails loudly rather than
# silently provisioning guessable creds.