You cannot commit plaintext secrets to git. How do you handle secrets in GitOps?
What they are really testing: Whether you know the real options (SOPS, Sealed Secrets, External Secrets Operator) and the trade-offs, since secret management is the single most awkward part of GitOps.
A real interview question
You cannot commit plaintext secrets to git. How do you handle secrets in GitOps?
What most people say
drag me
“I would store the secrets in a Kubernetes Secret and apply them with everything else.”
A plain Kubernetes Secret is only base64 and would sit in plaintext in git. The whole question is how to avoid that: SOPS-encrypted values, Sealed Secrets, or an external secrets manager referenced from git.
The follow-ups they ask next
What is the trade-off between Sealed Secrets/SOPS and the External Secrets Operator?
SOPS/Sealed Secrets keep an encrypted copy in git, self-contained but you handle keys/rotation. External Secrets keeps no secret in git (just a reference) and centralizes rotation/audit in a real manager, at the cost of running that integration.
Why is a plain Kubernetes Secret not enough here?
It is only base64-encoded, not encrypted, so committing it puts the secret effectively in plaintext in git history. You need encryption (SOPS/Sealed Secrets) or a reference to an external manager.
What the interviewer is listening for
- Knows plain Secret/base64 is not safe in git
- Names SOPS / Sealed Secrets / External Secrets
- Articulates the trade-offs
What sinks the answer
- Would commit a plain Kubernetes Secret
- Knows no real secret-management option
- Thinks base64 is encryption
If you genuinely do not know
Say this instead of freezing. Reasoning out loud from what you do know beats silence every single time, and a good interviewer is listening for exactly that.
“You cannot commit plaintext (a Secret is only base64). Options: [SOPS, encrypt values in git with KMS/age, decrypt in-cluster]; [Sealed Secrets, encrypt to a cluster-specific key so only it can decrypt]; [External Secrets Operator, keep the secret in Vault/cloud manager and store only a reference, fetched at runtime]. Trade-off: [encrypted-in-git vs no-secret-in-git with centralized rotation].”
Keep going with gitops
Foundation
What is GitOps, and what problem does it solve?
Foundation
What is the difference between push-based and pull-based deployment, and why does GitOps prefer pull?
Foundation
What are the core principles of GitOps?
Junior
What are Argo CD and Flux, and how do they differ?
Junior
How does drift detection and self-healing work in GitOps?
Junior
How do you structure repositories for GitOps? Should app code and deployment config live together?
Knowing the answer is not the same as recalling it under pressure
Sign in to send the questions you fumble to spaced recall, so they come back right before you would forget them, and learn the concepts behind them with hands-on labs.
Start free