Kubernetes probe failure and restart investigation cheat sheet
Distinguish startup, readiness and liveness probe failures when a container repeatedly restarts.
Kubernetes with kubectl and read access to the affected namespace; probe behavior depends on the Pod specification.
Updated · Kubernetes · 6 min read
| Command | What it does |
|---|---|
kubectl config current-context | Confirm cluster context |
kubectl describe pod web -n production | Inspect probe events |
kubectl get pod web -n production -o yaml | Inspect configured probes |
kubectl logs web -n production --previous | Inspect previous container logs |
kubectl get endpointslice -n production | Inspect Service endpoints |
Walkthrough
Replace production and web with approved resources. These commands inspect the workload without changing probes or restarting containers.
Step 1: Confirm cluster context
kubectl config current-context
Compare the current context with the approved cluster inventory before interpreting workload status and events.
Step 2: Inspect probe events
kubectl describe pod web -n production
Review container state, restart count and recent probe failure events. Record the probe type and response rather than assuming every restart is a probe failure.
Step 3: Inspect configured probes
kubectl get pod web -n production -o yaml
Review the startup, liveness and readiness probes, ports and timing. Sanitize the output because environment settings can contain sensitive information.
Step 4: Inspect previous container logs
kubectl logs web -n production --previous
Review the previous container instance for startup timing or application errors. Logs can be absent or omit the exact cause of a failed probe.
Step 5: Inspect Service endpoints
kubectl get endpointslice -n production
Compare relevant Service EndpointSlices and readiness with the expected backend. A running container can be excluded from normal Service traffic while unready.
WORKED INCIDENT
Practical case: A slow application repeatedly restarts
Fictional teaching scenario; observations are examples, not captured production output.
Situation
A newly deployed application restarts while warming its cache.
Investigation sequence
1. Confirm cluster context
kubectl config current-contextConfirm the cluster and namespace before collecting the workload evidence.
2. Inspect probe events
kubectl describe pod web -n productionRead the Pod events and identify the failing probe type and timing.
3. Inspect configured probes
kubectl get pod web -n production -o yamlCompare probe configuration with the application startup behavior.
4. Inspect previous container logs
kubectl logs web -n production --previousReview previous container logs and relevant Service endpoint readiness.
Example findings
Illustrative findings: liveness probes fail during a long startup, and application logs show initialization finishes later than the configured window.
Interpret the findings
The time correlation supports reviewing startup probe design. Readiness failures alone do not trigger container restarts.
Verify the outcome
After an approved probe adjustment, observe a fresh rollout and verify both restart count and readiness.
Escalation handoff
Share sanitized events, probe settings and startup timings with the application and platform teams.
Primary references
Documented reference; examples above are teaching scenarios. Confirm behavior against your deployed version.