Pcornel
Automation · Kubernetes Automation

Secrets

Cheat sheet · https://pcornel.dk/topic.php?topic=5798

Back to the Topic

Answer

Kubernetes Secrets store sensitive values like passwords and tokens for pods. They are only base64-encoded by default, so enable encryption at rest and use tools like Sealed Secrets or External Secrets for GitOps.

Remember

  • Secrets are base64, not encrypted, by default.
  • Enable encryption at rest.
  • Use Sealed Secrets or External Secrets for GitOps.

First checks

  • kubectl get secret <n> -o jsonpath='{.data}' | head -c 100 — exists (avoid printing values)
  • External Secrets/Sealed Secrets/SOPS — git-safe secrets
  • Encryption at rest (KMS) enabled — protection

Verify in this order

secret source → controller → Secret → pod

Where it usually breaks

Input/desired state → request accepted → job/task terminal status → target object read-back → effective runtime state → original workload → regression/rollback readiness.

Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=5798

Confirmation

Confirm action

Continue?