Bird
0
0

Given this Kubernetes pod spec snippet, what happens if the container crashes?

medium📝 Command Output Q13 of 15
Kubernetes - Production Best Practices
Given this Kubernetes pod spec snippet, what happens if the container crashes?
livenessProbe:
  httpGet:
    path: /healthz
    port: 8080
  initialDelaySeconds: 5
  periodSeconds: 10
ANothing happens; the container keeps running.
BThe pod is deleted permanently.
CKubernetes restarts the container after failing the health check.
DKubernetes scales the pod to zero replicas.
Step-by-Step Solution
Solution:
  1. Step 1: Understand liveness probe behavior

    Liveness probe checks container health and triggers restart if it fails.
  2. Step 2: Apply to container crash scenario

    If container crashes, health check fails, so Kubernetes restarts it automatically.
  3. Final Answer:

    Kubernetes restarts the container after failing the health check. -> Option C
  4. Quick Check:

    Liveness failure = container restart [OK]
Quick Trick: Liveness probe failure triggers container restart [OK]
Common Mistakes:
  • Thinking pod is deleted permanently on failure
  • Assuming container keeps running despite crash
  • Confusing scaling with health check actions

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes