Bird
0
0

A Pod is in CrashLoopBackOff because it runs a script that exits with code 1 immediately. How can you fix this in the Pod spec?

medium📝 Debug Q7 of 15
Kubernetes - Troubleshooting
A Pod is in CrashLoopBackOff because it runs a script that exits with code 1 immediately. How can you fix this in the Pod spec?
AModify the container command to run a long-running process instead of exiting.
BIncrease the Pod's CPU limits.
CAdd a readiness probe that always returns success.
DChange the Pod's restartPolicy to Never.
Step-by-Step Solution
Solution:
  1. Step 1: Understand why Pod crashes

    The script exits immediately with code 1, causing container to stop and restart repeatedly.
  2. Step 2: Fix by running a persistent process

    Changing the command to a long-running process prevents immediate exit and CrashLoopBackOff.
  3. Final Answer:

    Modify the container command to run a long-running process instead of exiting. -> Option A
  4. Quick Check:

    CrashLoopBackOff fix = run persistent process [OK]
Quick Trick: Containers must run long processes to avoid CrashLoopBackOff [OK]
Common Mistakes:
  • Increasing CPU limits won't fix immediate exit
  • Readiness probe doesn't prevent crash loops
  • Setting restartPolicy to Never stops restarts but loses auto-recovery

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes