Kubernetes Error Triage — Symptoms, Exit Codes and Cloud Equivalents
The hub of the Kubernetes production errors guide: the outside-in method, the first five minutes of commands, every symptom mapped to its layer and page, pod states and exit codes decoded, and the EKS, AKS and GKE equivalents.
Overview
A Kubernetes failure almost never shows up where it starts. A user sees a 503, but the cause is a readiness probe. A pod sits in Pending, but the cause is a quota, a taint or a cloud account with no spare IP addresses. This page is the entry point to the whole category: it teaches the method, the commands you run in the first five minutes, and which page covers each error in depth.
The method is outside-in. Start where the user is and walk inward along the request path (DNS, cloud load balancer, Ingress or Gateway, Service, EndpointSlice, Pod, container, dependencies). For anything that never started, walk the lifecycle path instead (apply, admission, scheduler, kubelet, container runtime, probes). Every hop either passes the request on or leaves a specific signal behind.
The one idea to keep: a status code, a pod state or an exit code is a location, not a diagnosis. A 504 says the request reached a backend that did not answer in time. ImagePullBackOff says the pod was scheduled and the kubelet could not fetch the image. Read the signal as 'how far did it get', and you know which layer to open before you touch a log.
Symptom to first command
The guide sorts every error into nine layers. Each layer has its typical symptoms, one first command that confirms or rules it out, and its own page. The commands use the worked example of this guide: Service orders in namespace prod.
- Edge and Ingress: 502, 503, 504, 404 from the proxy, TLS errors, EXTERNAL-IP pending. Run kubectl get endpointslices -n prod -l kubernetes.io/service-name=orders; the page is Ingress & Load Balancer Errors.
- Control plane: kubectl timeouts, Forbidden, webhook denials, quota, stuck namespaces. Run kubectl get --raw='/readyz?verbose'; the page is Control Plane Errors.
- Scheduling and startup: Pending, ImagePullBackOff, CrashLoopBackOff, Init:*, sandbox errors, Evicted. Run kubectl events -n prod --for pod/; the page is Pod Startup & Scheduling Errors.
- Container: OOMKilled, exit 1, 126, 127, Running but 0/1, old code still running. Run kubectl logs -n prod --previous; the page is Container Errors.
- Service networking: i/o timeout, DNS failures, port mismatch, errors on every rollout, mesh sidecars. Run kubectl get networkpolicy -n prod; the page is Service Networking Errors.
- Storage: FailedMount, PVC Pending, Multi-Attach, disk full, resize not visible. Run kubectl describe pvc data-orders -n prod; the page is Storage Errors.
- Nodes and scaling: NotReady, no scale-up, drain blocked, stuck Terminating, HPA without metrics. Run kubectl describe node ; the page is Node & Scaling Errors.
- Identity, secrets, config: AccessDenied from the cloud, stale config, secret mount failures. Run kubectl get sa orders-sa -n prod -o yaml; the page is Identity/Secrets/Config Errors.
- HTTP semantics: 400, 401, 403, 405, 408, 409, 410, 413, 414, 422, 426, 429, 431, 499, 500. Run curl -sv https://api.corp.com/api/orders -o /dev/null; the page is HTTP 4xx/5xx Reference.
The figure puts those layers on the request path, so you can see where each family of errors comes from.
Key concepts
- Outside-in triage
- EndpointSlice
- Pod phase versus STATUS
- CrashLoopBackOff
- 128 + signal rule
- Ephemeral container
- Grace period
- Gateway API
- Mitigate, diagnose, prevent
Interview questions
- The site is down. You have kubectl access and nothing else. Go.
- After every deploy, users see 502s for about twenty seconds. Probes are correct. Walk me through it.
- A container restarts with exit code 137, but the reason is Error, not OOMKilled. What is going on?
- New pods are stuck in Pending after a node group change on EKS. How would this differ on AKS and GKE?
- kubectl itself times out. Is the cluster down?
- You rolled back the deploy, but errors continue. What now?
- How do you run the incident and the postmortem, not just the debugging?
Sign up free to read the full topic
More DevOps topics
- Kubernetes Autoscaling: HPA, VPA, KEDA, and Cluster Autoscaler
- Kubernetes Cluster Upgrades and Version Management
- Kubernetes Core Resources
- Kubernetes Custom Schedulers
- Kubernetes Deployment Strategies
- Kubernetes Descheduler
- Kubernetes Evictions and Node Pressure
- Kubernetes Gateway API v1
- Kubernetes Multi-cloud and Hybrid Cluster Patterns
- Kubernetes Multi-tenancy Patterns
- Kubernetes Native Sidecar Containers
- Kubernetes Network Policies
Start free on Cariara · Coding problems · System design studio