Interview Prep/Kubernetes/Pod startup failures

Pulls from Docker Hub randomly fail with `toomanyrequests: You have reached your pull rate limit`.

IntermediateTroubleshootingPod startup failures
Answer

Likely causes → Anonymous Docker Hub pulls are rate-limited per source IP. All nodes behind one NAT gateway share the quota, and autoscaling events cause pull bursts.

Diagnose →

kubectl get events -A --field-selector reason=Failed | grep toomanyrequests
kubectl get pods -A -o jsonpath='{..image}' | tr ' ' '\n' | grep -v '\.' | sort -u   # images with no registry host = docker.io

Fix → Authenticate pulls with a Docker Hub account secret, or mirror images into your own registry (ECR pull-through cache, Harbor proxy cache) and rewrite image references.

Prevent → Policy (Kyverno/Gatekeeper) that only allows images from your registry; imagePullPolicy: IfNotPresent with pinned tags so nodes reuse cached layers.

All Kubernetes questions Roadmap: Kubernetes core

More on Pod startup failures