Skip to content
ohsudo, Home

Learning path

Kubernetes: debugging pods

kubectl access, pods that won't start or keep crashing, Services, Ingress and Helm.

4 stages · 12 steps

  1. Stage 1

    kubectl and access

    Reach the cluster, and understand who may do what.

    1. 1

      Cheat sheet

      kubectl Cheat Sheet

      The kubectl commands you use every day: contexts, pods, logs, exec, deployments and rollouts, debugging, YAML output, resource usage and cleanup

    2. 2

      Article

      kubectl "The connection to the server localhost:8080 was refused": your kubeconfig is missing

      Fix kubectl "The connection to the server localhost:8080 was refused": kubectl has no kubeconfig. Set it up for kubeadm, k3s, minikube, EKS, GKE or AKS, and under sudo.

    3. 3

      Article

      kubectl "x509: certificate signed by unknown authority": your kubeconfig doesn't trust this cluster

      Fix kubectl "x509: certificate signed by unknown authority": get a fresh kubeconfig for a recreated cluster, compare the CA, and handle proxies that inspect TLS.

    4. 4

      Article

      Kubernetes "Forbidden: User cannot list resource": give exactly the rights it needs with RBAC

      Fix Kubernetes "Forbidden: User cannot list resource": read who and what is missing, test with kubectl auth can-i, then add a Role and RoleBinding.

  2. Stage 2

    Pods that won't start

    Read the status and the events, from the manifest to a running container.

    1. 5

      Tool

      Kubernetes Manifest Generator

      Deployment, Service, Ingress, ConfigMap, Secret and autoscaling YAML from a form.

    2. 6

      Article

      Kubernetes pod stuck in Pending: "0/3 nodes are available: Insufficient cpu"

      Fix pods stuck in Pending: read the FailedScheduling event, then fix CPU and memory requests, taints, node selectors, volumes or the cluster size.

    3. 7

      Article

      Kubernetes ImagePullBackOff and ErrImagePull: find out why the image won’t pull

      Fix ImagePullBackOff: read the pull error in kubectl describe, then fix the image name or tag, registry credentials, Docker Hub rate limits, network or architecture.

    4. 8

      Article

      Kubernetes CreateContainerConfigError: a missing Secret or ConfigMap, and how to find it

      Fix Kubernetes CreateContainerConfigError: kubectl describe names the missing Secret, ConfigMap or key. Check the namespace and the key, then let the pod restart.

    5. 9

      Article

      Kubernetes "container has runAsNonRoot and image will run as root": fix the image or the pod

      CreateContainerConfigError with runAsNonRoot: the image runs as root or has a non-numeric USER. Fix the Dockerfile, set runAsUser, and keep restricted security.

  3. Stage 3

    Pods that crash or go away

    Restarts, evictions, nodes that stop reporting, and pods that won't leave.

    1. 10

      Article

      Kubernetes CrashLoopBackOff: 7 causes and how to find yours

      CrashLoopBackOff means the container keeps exiting. Read the exit code and the previous logs, then fix the crash, OOM kill, probe or command.

    2. 11

      Article

      Kubernetes pods "Evicted": find the pressure on the node, and stop it from coming back

      Fix Kubernetes pods with status Evicted: read why with describe, handle DiskPressure and MemoryPressure on the node, clean up, set requests and limits, delete old pods.

  4. Stage 4

    Traffic and releases

    From the Ingress to the pods, and Helm releases that get stuck.

    1. 12

      Guide

      Kubernetes pod not running? Find the cause, step by step

      Pending, CrashLoopBackOff, ImagePullBackOff, or kubectl itself failing.

Your progress is saved in this browser only, never sent anywhere. Clearing the browser data clears it too.

All learning paths →