A Deployment rollout is stuck because new pods are in CrashLoopBackOff. Walk me through how you would debug it.
What the interviewer wants to hear
- Limit impact first: pause or roll back the rollout if users are affected
- Use kubectl describe pod for exit code, reason and events
- Read logs of the previous container instance
- Check config, secrets, probes and resource limits that changed
- Reproduce with the same image and config if needed
Model answer
If users are affected I first make sure old pods are still serving; with maxUnavailable set correctly they are, otherwise I run kubectl rollout undo. Then I run kubectl describe pod on a failing pod and read the last state, exit code and events. Exit code 137 with OOMKilled points to memory limits; exit code 1 usually means the app failed at start-up. Next I run kubectl logs with --previous to see the output of the crashed instance, which often shows a missing environment variable, a bad config value or a failed connection to a dependency. I compare what changed in this release: image, ConfigMaps, Secrets, probes and resources. A liveness probe that is too aggressive can also kill a slow-starting app, so a startup probe may be needed. If it is still unclear, I run the image locally with the same config.
Can you answer it under time pressure?
Take a timed medium round and get scored on every answer.
More medium Site Reliability Engineer questions
- How would you design alerting for a service so that on-call engineers are not flooded with noisy alerts?
- Walk me through how you would run and write a postmortem after a major outage.
- How should a client retry failed calls to another service safely?
- A Linux server running a service suddenly becomes slow. How do you investigate?
- How do you do capacity planning for a growing service?
- A team is launching a new checkout API and asks you to help define its SLOs. How do you approach it?
- Your Prometheus servers are running out of memory because of too many time series. How do you find the cause and keep cardinality under control?
- During a major incident, how do you handle communication with customers, support and leadership?
- A big marketing launch is in three weeks. How would you load test the service to know it will cope?