How do Sealed Secrets enable GitOps for secrets?
asymmetric-crypto GitOps pattern.
kubeseal encrypts a Secret with the controller's public key into a SealedSecret CR safe for Git; only the in-cluster controller's private key can decrypt it into a real Secret.
What's really being asked
Whether you understand how asymmetric encryption lets you keep secrets in version control safely, and how that fits a declarative GitOps model where Git is the source of truth.
The full answer
A cluster-side Sealed Secrets controller generates an asymmetric key pair and keeps the private key inside the cluster. Developers use the kubeseal client, which fetches the controller's public certificate, to encrypt an ordinary Secret into a SealedSecret custom resource. Encryption is one-way with the public key, so the resulting SealedSecret is opaque and can be committed to Git, even a public repository, without exposing the data. A GitOps tool like Argo CD or Flux applies the SealedSecret to the cluster; the controller watches for it, decrypts it with its private key, and creates the corresponding native Secret in the right namespace. Sealing is scoped, typically to a namespace and name, so a SealedSecret cannot be moved elsewhere to be decrypted. This keeps the entire desired state, including secrets, declarative and reviewable in Git.
The mistakes people make
Claiming the encryption is symmetric or that anyone with kubeseal can decrypt. Forgetting that the private key lives only in the cluster and must be backed up. Thinking you commit the plaintext Secret. Ignoring the namespace/name scoping that prevents reuse elsewhere.
What usually comes next
How do you back up and rotate the controller's private key? What happens to SealedSecrets if you rebuild the cluster? How does scope-mode strict, namespace-wide, or cluster-wide affect portability? How does this compare to External Secrets or Vault?
A concrete example
kubeseal --format yaml < secret.yaml > sealedsecret.yaml encrypts db-creds with the controller's public key; you commit sealedsecret.yaml to a public repo, Flux applies it, and the controller decrypts it into the live db-creds Secret in the target namespace.
Interview question
Why is committing a SealedSecret to a public Git repo considered safe?
- a.kubeseal strips the sensitive values before committing
- b.The data is base64 encoded and obfuscated
- c.It is encrypted with a public key only the cluster's private key can decryptCorrect
- d.Git repos hide files marked as secrets
Why? this is the answer
kubeseal encrypts with the controller's public key, and only the in-cluster private key can decrypt, so the committed SealedSecret reveals nothing. Base64 is not encryption, and the values are encrypted, not stripped.
Just read this? Test yourself on what you have been reading.
Read the original → github.com
- #kubernetes
- #sealed-secrets
- #gitops
- #encryption
- #secrets
Put your scrolling time to good use
Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.
The iPhone app is on the way
We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.
Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.
We are hiring for this. Open roles that interview on kubernetes — each one lists the topics its interview covers.
See open roles