
A production Kubernetes incident can affect customers within seconds. A failing Pod, exhausted node, broken Service, or incorrect deployment can interrupt an entire application.
The challenge is not simply finding an error. It is identifying the real cause without making the incident worse.
A structured troubleshooting process helps engineers investigate problems quickly. It also reduces unnecessary restarts, risky configuration changes, and repeated debugging.
This guide introduces a practical 30-minute Kubernetes troubleshooting runbook. It explains what to check, which commands to execute, how to interpret results, and when to escalate an incident.
What Is a Kubernetes Production Troubleshooting Runbook?
A Kubernetes troubleshooting runbook is a documented process for identifying, investigating, and resolving problems in a Kubernetes cluster.
It gives engineers a consistent approach during production incidents.
Instead of running random commands, engineers follow a logical investigation process.
A useful runbook covers:
- Cluster and node health.
- Pod status and restart counts.
- Container logs.
- Kubernetes events.
- CPU and memory consumption.
- Deployment and ReplicaSet health.
- Service connectivity.
- DNS resolution.
- Application health checks.
- Recovery validation.
The objective is to restore service safely while collecting enough evidence to identify the underlying problem.
The 30-Minute Kubernetes Troubleshooting Framework
The following framework divides the investigation into six stages.
| Time | Investigation | Main Objective |
|---|---|---|
| 0–5 minutes | Cluster health | Identify cluster-wide failures |
| 5–10 minutes | Pod investigation | Find failing or restarting Pods |
| 10–15 minutes | Logs and events | Identify application and Kubernetes errors |
| 15–20 minutes | Resource investigation | Detect CPU and memory problems |
| 20–25 minutes | Networking | Investigate Services, endpoints, and DNS |
| 25–30 minutes | Recovery validation | Confirm application health |
This is an operational target, not a guarantee that every incident can be resolved within 30 minutes. Complex infrastructure failures require deeper investigation.
1. Prepare Your Kubernetes Troubleshooting Environment
Before investigating production issues, verify that kubectl can communicate with the intended cluster.
Step 1: Check kubectl availability
Run:
kubectl version --client
This displays the installed kubectl client version.
Step 2: Identify the active cluster
kubectl config current-context
Check the available contexts:
kubectl config get-contextsCode language: JavaScript (javascript)
A wrong Kubernetes context can cause engineers to investigate or modify the wrong environment.
Step 3: Check API server connectivity
kubectl cluster-info
If the command fails, investigate:
- API server availability.
- Network connectivity.
- Authentication credentials.
- Authorization permissions.
- Current kubeconfig configuration.
Step 4: Define your production namespace
export NS=productionCode language: JavaScript (javascript)
Verify that the namespace exists:
kubectl get namespacesCode language: JavaScript (javascript)
Important: Confirm the cluster context and namespace before running any production-changing command.
2. Minutes 0–5: Check Overall Cluster Health
Start with the cluster rather than focusing immediately on one application Pod.
A production application can fail because of a broader infrastructure problem.
Check Kubernetes nodes
kubectl get nodes -o wideCode language: JavaScript (javascript)
Look at the STATUS column.
Common node conditions include:
- Ready
- NotReady
- Unknown
A NotReady node may affect every workload scheduled on that machine.
Describe an unhealthy node
kubectl describe node NODE_NAME
Replace NODE_NAME with the actual node name.
Inspect:
- Conditions
- Capacity
- Allocatable resources
- MemoryPressure
- DiskPressure
- PIDPressure
- Taints
- Recent events
A node with DiskPressure may have insufficient available disk space.
A node with MemoryPressure may be experiencing memory exhaustion.
Check system workloads
kubectl get pods -n kube-system -o wideCode language: JavaScript (javascript)
Pay attention to important infrastructure components:
- CoreDNS
- kube-proxy, where deployed
- CNI networking components
- CSI storage components
- Cluster monitoring agents
The exact components depend on the cluster distribution and architecture.
Check recent cluster events
kubectl get events -A --sort-by=.metadata.creationTimestampCode language: JavaScript (javascript)
Look for repeated warnings involving:
- FailedScheduling
- FailedMount
- FailedAttachVolume
- FailedCreatePodSandBox
- BackOff
- Unhealthy
- NodeNotReady
What should you conclude?
If several applications fail simultaneously, investigate shared infrastructure before changing individual workloads.
3. Minutes 5–10: Identify Failing Kubernetes Pods
Pods are the next investigation point.
Run:
kubectl get pods -n $NS -o wideCode language: JavaScript (javascript)
This displays Pod status, restart counts, node placement, and IP addresses.
Understand common Pod statuses
| Status | Possible Meaning |
|---|---|
| Pending | Pod is waiting for scheduling or another dependency |
| Running | Pod containers are running |
| CrashLoopBackOff | A container repeatedly exits |
| ImagePullBackOff | Kubernetes cannot pull the container image |
| ErrImagePull | Image retrieval failed |
| CreateContainerConfigError | Container configuration problem |
| ContainerCreating | Container setup is still in progress |
| OOMKilled | Container was terminated after exceeding its memory limit |
A Running Pod is not automatically a healthy application. Check readiness and application responses too.
Investigate a failing Pod
kubectl describe pod POD_NAME -n $NSCode language: PHP (php)
Replace POD_NAME with the actual Pod name.
Important fields include:
- State
- Last State
- Restart Count
- Ready
- Conditions
- Events
- Container ID
- Image
- Exit Code
Troubleshoot CrashLoopBackOff
CrashLoopBackOff means Kubernetes is repeatedly attempting to restart a container that exits.
First inspect its current logs:
kubectl logs POD_NAME -n $NSCode language: PHP (php)
For the previous container instance:
kubectl logs POD_NAME -n $NS --previousCode language: PHP (php)
Check the container’s last termination state:
kubectl get pod POD_NAME -n $NS -o jsonpath='{.status.containerStatuses[*].lastState.terminated}'Code language: JavaScript (javascript)
Common causes include:
- Application startup failures.
- Missing environment variables.
- Invalid configuration files.
- Incorrect database credentials.
- Missing dependencies.
- Permission problems.
- Memory exhaustion.
- Incorrect container commands.
Do not automatically delete a failing Pod. First collect its logs and events.
Troubleshoot ImagePullBackOff
Inspect the Pod:
kubectl describe pod POD_NAME -n $NSCode language: PHP (php)
Check:
- Image name.
- Image tag.
- Registry availability.
- Image pull secrets.
- Registry authentication.
- Network connectivity.
For private registries, verify the imagePullSecrets configuration.
An incorrect image tag can produce an image-pulling failure even when the application configuration is correct.
4. Minutes 10–15: Analyze Container Logs and Kubernetes Events
Logs provide application-level information. Events provide information about Kubernetes operations.
You need both to understand an incident.
Check container logs
kubectl logs POD_NAME -n $NS --tail=100Code language: PHP (php)
Follow logs continuously:
kubectl logs POD_NAME -n $NS -fCode language: PHP (php)
For a Pod containing multiple containers:
kubectl logs POD_NAME -n $NS -c CONTAINER_NAMECode language: PHP (php)
For previously terminated containers:
kubectl logs POD_NAME -n $NS -c CONTAINER_NAME --previousCode language: PHP (php)
Search for common application errors
kubectl logs POD_NAME -n $NS --tail=500 | grep -Ei "error|exception|failed|timeout|refused"Code language: PHP (php)
Possible application errors include:
- Database connection refused.
- Authentication failure.
- Connection timeout.
- Missing configuration.
- Failed dependency initialization.
- Application startup exception.
Remember that logs may contain sensitive information. Avoid sharing credentials, tokens, or customer data during troubleshooting.
Investigate Kubernetes events
kubectl get events -n $NS --sort-by=.metadata.creationTimestampCode language: JavaScript (javascript)
For detailed Pod events:
kubectl describe pod POD_NAME -n $NSCode language: PHP (php)
Typical findings:
FailedScheduling
The scheduler cannot place the Pod on an available node.
Possible reasons include insufficient CPU, insufficient memory, node selectors, taints, or affinity requirements.
FailedMount
Kubernetes cannot mount a required volume.
Investigate PersistentVolumeClaims, storage classes, CSI components, and permissions.
Unhealthy
A container health probe has failed.
Check the readiness, liveness, and startup probe configuration.
BackOff
Kubernetes is delaying another attempt after repeated failures.
Investigate the original failure instead of treating BackOff as the root cause.
5. Minutes 15–20: Investigate CPU and Memory Problems
Resource exhaustion can make an application slow, unstable, or unavailable.
Check Pod resource consumption
kubectl top pods -n $NSCode language: PHP (php)
Check all namespaces:
kubectl top pods -A
Check node resource consumption
kubectl top nodes
These commands require a working Metrics Server.
Their measurements provide recent resource consumption, not a complete historical performance investigation.
Investigate OOMKilled containers
Run:
kubectl describe pod POD_NAME -n $NSCode language: PHP (php)
Look for:
Reason: OOMKilledCode language: HTTP (http)
An OOMKilled container has exceeded its available memory under the applicable memory enforcement limits.
Inspect its resource configuration:
kubectl get deployment DEPLOYMENT_NAME -n $NS -o yamlCode language: JavaScript (javascript)
Look for:
resources:
requests:
memory: "256Mi"
cpu: "250m"
limits:
memory: "512Mi"
cpu: "500m"Code language: JavaScript (javascript)
These values are illustrative. Actual resource settings should reflect measured application requirements.
Understand CPU throttling
A container can remain Running while experiencing CPU throttling.
This can cause:
- Increased response times.
- Slow background processing.
- Request timeouts.
- Delayed application initialization.
Inspect CPU usage, configured limits, and monitoring data together.
Review scheduling capacity
kubectl describe node NODE_NAME
Check allocated resources and node conditions.
Remember that scheduling uses resource requests, while CPU and memory limits affect runtime resource enforcement.
Increasing resource limits without checking node capacity can create another infrastructure problem.
6. Minutes 20–25: Troubleshoot Kubernetes Networking
Networking problems can prevent healthy Pods from receiving requests.
A systematic investigation should move through the following layers:
- Pod health.
- Service configuration.
- Service selectors.
- EndpointSlices.
- DNS resolution.
- Network policies.
- Ingress or load balancer configuration.
Step 1: Inspect Kubernetes Services
kubectl get services -n $NSCode language: JavaScript (javascript)
Describe the affected Service:
kubectl describe service SERVICE_NAME -n $NSCode language: PHP (php)
Check:
- Service type.
- Cluster IP.
- Port.
- TargetPort.
- Selector.
Step 2: Check EndpointSlices
kubectl get endpointslices -n $NSCode language: JavaScript (javascript)
For one particular Service:
kubectl get endpointslices \
-n $NS \
-l kubernetes.io/service-name=SERVICE_NAMECode language: JavaScript (javascript)
If expected endpoints are missing, investigate:
- Pod readiness.
- Service selectors.
- Pod labels.
- Namespace configuration.
- Target ports.
A Service selector that does not match application Pod labels can prevent the Service from finding its intended backends.
Step 3: Verify Pod labels
kubectl get pods -n $NS --show-labelsCode language: JavaScript (javascript)
Compare the labels with the Service selector.
For example, a Service might expect:
selector:
app: backend
But the application Pods might use:
labels:
app: backend-api
These selectors do not match.
Correct the configuration through your normal deployment process.
Step 4: Test DNS resolution
Start a temporary diagnostic Pod if your operational policy permits it:
kubectl run dns-test \
-n $NS \
--image=busybox:1.36 \
--restart=Never \
-- sleep 3600Code language: PHP (php)
Test DNS:
kubectl exec dns-test -n $NS -- \
nslookup SERVICE_NAMECode language: PHP (php)
For a cross-namespace Service:
kubectl exec dns-test -n $NS -- \
nslookup SERVICE_NAME.OTHER_NAMESPACE.svc.cluster.localCode language: PHP (php)
If DNS fails, inspect CoreDNS:
kubectl get pods -n kube-systemCode language: JavaScript (javascript)
kubectl get service kube-dns -n kube-systemCode language: JavaScript (javascript)
kubectl get endpointslices \
-n kube-system \
-l kubernetes.io/service-name=kube-dnsCode language: JavaScript (javascript)
Investigate DNS configuration, CoreDNS health, network connectivity, and cluster-specific DNS settings.
Remove the temporary diagnostic Pod after the investigation:
kubectl delete pod dns-test -n $NSCode language: JavaScript (javascript)
Only remove resources that you created for this investigation.
Step 5: Investigate Ingress
Check available Ingress resources:
kubectl get ingress -n $NSCode language: JavaScript (javascript)
Inspect the configuration:
kubectl describe ingress INGRESS_NAME -n $NSCode language: PHP (php)
Investigate:
- Hostname configuration.
- TLS settings.
- Backend Service name.
- Backend Service port.
- Ingress controller health.
- DNS records.
- External load balancer configuration.
A healthy application Pod does not guarantee that external users can access it.
7. Minutes 25–30: Validate Recovery
After identifying and correcting the issue, verify the complete application path.
Do not assume that a successful deployment means the incident has ended.
Step 1: Check deployment status
kubectl rollout status deployment/DEPLOYMENT_NAME -n $NSCode language: PHP (php)
Step 2: Check Pod health
kubectl get pods -n $NS -o wideCode language: JavaScript (javascript)
Confirm that the expected replicas are available and ready.
Step 3: Check Service endpoints
kubectl get endpointslices -n $NSCode language: JavaScript (javascript)
Verify that the Service has the expected ready backends.
Step 4: Check application logs
kubectl logs deployment/DEPLOYMENT_NAME \
-n $NS \
--tail=100Code language: PHP (php)
Look for repeated errors, startup failures, or dependency connection problems.
Step 5: Test application connectivity
If the application exposes an HTTP health endpoint, test it through an approved diagnostic method.
For example:
curl -i https://your-application.example.com/healthCode language: JavaScript (javascript)
Replace the example hostname with the real application endpoint.
Step 6: Monitor the recovery
Check:
- Application response times.
- HTTP error rates.
- Pod restart counts.
- CPU consumption.
- Memory consumption.
- Database connectivity.
- Ingress errors.
- Customer-facing functionality.
Continue monitoring after the initial recovery window.
8. Production Troubleshooting: Five Common Scenarios
The following examples illustrate how engineers can apply the runbook.
Scenario 1: Application Pods Keep Restarting
Symptoms:
- CrashLoopBackOff.
- Increasing restart count.
- Application unavailable.
Investigation:
kubectl get pods -n production
kubectl describe pod POD_NAME -n production
kubectl logs POD_NAME -n production --previousCode language: JavaScript (javascript)
Possible root causes:
- Application startup exception.
- Invalid environment variables.
- Missing configuration.
- Memory exhaustion.
- External dependency failure.
Recommended response:
Identify the original termination reason and correct the underlying problem.
Do not repeatedly restart the deployment without understanding why the application exits.
Scenario 2: Application Returns HTTP 503
Symptoms:
- Ingress returns 503.
- Application Pods appear Running.
- Customers cannot access the service.
Investigation:
kubectl get pods -n production
kubectl get svc -n production
kubectl get endpointslices -n production
kubectl describe service SERVICE_NAME -n productionCode language: JavaScript (javascript)
Possible root causes:
- No ready endpoints.
- Incorrect Service selector.
- Readiness probe failures.
- Incorrect targetPort.
- Ingress backend configuration problems.
Recommended response:
Verify the application Pods, Service selectors, EndpointSlices, and ingress controller configuration.
Scenario 3: Pods Remain Pending
Symptoms:
- Deployment creates Pods.
- Pods never start.
- Application capacity decreases.
Investigation:
kubectl get pods -n production
kubectl describe pod POD_NAME -n production
kubectl get nodes
kubectl describe node NODE_NAMECode language: JavaScript (javascript)
Possible root causes:
- Insufficient CPU.
- Insufficient memory.
- Node affinity restrictions.
- Untolerated taints.
- Persistent volume problems.
Recommended response:
Resolve the scheduling or storage constraint. Do not force Pods onto unsuitable nodes.
Scenario 4: Application Becomes Slow
Symptoms:
- Increased request latency.
- Slow API responses.
- Intermittent timeouts.
Investigation:
kubectl top pods -n production
kubectl top nodes
kubectl get pods -n production
kubectl logs deployment/DEPLOYMENT_NAME -n productionCode language: JavaScript (javascript)
Possible root causes:
- CPU throttling.
- Memory pressure.
- Database latency.
- Network delays.
- Connection pool exhaustion.
- Increased traffic.
Recommended response:
Correlate application metrics with infrastructure metrics before changing resource limits or replica counts.
Scenario 5: Application Cannot Connect to Another Service
Symptoms:
- Connection refused.
- DNS lookup failures.
- Connection timeouts.
Investigation:
kubectl get svc -n production
kubectl get endpointslices -n production
kubectl get pods -n production
kubectl get networkpolicies -n productionCode language: JavaScript (javascript)
Possible root causes:
- Incorrect DNS name.
- Incorrect Service port.
- Missing endpoints.
- NetworkPolicy restrictions.
- Application binding to the wrong interface.
- Backend application unavailable.
Recommended response:
Test connectivity from the affected workload’s network context and inspect each network layer.
9. Kubernetes Health Probes: Readiness, Liveness and Startup
Health probes play an important role in production reliability.
Kubernetes supports three main probe types.
| Probe | Purpose | Kubernetes Action |
|---|---|---|
| Startup | Checks whether an application has started | Delays other probes until successful |
| Readiness | Checks whether a container can accept traffic | Removes unready Pods from matching Service endpoints |
| Liveness | Checks whether a container should continue running | Restarts a container after repeated failures |
Example configuration
apiVersion: apps/v1
kind: Deployment
metadata:
name: backend
namespace: production
spec:
replicas: 3
selector:
matchLabels:
app: backend
template:
metadata:
labels:
app: backend
spec:
containers:
- name: backend
image: example/backend:1.0
ports:
- containerPort: 8080
startupProbe:
httpGet:
path: /health/startup
port: 8080
periodSeconds: 10
failureThreshold: 30
readinessProbe:
httpGet:
path: /health/ready
port: 8080
periodSeconds: 5
failureThreshold: 3
livenessProbe:
httpGet:
path: /health/live
port: 8080
periodSeconds: 10
failureThreshold: 3Code language: JavaScript (javascript)
This is an illustrative configuration. The application must implement the specified endpoints.
Important: A liveness probe should not fail simply because a temporary external dependency becomes unavailable. Poorly designed liveness checks can trigger unnecessary restarts and cascading failures.
10. Essential Kubernetes Troubleshooting Commands
Keep this command reference available during production incidents.
| Purpose | Command |
|---|---|
| Current context | kubectl config current-context |
| Cluster information | kubectl cluster-info |
| List nodes | kubectl get nodes -o wide |
| List namespaces | kubectl get ns |
| List Pods | kubectl get pods -A |
| Describe Pod | kubectl describe pod POD -n NS |
| Container logs | kubectl logs POD -n NS |
| Previous logs | kubectl logs POD -n NS --previous |
| List events | kubectl get events -A |
| CPU and memory | kubectl top pods -A |
| Node metrics | kubectl top nodes |
| List deployments | kubectl get deployments -A |
| Rollout status | kubectl rollout status deployment/NAME -n NS |
| List Services | kubectl get svc -A |
| List EndpointSlices | kubectl get endpointslices -A |
| List Ingress | kubectl get ingress -A |
| List NetworkPolicies | kubectl get networkpolicies -A |
Replace placeholder values with actual cluster resource names.
11. Common Kubernetes Troubleshooting Mistakes
Even experienced engineers can make production incidents worse by rushing into recovery actions.
Avoid these mistakes.
1. Restarting Pods without collecting logs
You may lose useful information about the previous container failure.
2. Changing resource limits without checking capacity
A higher resource limit does not guarantee that the node has enough resources.
3. Ignoring readiness failures
A Running Pod can remain unavailable to Service traffic.
4. Assuming every 503 is an application problem
The actual cause may involve Services, EndpointSlices, Ingress, or networking.
5. Deleting production resources unnecessarily
Deleting Pods, PVCs, or other resources can introduce additional risks.
6. Ignoring recent deployment changes
An incident may be directly related to a recent image, configuration, secret, or application release.
7. Treating a temporary recovery as a permanent fix
Restarting an application may restore service without correcting the underlying problem.
8. Skipping post-recovery monitoring
A service can become unhealthy again shortly after recovery.
12. Production Kubernetes Troubleshooting Checklist
Use this checklist during an incident.
Cluster health
- Confirm the correct cluster context.
- Confirm the production namespace.
- Check Kubernetes node status.
- Inspect system workloads.
- Review recent cluster events.
Pod health
- Identify failing Pods.
- Check restart counts.
- Inspect Pod descriptions.
- Review current logs.
- Review previous container logs.
Resource investigation
- Check CPU consumption.
- Check memory consumption.
- Investigate OOMKilled containers.
- Inspect node resource pressure.
- Review resource requests and limits.
Networking
- Verify Services.
- Check Service selectors.
- Inspect EndpointSlices.
- Verify DNS resolution.
- Inspect NetworkPolicies.
- Check Ingress configuration.
Recovery
- Confirm deployment rollout.
- Verify available replicas.
- Confirm Service endpoints.
- Test application connectivity.
- Monitor application errors.
- Record the incident and root cause.
13. How to Improve Kubernetes Production Troubleshooting
A good runbook helps during an incident. Strong operational practices help prevent repeated incidents.
Consider implementing the following improvements.
Centralized logging
Use a centralized logging platform to collect container and infrastructure logs.
Common options include:
- Elasticsearch and Kibana.
- Grafana Loki.
- OpenSearch.
- Managed cloud logging services.
Centralized logging makes it easier to investigate failures across multiple nodes and applications.
Infrastructure monitoring
Use Prometheus to collect metrics from applications and Kubernetes infrastructure.
Grafana can present these metrics through dashboards.
Monitor important indicators such as:
- CPU utilization.
- Memory consumption.
- Pod restarts.
- Container availability.
- Request latency.
- HTTP error rates.
- Node conditions.
Alert management
Configure Alertmanager or an equivalent alerting system to notify the responsible team about meaningful incidents.
Avoid alerts that generate excessive noise without requiring action.
Deployment safety
Use:
- Rolling updates.
- Readiness probes.
- Resource requests and limits.
- Deployment health checks.
- Rollback procedures.
- Controlled configuration changes.
Incident documentation
Record:
- Incident start time.
- Affected services.
- Customer impact.
- Initial symptoms.
- Investigation steps.
- Root cause.
- Recovery actions.
- Preventive improvements.
This information helps engineers recognize recurring problems.
14. Frequently Asked Questions
1. What is the first command to run during a Kubernetes production incident?
Start by confirming the active context and cluster health.
kubectl config current-context
kubectl get nodesCode language: JavaScript (javascript)
Then inspect the affected namespace and application Pods.
2. How do I troubleshoot CrashLoopBackOff?
Use kubectl describe pod to inspect container termination details and events. Then use kubectl logs --previous to examine the previous container instance.
Investigate the actual exit reason before changing the workload.
3. How do I identify memory problems in Kubernetes?
Use kubectl top pods and kubectl top nodes to inspect recent resource usage. Then check Pod descriptions for OOMKilled events and compare actual usage with configured memory limits.
4. Why is my Kubernetes Pod Running but not Ready?
The application may not be passing its readiness probe. Other causes include dependency failures, incorrect probe paths, wrong ports, or application initialization problems.
5. How do I troubleshoot Kubernetes Service connectivity?
Check Service configuration, selectors, Pod readiness, EndpointSlices, DNS resolution, and NetworkPolicies.
6. Does kubectl top require additional components?
Yes. The Metrics Server must be installed and functioning for kubectl top to return resource usage information.
7. Should I restart a Pod during a production incident?
Only when the investigation supports that action and the operational impact is understood.
Collect logs, events, and termination information first whenever possible.
8. How long does Kubernetes troubleshooting take?
Simple configuration or application failures may be identified quickly. Infrastructure, storage, networking, and distributed application problems can require much longer investigation.
A 30-minute runbook provides an organized initial triage process rather than a guaranteed resolution time.
Conclusion
Production Kubernetes troubleshooting requires a structured approach.
Start with cluster health. Investigate failing Pods, container logs, events, and resource consumption. Then check Services, EndpointSlices, DNS, and application connectivity.
Finally, validate the recovery and monitor the application for recurring failures.
A practical 30-minute runbook gives DevOps and SRE teams a consistent starting point during production incidents. More importantly, it encourages engineers to investigate root causes instead of relying on repeated restarts and risky production changes.
The best troubleshooting process restores service safely, preserves useful evidence, and reduces the likelihood of similar incidents in the future.








