Nereus/deploy/secrets
2026-08-24 23:36:28 +02:00
..
.gitkeep chore: scaffold repository layout 2026-08-20 20:09:24 +02:00
README.md feat(deploy): add blue-green release manifests 2026-08-24 23:36:28 +02:00

Secrets

nereus-db holds two keys, used by postgres.yaml and rollout.yaml:

  • POSTGRES_PASSWORD
  • DATABASE_URLpostgres://nereus:<password>@nereus-postgres:5432/nereus?sslmode=disable

It is not in base/kustomization.yaml. Plaintext never lands in the repo, and gitleaks runs on every push.

dev (k3d)

Create it directly, before kubectl apply -k deploy/overlays/dev:

set pw (openssl rand -hex 16)
kubectl create secret generic nereus-db -n nereus \
  --from-literal=POSTGRES_PASSWORD=$pw \
  --from-literal=DATABASE_URL="postgres://nereus:$pw@nereus-postgres:5432/nereus?sslmode=disable"

Rotating means deleting the secret, the StatefulSet's PVC, and restarting — Postgres only reads POSTGRES_PASSWORD when it initialises the data directory.

prod (sealed)

Write the plaintext to nereus-db.plain.yaml (gitignored), then:

kubeseal --format yaml < nereus-db.plain.yaml > nereus-db-sealed.yaml

Commit only nereus-db-sealed.yaml and add it to the prod overlay. The controller isn't installed yet — kubectl get crd | grep sealed comes back empty.