DevOps Interview Questions

Kubernetes Pod Lifecycle and Readiness Probes

Walk me through a pod's lifecycle. Why do we need readiness AND liveness probes?

Why Interviewers Ask This

Any Kubernetes-touching role asks this. Probes are where most real production bugs live — interviewers probe for real experience.

How to Answer

  1. 1

    Phases: Pending (scheduled, pulling images), Running (all containers started), Succeeded (all exited 0), Failed (some container failed non-zero), Unknown.

  2. 2

    Init containers run to completion before app containers start. Great for migrations, config fetching, setup.

  3. 3

    Liveness probe: "is the process alive?" — fail kills the container. Use only for deadlock detection. Too aggressive = crash loop.

  4. 4

    Readiness probe: "is the process ready to serve?" — fail removes from Service endpoints. Use during warmup, degraded states, dependency loss.

  5. 5

    Startup probe: for slow-starting apps. Disables liveness until it passes, then liveness takes over.

Sample Answer

A pod goes Pending (waiting to schedule + pull images) → Running (containers up) → Succeeded or Failed. Init containers run to completion first — good for migrations and config fetch. The two probes solve different problems and both matter. Liveness answers 'is the process hung?' — if it fails, Kubernetes kills the container. Use it for genuine deadlocks only; overly aggressive liveness is how you crash-loop production. Readiness answers 'should I send traffic to this pod?' — failure removes the pod from the Service endpoint set without killing it. This is what you want during warmup, during dependency outages, or when the pod is temporarily degraded. For apps with long startup (JVM, ML models), add a startup probe so liveness doesn't fire before the app is even up. For graceful shutdown: SIGTERM → preStop hook → drain connections → exit. If your app exits faster than load balancers notice, you drop requests — preStop sleep is the common fix.

Pro Tips

  • Readiness should check dependencies (DB, cache). Liveness should NOT — it'll take down healthy pods when an upstream blips.

  • terminationGracePeriodSeconds + preStop sleep covers most "dropped requests on rolling deploy" issues.

  • HireMe AI (即答侠) pairs each probe with a failure mode — interviewers like to hear "I've been burned by this".

Frequently Asked Questions

Can I skip liveness probes?

Yes if your app doesn't deadlock. Many teams run only readiness — safer default than over-aggressive liveness.

initialDelaySeconds or startup probe?

Startup probe is the modern answer — waits for success, then liveness runs. initialDelaySeconds requires guessing startup time.

Worried About Going Blank in Your Interview?

HireMe AI listens to your interview in real-time, detects questions, and generates instant answer suggestions — so you never freeze up again.

Try HireMe AI Free