secrets: bring 29 hand-made cluster Secrets under Git via SOPS/age (audit F12) #45
Loading…
Reference in a new issue
No description provided.
Delete branch "secrets/sops"
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?
Audit F12. Nothing in the cluster is reconciled from this repo: 67 hand-made Secrets, zero managed ones, so restoring this Git tree yields a cluster that will not start. This brings the first-party Secrets under Git as SOPS/age ciphertext and enables Flux's
sopsdecryptor.Provider decision: SOPS + age, one mechanism, no mixing. Flux already ships the
sopsdecryptor, so there is no second controller or CRD to run, and the age private key is escrowed off-cluster (flux-system/sops-agein the cluster +/root/sops/homek8s-age.keyon the Linode over the mesh). A SealedSecret would need the controller and a sealing key escrowed anyway — same single point of failure, more parts.What is committed (29 Secrets, 7 namespaces)
apps/base/<ns>/secret-<name>.sops.yaml,encrypted_regex: ^(data|stringData)$so names/namespaces stay reviewable:Every file was generated from the live object and decrypts to a byte-identical
datamap andtype, so the first apply is a no-op, not a rotation (verified 29/29).Three things worth a reviewer's attention
*-pg-app/pg-app/sirius-growth-portal-dbare ours, not CNPG output. Each Cluster'sbootstrap.initdb.secret.namepoints at one of them, soinitdbreads the password from the Secret we create. Without them in git a rebuild has no application password and the Cluster never bootstraps. They are static (no rotation policy configured), so re-applying is a no-op.forgejo-pullis in git, which supersedes the "out of band (never in git)" wording indocs/registry-pull-auth.mdfrom #43. Now that every workload carriesimagePullSecrets: [forgejo-pull], it is the single Secret whose absence stops the whole cluster from pulling images — the exact failure this card exists to prevent. I updated that doc rather than leaving the two claims contradicting each other..gitignorekeeps**/*secret*.yamlignored and re-includes onlysecret-*.sops.yaml, so a plaintext Secret still cannot be committed andage.agekeystays ignored.Excluded on purpose (full table + reasons in
docs/secrets-sops.md)CNPG-issued
*-server/*-replication/*-ca(ownerRefCluster/*; committing them pins certs the operator overwrites),cnpg-systemoperator CA/webhook + barman TLS,cert-manager-webhook-ca, cilium/hubble certs (a stale copy wedges a Helm upgrade — the documentedhubble-server-certsfailure),sh.helm.release.v1.*, and the prometheus-operator's renderedprometheus-*/alertmanager-*objects.Follow-up commit (same card) migrates
monitoring's hand-made Secrets (grafana-admin,grafana-secret-key,alertmanager-telegram) and the threecluster-backup-sshcopies after the delete-and-reconcile drill proves the path.Verification on merge
kubectl kustomize apps/homebuilds 29 Secrets with 104/104 data values asENC[...]; token-shape scan over all 40 staged files: no hits.