All jobs / DevOps / SRE / cloud / Kubernetes
DevOps / SRE / cloud interview question · 0–1 years
ConfigMap or Secret for a database password — and is a Secret encrypted?
The strongest answer
Secret, but by default it is only base64-encoded in etcd, not encrypted; I enable encryption at rest, restrict who can read secrets with RBAC, or source them from an external secret manager
Why it works
Right — base64 is encoding, not encryption. A Secret is a slightly better-guarded ConfigMap until you configure the rest.
What a good answer covers
- Secret, then harden it.
- base64 is not encryption.
- Encrypt etcd at rest; scope RBAC.
- Or use an external secret store.
Answers that fall short
- Close, but not the strongest: Secret — Kubernetes encrypts them, so the password is safe once it is in the cluster
That is the common misreading; without an encryption provider configured, anyone who can read etcd or the object reads the password. - Weak: ConfigMap is fine; both are just key-value objects in the same store
They are the same shape, but only Secrets get separate RBAC, encryption at rest and tooling that treats them as sensitive. - Red flag: Neither; put the password in the container image so it is always there
A password in the image ships to every registry, laptop and log; it is the one place it must never go.
Who gets asked this
More Kubernetes questions
- A pod is killed in a loop while it is still migrating. Which probe was wrong?
- Pods are Pending while nodes look empty in the console. What did you forget?
- You have five HTTP services. One Service of type LoadBalancer each, or an Ingress?
- What does Helm give you over applying raw YAML, and what does `helm rollback` not do?
- The pods are Running, but calls to the Service get connection refused. Walk me through the diagnosis.
- The cluster is two versions behind. How do you catch up?
- Pods cannot reach an external API that works from your laptop. What do you check in the cluster?
- HPA keeps adding pods; memory still climbs per pod. What is going on?