Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdilsonFuxe/0f82891ab7cf32b21fc605e555bf8e81 to your computer and use it in GitHub Desktop.
Save AdilsonFuxe/0f82891ab7cf32b21fc605e555bf8e81 to your computer and use it in GitHub Desktop.
Kurbenetes ErrImagePull, ErrImageNeverPull and ImagePullBackoff Errors
If your pods are showing ErrImagePull, ErrImageNeverPull, or ImagePullBackOff errors after running kubectl apply, the simplest solution is to provide an imagePullPolicy to the pod.
First, run kubectl delete -f infra/k8s/
Then, update your pod manifest:
spec:
containers:
- name: posts
image: cygnet/posts:0.0.1
imagePullPolicy: Never
Then, run kubectl apply -f infra/k8s/
This will ensure that Kubernetes will use the image built locally from your image cache instead of attempting to pull from a registry.
Minikube Users:
If you are using a vm driver, you will need to tell Kubernetes to use the Docker daemon running inside of the single node cluster instead of the host.
Run the following command:
eval $(minikube docker-env)
Note - This command will need to be repeated anytime you close and restart the terminal session.
Afterward, you can build your image:
docker build -t USERNAME/REPO .
Update, your pod manifest as shown above and then run:
kubectl apply -f infra/k8s/
https://minikube.sigs.k8s.io/docs/commands/docker-env/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment