Retire mini legacy Vault into c1 OpenBao #184
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
lab/iac#184
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Retire mini's legacy Vault (OpenBao 2.0.4, ns
vault) into the c1 OpenBao. Scoped 2026-11-22 from a read-only inventory (key names and metadata only) and the live ESO objects.Why now
ClusterSecretStore/vault-backenduses Secretexternal-secrets/vault-token: policyroot, no TTL, created 2024-08-08. Any pod that can read that Secret owns every secret on mini. The init root token (2024-08-07) was never revoked either; those two are the only live tokens.vault.animeteamspeak.moecallback, so UI login is dead, and it keeps a second callback on the kanidmvaultclient.What it holds
secret/(KV v2)kv-v2/foo,forgejo,forgejo-db-creds,discord-flux-webhook)remote-secrets/cloudflare-certmanager-secrets,discord-flux-webhook; read byclusters/remotedatabase/pki-apiserver/agent-registry/approle/vault-runner(old vault-config runner)oidc/,oidc-cli/secret/keys by consumervault-backend, or written by its 5 PushSecrets (nats-token,argo-workflows-s3,velero-mini-seaweed-s3,velero-portable-seaweed-s3,vmuser-mini-tenant).discord-flux-webhook,fluxcd-dev-apps-source-read-key,argocd-secrets,copyparty-secrets,kargo-secrets,wasabi-s3,vui-secrets,yamtrack-secrets.standby/apps:endurain-secrets,n8n-secrets,peekaping-secrets,pinniped-oidc-secret,qbittorrent-secrets,semaphore,shiori-configuration-secret.lubelogger-secrets,supabase-secrets,wiredoor-secrets(inactive apps),portable-cluster-argocd-apps-repo.automation-project-repo,collabora-secrets,docker-mailserver-secrets,external-dns-secrets,forgejo-runner-values,foundry-values,generated/diag_kvtest,generated/diag_test,grafana-admin-values,harbor-node-pull(superseded by c1infra/harbor/node-pull),k8s-hub-ca-portable,k8s-hub-mtls-mail,k8s-hub-mtls-mini,nextcloud-configuration-secret,velero-internal-bucket,velero-truenas-bucket,wasabi-velero,wiredoor-values.Key fact that makes this cheap
c1's
secret/mount is the same layout (KV v2, same key names) on purpose (vault/eso-mini.tfheader), and mini's ESO already logs into c1 OpenBao with its own ServiceAccount (JWT mountkubernetes-mini, roleexternal-secrets; storeopenbao). Every one of the ~45 manifests names the storevault-backend, and nothing else in git dials mini Vault. So one file,clusters/mini/eso/vault-backend.yaml, moves all 51 ExternalSecrets and 5 PushSecrets once the keys exist on c1 and the policy grants them.Plan
Stage 0: iac (this repo)
vault/eso-mini.tf: grant roleexternal-secretsread on each migrated path (explicit list in a local, notsecret/*) and create/update on the 5 PushSecret paths. The existing routeros/unifi/pdns grants stay.mini-sa-jwks.pemfreshness into the gate (task check:mini-jwksexists): after the cutover, an rke2 reinstall on mini would stop all mini secrets from refreshing until the PEM is updated.Stage 1: copy (one session, needs a human OpenBao login)
bao kv get -mount=secretfrom mini (ESO's token, just in time) andbao kv put -mount=secretto c1 with avault_superadminsOIDC token (vault-login.py, 30 min TTL). Then compare a per-key data hash on both sides. Version history is not carried over, only the current version. Nothing on mini changes in this stage.Stage 2: cutover (lab/clusters)
clusters/mini/eso/vault-backend.yaml: serverhttps://secrets.infra.caosh.int.animeteamspeak.moe(JWT auth is not CIDR-bound, so the passthrough Gateway is fine and spreads over the thinks), pathsecret, auth jwtkubernetes-mini/ roleexternal-secrets. Theopenbaostore moves from10.30.20.21to the same name.SecretSynced, 5 PushSecretsSynced, and every k8s Secret hash unchanged. Rollback = revert the one file (mini Vault is untouched until stage 4).refreshIntervalfrom 15s: 51 objects at 4/min is ~200 logins/min against OpenBao for values that rarely change.Stage 3: soak a few days. PushSecret writes (velero, argo, nats, vmuser) land on c1.
Stage 4: decommission
external-secrets/vault-token.clusters/mini/vault/(HelmRelease, namespace, routes-internal, egress policy); Flux prunes, and thevault.apps.caosh.intrecord goes with the route. Delete PVCvault/data-vault-0after the export.kanidm/oauth2.tf: thevaultclient drops the mini callback, andoriginmoves tohttps://secrets.infra.caosh.int.animeteamspeak.moe/.docs/agents/secrets.mdpattern 2 (stores and paths), AGENTS.md.Stage 5 (optional, later): rename
vault-backendtoopenbaoin the ~45 manifests and drop the alias store. Fold the flat paths into the catalog layout when #103 resumes.Decisions needed
secret/<key>for the move (recommended; matches today, zero manifest churn) or go straight to the #103 catalog layout (apps/<app>/{generated,manual}; touches every manifest and blocks on #103).kv-v2/andremote-secrets/exist afterwards only in the encrypted export.archive/mini-vault/.vault-backendagainst the retired public URL (dead since 2026-11-20) and are unreachable from here. Delete those store definitions, or leave them for the mx2-to-c3 conversion.Effort
Stage 0 small PR; stage 1 one sitting with a login; stage 2 one-file PR plus about 30 min of verification; stage 4 three small PRs. About one working session plus the soak. Blast radius in stage 2 is every mini secret, mitigated by unchanged paths and data, a hash check, and a one-file rollback while mini Vault keeps running.
Related: #103 (catalog: an agent principal with
manual-secret-manageris what would let an agent do stage 1 without a human token).Decisions (owner, 2026-11-22): D1 keep flat secret/. D2 migrate the 56 keys (LIVE + REF + STANDBY + the 4 ArgoCD-repo keys). D3 no export, no backup: one copy, then mini Vault is deleted, so the 18 unreferenced keys, kv-v2/ and remote-secrets/ are dropped for good. D4 delete the portable and remote vault-backend store definitions.
Progress 2026-11-22:
Cluster-side tracker: lab/clusters#1669.
Done 2026-11-22. mini legacy Vault deleted (lab/clusters#1783): namespace, PVC/PV and the root-token Secret gone, no export (D3). All mini secrets read the c1 OpenBao through vault-backend with ESO JWT login (#1782); 56 keys copied and hash-verified, 49 ExternalSecrets and 5 PushSecrets green with unchanged data. kanidm vault client serves only c1 (#187). ESO metrics scraped into VictoriaMetrics (#1786); alerting deliberately left for later. Found on the way: mini internal-dns external-dns had lost its RBAC since lab/clusters#1763 (shared chart ClusterRole deleted by the public release); fixed with own-named RBAC (#1787), which also removed the stale vault.apps record.