Pages

Topics

Tools

↑↓navigate↵openescclose
All guides

Kubernetes: failed to create pod sandbox on a node

The runtime could not build the pause container or its network. Read the desc field: CNI plugin, pause image, disk, SELinux or a stale runtime config.

~5 min readKubernetes
#Kubernetes#containerd#CNI#Troubleshooting
A Kubernetes pod sandbox crate blocked at a cyan runtime gate, an amber CNI plug and pause image cube beside it

Introduction & Quick Summary

text
Warning FailedCreatePodSandBox 3m kubelet failed to create pod sandbox: rpc error: code = Unknown desc = failed to setup network for sandbox "6f1a...": plugin type="calico" failed (add): error getting ClusterInformation: connection is unauthorized

The kubelet asked the container runtime to create a sandbox — the pause container plus network namespace that every pod starts from — and the runtime refused. The pod stays in ContainerCreating or cycles through Pending, and no application container is ever started, so container-level debugging (kubectl logs) shows nothing.

The subsystem named in the desc field decides the owner of the failure:

  • plugin type="..." — the CNI plugin could not configure the network namespace.
  • failed to get sandbox image — the pause image is missing and cannot be pulled.
  • failed to create containerd task / failed to run sandbox — the runtime itself or its storage is broken.
  • no such file or directory on /opt/cni/bin — the CNI binaries are absent on that node.
Message fragmentBroken layerFirst command
plugin type="calico"CNI pluginkubectl -n kube-system logs ds/calico-node
cni config uninitializedNo CNI config on nodels /etc/cni/net.d
failed to get sandbox imagepause imagecrictl images filtered for pause
rpc error: code = DeadlineExceededRuntime hungsystemctl status containerd
no space left on deviceNode disk or inodesdf -h /var/lib/containerd
failed to create task ... permission deniedSELinux or cgroupsausearch -m avc -ts recent

Core Mechanics, Signatures & Reproducible Setup

The Kubernetes pod lifecycle begins with a sandbox request over CRI. The kubelet calls RunPodSandbox, which makes the runtime create the pause container, set up namespaces, then invoke the CNI plugin chain to attach the network. Only after that does the kubelet create the application containers. Any failure in those three steps surfaces as FailedCreatePodSandBox.

Reproduce the diagnosis path on a broken node without touching the cluster:

bash
# 1. What does the kubelet actually report? kubectl describe pod web-0 -n demo | sed -n '/Events/,$p' # 2. Which runtime is this node using? kubectl get nodes -o wide kubectl get node node-1 -o jsonpath='{.status.nodeInfo.containerRuntimeVersion}' # 3. Can the CRI create a sandbox at all? crictl info | head -40 crictl pods --state ready crictl images | grep -i pause

A successful runtime reports a sandbox image, a network-ready status and a non-empty CNI configuration. The kubelet's view of the same state is available through its own API:

bash
kubectl get --raw "/api/v1/nodes/node-1/proxy/configz" | head -40 journalctl -u kubelet -u containerd --since "15 min ago" --no-pager | tail -80

The runtime configuration that matters for a bare containerd install lives in /etc/containerd/config.toml:

toml
version = 3 [plugins.'io.containerd.cri.v1.images'] sandbox_image = "registry.k8s.io/pause:3.10" [plugins.'io.containerd.cri.v1.runtime'] [plugins.'io.containerd.cri.v1.runtime'.containerd] default_runtime_name = "runc"

Container images and sandboxes share the same content store; a full store fails sandbox creation before any pod logic runs.

Key Comparison Table

RuntimeSandbox image settingConfig pathCommon failure
containerd 1.xplugins."io.containerd.grpc.v1.cri".sandbox_image/etc/containerd/config.toml (version 2)Wrong plugin key after upgrade
containerd 2.xplugins.'io.containerd.cri.v1.images'.sandbox_imagesame file, version 3Old key silently ignored
CRI-Opause_image in /etc/crio/crio.conf/etc/crio/crio.conf.d/pause not in allowed registry
dockershimRemoved in Kubernetes 1.24n/aNode never registers
SymptomLayerFix direction
cni config uninitializedCNIInstall or restore /etc/cni/net.d/*.conflist
plugin ... connection is unauthorizedCNI control planeFix plugin credentials to the API server
failed to get sandbox imageRegistryPreload pause or fix registry mirror
no space left on deviceStoragePrune images, expand the volume
permission denied on /var/lib/containerdSELinuxRelabel or disable enforcing temporarily
DeadlineExceededRuntime hangRestart containerd and kubelet in order

Practical Edge Cases, Error Fixes & Deep Dive Code Examples

Case 1: A node bootstrapped without a CNI plugin

kubeadm init deliberately installs no network plugin; nodes stay NotReady until one is applied, and any pod scheduled early fails sandbox creation. Confirm the absence rather than assuming a plugin is broken:

bash
ls -l /etc/cni/net.d/ # empty or missing directory -> no plugin is configured ls /opt/cni/bin/ # missing binaries -> plugin was never installed on this node

Install the CNI the cluster intends to use, matching the pod CIDR, and wait for the DaemonSet to become ready before retrying the pod:

bash
kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/v3.30.0/manifests/calico.yaml kubectl -n kube-system rollout status ds/calico-node --timeout=180s kubectl delete pod web-0 -n demo

Case 2: Pause image missing on an air-gapped node

The error names the exact reference, which is also the fix target:

text
failed to get sandbox image "registry.k8s.io/pause:3.9": failed to pull image: rpc error: code = NotFound

Preload it into every node's runtime from a tarball, then confirm the digest matches the one the kubelet expects:

bash
ctr -n k8s.io images import pause-3.9.tar ctr -n k8s.io images ls | grep pause

Changing sandbox_image to a mirror requires a runtime restart, and that restart is itself a source of transient sandbox failures, so drain the node first:

bash
kubectl drain node-2 --ignore-daemonsets --delete-emptydir-data systemctl restart containerd kubelet kubectl uncordon node-2

Case 3: Disk full under /var/lib/containerd

bash
df -h /var/lib/containerd df -i /var/lib/containerd du -sh /var/lib/containerd/io.containerd.snapshotter.v1.overlayfs/snapshots/* | sort -h | tail

Image pruning inside the node is safe for running containers; pruning snapshots is not. Remove unused images first, then restart the runtime:

bash
crictl rmi --prune systemctl restart containerd

If inodes are exhausted, pruning images is the only fast relief; a node with millions of small files from unpacked layers cannot be fixed by deleting a few large images.

Case 4: RuntimeClass pointing at a missing handler

apiVersion: node.k8s.io/v1 kind: RuntimeClass metadata: name: gvisor handler: runsc

If runsc is not installed on the node, sandbox creation fails with no runtime for "runsc" is configured. Verify the handler exists before scheduling:

bash
crictl info | grep -A2 runtimes kubectl get runtimeclass gvisor -o yaml

Either install and register the handler in the runtime config or remove the runtimeClassName from the workload; a RuntimeClass that exists as an object proves nothing about the node.

Case 5: containerd 2.x silently ignoring the old config

containerd 2.0 moved CRI settings under io.containerd.cri.v1.* and bumped the config version to 3. A node upgraded with the old version = 2 file keeps starting, but the CRI plugin ignores the deprecated keys, so a custom sandbox_image or registry mirror stops applying and pulls begin to fail.

bash
containerd config dump | grep -i sandbox_image containerd --version

Regenerate the config from the running version and merge local changes instead of hand-editing the old file:

bash
containerd config default > /etc/containerd/config.toml.new diff -u /etc/containerd/config.toml /etc/containerd/config.toml.new | head -80

Case 6: SELinux on RHEL-family nodes

bash
ausearch -m avc -ts recent | grep containerd | head

A denial on /var/lib/containerd or on the CNI binary path blocks sandbox setup while the runtime service itself looks healthy. Relabel the paths or use the distribution's container-selinux package. Setting SELinux to permissive is a diagnostic step, not a fix; leaving it permissive removes the protection that would have caught the next misconfiguration.

Common Compilation/Runtime Mistakes & Version Gotchas

  • Restarting only the kubelet. The kubelet reconnects to the same broken runtime and the same broken CNI. Restart the runtime first, then the kubelet, and check crictl info before scheduling anything.
  • Dockershim assumptions. Guides that edit /etc/docker/daemon.json do nothing on Kubernetes 1.24+, where the runtime is containerd or CRI-O. Confirm with nodeInfo.containerRuntimeVersion before following them.
  • cgroup v1 versus v2. Kubernetes 1.35 removes cgroup v1 support; a kubelet still configured for v1 on a v2-only host fails pod sandbox creation with cgroup errors that look like runtime failures. Check stat -fc %T /sys/fs/cgroup.
  • Pause image tag drift. A cluster pinned to pause:3.9 keeps trying to pull it even after nodes cache 3.10; align sandbox_image across nodes or preload both.
  • Network policy agents are not CNI plugins. Installing only a policy engine leaves /etc/cni/net.d empty, and pods fail at sandbox creation rather than at policy evaluation.
  • Node pressure hides the cause. DiskPressure evicts pods, but a node that is 99% full may fail new sandboxes before eviction triggers. Check df on the runtime directory, not just the root filesystem.

For manifests, run YAML through the YAML validator before applying, since an indentation error in a CNI ConfigMap produces a plugin that loads and then refuses every request. Pod and service CIDRs belong in the CIDR calculator when you are confirming that the plugin's pool does not overlap the node network.

Primary references: Debugging Kubernetes nodes with crictl documents the runtime-level commands used above, and Container Runtime Interface explains the RunPodSandbox step where this failure occurs.

Official references

primary documentation

The Kubernetes documentation that defines the behaviour this guide explains.

Try matching browser tools

All tools

Small utilities that fit Kubernetes work — they run entirely in this browser tab, so nothing you paste leaves your device.

All Kubernetes guides

More in Kubernetes

All Kubernetes guides

The guides filed next to this one in Kubernetes, in library order.