Bird
0
0

You have a Pod stuck in CrashLoopBackOff due to a failing init container. What is the best way to troubleshoot this?

hard📝 Application Q8 of 15
Kubernetes - Troubleshooting
You have a Pod stuck in CrashLoopBackOff due to a failing init container. What is the best way to troubleshoot this?
ACheck logs of the init container using <code>kubectl logs <pod-name> -c <init-container-name></code>.
BDelete the Pod and recreate it immediately.
CIncrease the Pod's memory limits.
DIgnore the init container; it does not affect Pod status.
Step-by-Step Solution
Solution:
  1. Step 1: Identify init container role

    Init containers run before main containers and can cause Pod startup failure if they crash.
  2. Step 2: Use kubectl logs to check init container errors

    Use kubectl logs <pod-name> -c <init-container-name> to see init container logs and find errors.
  3. Final Answer:

    Check logs of the init container using kubectl logs <pod-name> -c <init-container-name>. -> Option A
  4. Quick Check:

    Init container errors = check its logs [OK]
Quick Trick: Use '-c' flag to view init container logs [OK]
Common Mistakes:
  • Deleting Pod without troubleshooting
  • Increasing memory without cause
  • Ignoring init container impact

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes