A Pod is stuck in CrashLoopBackOff after a deployment. How do you troubleshoot it?
What the interviewer wants to hear
- kubectl describe pod for events, exit code and reason
- kubectl logs --previous to see the crashed container output
- Check exit codes, OOMKilled, probes and config
- Check recent changes: image, env vars, ConfigMaps, Secrets
- Roll back if users are affected, then fix root cause
Model answer
CrashLoopBackOff means the container starts, exits, and Kubernetes keeps restarting it with growing delays. If users are affected, I first roll back with kubectl rollout undo, then investigate. I run kubectl describe pod to see events, the last state, the exit code and the reason. Exit code 137 with OOMKilled points to memory limits; exit code 1 usually means an application error. Then kubectl logs with --previous shows the output of the crashed container, which often reveals a missing environment variable, a bad config file, or a database connection failure. I also check if a liveness probe is too aggressive and killing a slow-starting app. Finally I compare what changed in this release, such as the image, ConfigMaps or Secrets, and fix it through the pipeline.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium DevOps Engineer questions
- How do you manage secrets such as database passwords and API keys across CI/CD pipelines and Kubernetes?
- Compare rolling, blue-green and canary deployments. How do you decide which to use?
- Developers complain that the CI pipeline takes 40 minutes. How would you make it faster?
- How do you structure Terraform code for multiple environments like dev, staging and production?
- Your team is burning out from on-call pages. How would you redesign alerting and the on-call process?
- When would you package Kubernetes manifests with Helm and when with Kustomize? Can they be combined?
- Users report that one service on Kubernetes became slow since this morning. Walk me through how you would investigate.
- How would you promote a release from dev to staging to production in a GitOps setup with Argo CD?
- How do you include database schema migrations in a continuous delivery pipeline without causing downtime?