The risk of plain Kubernetes Secrets in Git
In a GitOps pipeline, you typically declare your resources—including Secrets—as YAML manifests and commit them to your repository. Kubernetes offers two methods to create a Secret:- Imperative:
- Declarative (preferred in GitOps):
password123 → cGFzc3dvcmQxMjM=).
Base64 encoding is not encryption. Anyone with read access to your cluster or Git repo can decode the value back to cleartext.
How Sealed Secrets protect your credentials
Sealed Secrets let you store encrypted secrets safely in Git. You generate a SealedSecret that only your Kubernetes cluster can decrypt:- Install the Sealed Secrets controller in your cluster.
- Seal your plain-Secret using the controller’s
kubesealCLI. - Commit the resulting
SealedSecretresource to Git.
Secret inside the cluster—no one else can reverse-engineer it from your repo.
Key benefits
| Feature | Benefit |
|---|---|
| End-to-end encryption | Secrets remain encrypted at rest in Git |
| GitOps-friendly workflow | Manage sealed resources alongside your manifests |
| Cluster-bound decryption | Only your cluster’s controller can unseal them |