Kubectl
ImagePullBackOff
minikube
deployment
troubleshooting

Kubectl throws ImagePullBackOff Error while creating deployment via minikube

System Design practice on Codemia

Work through 120+ system design problems with detailed solutions, from rate limiters to multi-region storage.

Practice system design

Introduction

ImagePullBackOff in Minikube means the kubelet tried to fetch your container image and failed repeatedly. In local Minikube setups, the cause is often not a bad deployment manifest but a mismatch between where the image was built and where the Kubernetes node is trying to pull it from.

Start with the Actual Pod Error

The first step is to inspect the pod events instead of guessing.

bash
kubectl describe pod <pod-name>

Look near the bottom for messages such as:

  • image not found
  • access denied
  • unauthorized
  • manifest unknown
  • connection timeout

Those event lines tell you whether the problem is a wrong image name, a registry authentication issue, or a local-image visibility issue.

The Most Common Minikube Cause: Local Image Not Available to the Node

Many developers build an image on the host machine and assume Minikube can see it automatically. That is not always true, because Minikube may be running its own container runtime environment.

A deployment like this:

yaml
1apiVersion: apps/v1
2kind: Deployment
3metadata:
4  name: demo
5spec:
6  replicas: 1
7  selector:
8    matchLabels:
9      app: demo
10  template:
11    metadata:
12      labels:
13        app: demo
14    spec:
15      containers:
16        - name: demo
17          image: demo-app:latest
18          imagePullPolicy: IfNotPresent

works only if the Minikube node can actually access demo-app:latest.

Reliable Fixes for Local Images

One approach is to load the image into Minikube explicitly:

bash
docker build -t demo-app:latest .
minikube image load demo-app:latest

Another common workflow is to build directly against the Minikube runtime environment:

bash
eval $(minikube docker-env)
docker build -t demo-app:latest .

After that, redeploy or restart the pod.

If the image is local-only, make sure the pull policy does not force a registry lookup every time. IfNotPresent is usually the right choice in local development.

Private Registry Problems

If the image lives in a private registry, Minikube still needs credentials just like any other Kubernetes cluster.

Create a pull secret:

bash
1kubectl create secret docker-registry regcred \
2  --docker-server=my-registry.example.com \
3  --docker-username=myuser \
4  --docker-password=mypassword

Then reference it in the pod spec:

yaml
1spec:
2  imagePullSecrets:
3    - name: regcred
4  containers:
5    - name: demo
6      image: my-registry.example.com/demo-app:1.0.0

Without this, the pod may fail with an auth-related ImagePullBackOff even when the image name itself is correct.

Tag and Naming Mistakes

Do not overlook the simple causes. demo-app:latest, demo-app, and myuser/demo-app:latest are not the same image reference. A typo in the registry path or tag is enough to trigger the error.

Check the image actually exists:

bash
docker images | grep demo-app

And if you are using a remote registry, verify the tag was pushed successfully before creating the deployment.

Common Pitfalls

The biggest pitfall is building the image locally on the host and forgetting that Minikube may use a separate runtime. The pod then tries to pull an image that only exists on your laptop's Docker daemon.

Another issue is leaving imagePullPolicy: Always in a local development manifest. That can force Minikube to pull from a registry even when a suitable local image exists.

Developers also sometimes inspect only the deployment object instead of the pod events. kubectl describe pod is usually where the useful error details live.

Finally, if you change an image but reuse the same tag, remember that Kubernetes and the runtime may cache aggressively. In local workflows, a fresh tag or explicit reload is often clearer.

Summary

  • 'ImagePullBackOff means the node could not obtain the image after repeated tries.'
  • In Minikube, the most common cause is that the image was built locally but not loaded into the Minikube runtime.
  • Use kubectl describe pod first to see the exact pull failure.
  • Load local images with minikube image load or build directly inside Minikube's Docker environment.
  • For private registries, configure imagePullSecrets correctly.

Related reading
Course
Beginner
27 lessons
10 hours
System Design Fundamentals

Build a strong foundation in designing scalable, reliable distributed systems.

View the course
Track 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.

Practice system design

All Rights Reserved.