Sealed Secrets — One-Way Encrypted Kubernetes Secrets
Sealed Secrets is a Bitnami Labs controller and kubeseal CLI that lets teams commit encrypted secrets safely to Git, and have a cluster-side controller decrypt them into real Secrets at apply time.
What it is
Sealed Secrets is a Kubernetes controller and CLI tool from Bitnami Labs that enables GitOps-safe secret management. It lets you encrypt Kubernetes Secrets into SealedSecret resources that are safe to commit to Git. The cluster-side controller decrypts them into real Secrets at apply time.
Sealed Secrets solves the fundamental GitOps problem: you want all configuration in Git, but Kubernetes Secrets are base64-encoded (not encrypted) and cannot be safely committed.
How it saves time or tokens
Without Sealed Secrets, teams either avoid GitOps for secrets (manual kubectl apply) or use complex external secret managers. Sealed Secrets adds encryption directly to the GitOps workflow. Encrypt once with kubeseal, commit the SealedSecret, and the controller handles decryption.
This eliminates the operational overhead of managing secrets separately from other Kubernetes configurations.
Additionally, the project's well-structured documentation and active community mean developers spend less time troubleshooting integration issues. When AI coding assistants generate code for this tool, they can reference established patterns from the documentation, producing correct implementations with fewer iterations and lower token costs.
How to use
- Install the controller in your cluster:
helm repo add sealed-secrets https://bitnami-labs.github.io/sealed-secrets
helm install sealed-secrets sealed-secrets/sealed-secrets -n kube-system
- Install the kubeseal CLI:
brew install kubeseal
- Create and seal a secret:
kubectl create secret generic my-secret \
--from-literal=api-key=super-secret-value \
--dry-run=client -o yaml | \
kubeseal --format yaml > sealed-secret.yaml
- Commit sealed-secret.yaml to Git. The controller decrypts it into a real Secret when applied.
kubectl apply -f sealed-secret.yaml
Example
# sealed-secret.yaml (safe to commit)
apiVersion: bitnami.com/v1alpha1
kind: SealedSecret
metadata:
name: my-secret
namespace: default
spec:
encryptedData:
api-key: AgBy3i4OJSWK+PiTySYZZA9rO43cGDEq...
template:
metadata:
name: my-secret
Related on TokRepo
- AI Tools for Security — Security tools for Kubernetes and cloud
- AI Tools for DevOps — Kubernetes configuration management
Common pitfalls
- Losing the controller's private key. If the controller's private key is lost, all existing SealedSecrets become undecryptable. Back up the key securely or use a key management service.
- Not specifying the namespace when sealing. By default, SealedSecrets are namespace-scoped. A SealedSecret sealed for namespace A cannot be decrypted in namespace B.
- Committing raw Secrets alongside SealedSecrets. The SealedSecret replaces the regular Secret. Never commit unencrypted Secret YAML to the same repository.
- Failing to review community discussions and changelogs before upgrading. Breaking changes in major versions can disrupt existing workflows. Pin versions in production and test upgrades in staging first.
Frequently Asked Questions
kubeseal fetches the controller's public key from the cluster and uses asymmetric encryption (RSA) to encrypt the secret data. Only the controller's private key (stored in the cluster) can decrypt it. This one-way encryption makes the SealedSecret safe to commit to Git.
Yes. The controller supports key rotation. New keys are generated periodically, and old keys are retained for decrypting existing SealedSecrets. You can trigger re-encryption of existing secrets with the new key.
Sealed Secrets encrypts secrets and stores them in Git. External Secrets Operator fetches secrets from external providers (AWS Secrets Manager, Vault, GCP) at runtime. Sealed Secrets is simpler and self-contained. External Secrets Operator integrates with existing secret management infrastructure.
Yes. You can include SealedSecret YAML in Helm charts. The SealedSecret is applied like any other Kubernetes resource, and the controller decrypts it into a regular Secret. Template the SealedSecret in your Helm values.
Yes. Sealed Secrets is widely used in production GitOps workflows. It is maintained by Bitnami Labs, has regular releases, and supports key rotation, multi-namespace deployments, and backup procedures.
Citations (3)
- Sealed Secrets GitHub— Sealed Secrets encrypts Kubernetes secrets for safe Git storage
- Kubernetes Documentation— Kubernetes Secrets management
- CNCF GitOps— GitOps practices for Kubernetes
Related on TokRepo
Discussion
Related Assets
Conda — Cross-Platform Package and Environment Manager
Install, update, and manage packages and isolated environments for Python, R, C/C++, and hundreds of other languages from a single tool.
Sphinx — Python Documentation Generator
Generate professional documentation from reStructuredText and Markdown with cross-references, API autodoc, and multiple output formats.
Neutralinojs — Lightweight Cross-Platform Desktop Apps
Build desktop applications with HTML, CSS, and JavaScript using a tiny native runtime instead of bundling Chromium.