How does Sealed Secrets work?
BeginnerConceptSecrets in GitOps
Answer
The Sealed Secrets controller in the cluster holds a private key; kubeseal encrypts a Secret with the controller's public certificate into a SealedSecret CR, which is safe to commit. Argo CD applies the SealedSecret; the controller decrypts it and creates the real Secret, owned by the SealedSecret. Only that controller (holding that private key) can decrypt.
kubectl create secret generic db --from-literal=password=s3cr3t -n app --dry-run=client -o yaml \
| kubeseal --format yaml > db-sealed.yaml
More on Secrets in GitOps
Why are plain Kubernetes Secrets a problem in GitOps?BeginnerWhat are Sealed Secrets scopes?IntermediateHow does Sealed Secrets key rotation work, and what must you back up?AdvancedHow does External Secrets Operator fit into GitOps?BeginnerShow an ExternalSecret for AWS Secrets Manager.IntermediateHow does SOPS work, and how do you use it with Argo CD?Intermediate