The kubelet asks the runtime to pull Pod web in namespace shop is scheduled on worker-1 with image registry.example.com/shop/web:1.4.2. The kubelet sees the image is not on the node and asks the container runtime to pull it over CRI.
The kubelet does not download anything itself. It hands the runtime the image name and any credentials it found for that registry. The runtime talks to the registry.
No credentials: the registry answers 401 The runtime asks the registry for the image manifest without a login. A private registry answers 401 Unauthorized. The kubelet records a Failed event, Failed to pull image ... 401 Unauthorized, and the container waits with ErrImagePull.
The kubelet retries with a growing delay, up to 5 minutes, and the status shows ImagePullBackOff in between. Retrying alone never helps, because nothing about the request changes.
Watch out Read the Failed event message, not just the status. 401 or unauthorized means the login is missing or wrong.
An imagePullSecret gives the Pod a login kubectl create secret docker-registry regcred --docker-server=registry.example.com --docker-username=... --docker-password=... -n shop creates a Secret of type kubernetes.io/dockerconfigjson. It holds a .dockerconfigjson file, the same format docker login writes.
The Pod lists it under spec.imagePullSecrets. The kubelet reads the Secret, picks the entry that matches the image's registry, and passes it with the pull request. The registry checks it, and the pull succeeds.
Key idea Use a read-only robot or token account for pull secrets, not a person's password.
Put the secret on the ServiceAccount once Writing imagePullSecrets into every Pod is easy to forget. Instead, add regcred to the ServiceAccount the Pods run as: kubectl patch serviceaccount default -n shop -p '{"imagePullSecrets":[{"name":"regcred"}]}'.
When a Pod is created, the ServiceAccount admission plugin copies the account's imagePullSecrets into the Pod spec. Pods that already exist are not changed, so restart them to pick it up.
Key idea kubectl get pod web -o jsonpath='{.spec.imagePullSecrets}' shows what the Pod actually got.
A Secret in another namespace does not count Pod report runs in namespace batch with the same image and imagePullSecrets: regcred. It fails with 401 again. A Pod can only use pull secrets from its own namespace, and batch has no regcred.
The kubelet adds a hint: event FailedToRetrieveImagePullSecret, Unable to retrieve some image pull secrets (regcred). Create the Secret in each namespace that needs it, by hand or with a tool that copies Secrets across namespaces.
Watch out Secrets are namespaced. The name in imagePullSecrets is always looked up in the Pod's own namespace.
Cloud registries: let the node fetch short-lived tokens With a cloud registry (for example ECR, Artifact Registry or ACR), you usually skip pull secrets. The kubelet runs a credential provider plugin, set with --image-credential-provider-config and --image-credential-provider-bin-dir. For images that match the plugin's matchImages, the kubelet calls it to get a short-lived login.
The plugin gets that login from the node's cloud identity. There is no long-lived password in any namespace, and the token rotates by itself. Newer versions can also pass the Pod's ServiceAccount token to the plugin, so access can follow the workload instead of the node.
Key idea Node-wide credentials let every Pod on the node pull those images. Use per-workload identity or pull secrets when teams must be kept apart.
Not every pull error is a login problem manifest unknown or not found means the registry let you in but has no such name or tag. Check the spelling, the tag and the architecture. Credentials are fine.
toomanyrequests with HTTP 429 is a rate limit. Docker Hub limits pulls per account or, without a login, per source IP. Many nodes behind one NAT address share that limit, so a large rollout or a node pool scale-up can hit it at once.
Watch out 401 or unauthorized: credentials. manifest unknown: name or tag. 429 toomanyrequests: rate limit. timeout: network or DNS.
A pull-through cache absorbs repeated pulls Point the runtime at a mirror. In containerd, a hosts.toml file under /etc/containerd/certs.d/docker.io/ lists the mirror first and the upstream as fallback. Image names in Pods do not change.
The first pull goes through the cache to Docker Hub, with one account's login. Every later pull of the same layers is served from the cache. That cuts rate-limit hits and keeps pulls working when the upstream is slow or down. Harbor proxy caches and cloud pull-through caches are common examples.
Key idea Mirror config lives on the node, so roll it out with the node image or node bootstrap, not with kubectl.
A cached image used to skip the credential check With imagePullPolicy IfNotPresent, an image already on the node is used without asking the registry. In the past, a Pod with no valid login could start a private image just because another Pod had pulled it to the same node.
The KubeletEnsureSecretPulledImages feature gate closes that gap. It is beta and on by default since Kubernetes v1.35. The kubelet remembers which credentials pulled each image and checks a new Pod's credentials before reusing it. The kubelet setting imagePullCredentialsVerificationPolicy defaults to NeverVerifyPreloadedImages, so images placed on the node outside the kubelet are not checked.
Watch out On older clusters, use imagePullPolicy Always or the AlwaysPullImages admission plugin when tenants share nodes.
Know where the login comes from The runtime pulls; the kubelet gives it credentials from the Pod's imagePullSecrets, which may come from the ServiceAccount, or from a credential provider plugin on the node. Pull secrets must live in the Pod's own namespace.
Read the pull error before changing anything: 401 is credentials, manifest unknown is the name or tag, 429 is a rate limit. A mirror reduces upstream pulls, and credential verification stops cached images from being shared without a login.
Summary For any ImagePullBackOff, run kubectl describe pod and read the Failed event message to the end.