All jobs / DevOps / SRE / cloud / Kubernetes
DevOps / SRE / cloud interview question · 0–1 years
Which Kubernetes object do you reach for: a stateless API, a database, a log agent on every node, and a nightly clean-up?
The strongest answer
Deployment for the API, StatefulSet for the database (stable identity and per-pod storage), DaemonSet for the agent, and a CronJob that creates Jobs for the clean-up
Why it works
Exactly — each controller encodes a different lifecycle: replaceable replicas, ordered stateful identity, one-per-node, run-to-completion.
What a good answer covers
- Pick the controller by lifecycle.
- Deployment: stateless replicas.
- StatefulSet: identity and storage.
- DaemonSet per node; CronJob for schedules.
Answers that fall short
- Close, but not the strongest: Deployments for everything; you can tune replicas and volumes to cover the rest
Deployments cannot give pods stable names and their own volumes, and they do not run to completion or one-per-node. - Weak: Pods created directly with kubectl run for each one
Bare Pods are not rescheduled or scaled; the controllers are the whole point. - Red flag: One big Pod with all four as containers so they share a lifecycle
One Pod couples four unrelated lifecycles; the database restarts when the clean-up crashes.
Who gets asked this
More Kubernetes questions
- ConfigMap or Secret for a database password — and is a Secret encrypted?
- 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?