K8S Failed to pull image from local repo
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.
Introduction
When Kubernetes says it failed to pull an image from a "local repo," the first thing to clarify is what "local" means. From your laptop's perspective, the image might be local. From the node's perspective, it may not exist at all. Most pull failures happen because the node cannot see the image, cannot reach the registry, or is trying to pull when it should be using a locally loaded image instead.
Start with the Node's Point of View
Kubernetes pulls images from the perspective of the node that runs the pod. That means these are very different situations:
- The image exists only in your workstation's Docker daemon.
- The image exists in a registry reachable by the nodes.
- The image was loaded directly into the cluster runtime.
If you built an image locally on your laptop and then deployed a pod that references it, a remote cluster node cannot magically see that image. You must either push it to a reachable registry or load it into the cluster's runtime environment.
Check the Exact Error First
Before changing anything, inspect the pod events:
Look for messages such as:
ErrImagePullImagePullBackOff- authentication failures
- "not found" for the image name or tag
Those messages tell you whether the problem is naming, registry access, or node visibility.
Use the Right Strategy for Local Clusters
For local Kubernetes distributions, there is usually a cluster-specific way to make local images available.
For kind:
For Minikube:
After that, reference the image directly in the pod spec and avoid forcing a remote pull if the image already exists on the node runtime.
If you use Always, Kubernetes may still try to contact a registry even when the image exists locally.
Use a Reachable Registry for Real Multi-Node Setups
If the cluster is not purely local, the more scalable solution is to push the image to a registry that every node can reach.
Then use that full image reference in the manifest:
This avoids workstation-specific assumptions and makes scheduling across multiple nodes predictable.
Handle Private Registry Credentials Explicitly
If the image lives in a private registry, create an image pull secret and attach it to the pod or service account.
Then reference it:
Without the secret, Kubernetes may reach the registry correctly but still fail the pull because the node is unauthorized.
Verify Image Name, Tag, and Pull Policy Together
These settings interact more than people expect:
- Wrong tag means "not found."
imagePullPolicy: Alwaysmeans the node keeps contacting the registry.Nevermeans Kubernetes will fail unless the image already exists on the node.
For local testing, IfNotPresent is often the safest balance. For CI or shared clusters, explicit tags plus a real registry are usually better than relying on local cache state.
Do Not Confuse the Registry with the Runtime
A "local repo" might mean:
- The local Docker image cache.
- A registry container running on the same machine.
- An insecure registry reachable only on localhost.
Those are not interchangeable. If the registry is bound only to localhost, remote nodes cannot reach it. If the image is only in Docker on your laptop, the cluster runtime cannot use it unless you load or push it appropriately.
Common Pitfalls
- Assuming an image built on the workstation is automatically visible to Kubernetes nodes.
- Using
imagePullPolicy: Alwaysduring local development and forcing unnecessary registry lookups. - Pushing to a private registry but forgetting the
imagePullSecretsconfiguration. - Referencing the wrong image tag and then debugging networking instead of the manifest.
- Running a "local registry" that is only reachable from localhost rather than from the nodes that need it.
Summary
- Debug image pulls from the node's perspective, not from the workstation's perspective.
- For local clusters, load the image into the cluster runtime or configure a reachable registry.
- For shared or multi-node clusters, push images to a registry every node can access.
- Use image pull secrets for private registries.
- Check image name, tag, registry reachability, and pull policy together instead of in isolation.
Related reading
- K8s how to install charts from the Helm Hub
- K8s NodePort service is “unreachable by IP” only on 2/4 slaves in the cluster
- K8S Read config map via go API
- Kafka Find Controller ID in a cluster using Kraft protocol
- Kafka-docker container scaling failed for wurstmeister with error as advertised listeners are already registered by broker 1001
- Kafka - Docker - Error when sending message from Host to Container (Batch Expired)
- Kafka - How to commit offset after every message using High-Level consumer?
- Kafka - Offset Commit & Seek

System Design Fundamentals
Build a strong foundation in designing scalable, reliable distributed systems.
View the courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
System Design practice on Codemia
Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.