I\'m trying to run my first kubernetes pod locally. I\'ve run the following command (from here):
export ARCH=amd64
docker run -d \\
--volume=/:/rootfs:ro \\
By default Kubernetes looks in the public Docker registry to find images. If your image doesn't exist there it won't be able to pull it.
You can run a local Kubernetes registry with the registry cluster addon.
Then tag your images with localhost:5000
:
docker tag aii localhost:5000/dev/aii
Push the image to the Kubernetes registry:
docker push localhost:5000/dev/aii
And change run-aii.yaml to use the localhost:5000/dev/aii
image instead of aii
. Now Kubernetes should be able to pull the image.
Alternatively, you can run a private Docker registry through one of the providers that offers this (AWS ECR, GCR, etc.), but if this is for local development it will be quicker and easier to get setup with a local Kubernetes Docker registry.
I had the same problem what caused it was that I already had created a pod from the docker image via the .yml file, however I mistyped the name, i.e test-app:1.0.1 when I needed test-app:1.0.2 in my .yml file. So I did kubectl delete pods --all
to remove the faulty pod then redid the kubectl create -f name_of_file.yml
which solved my problem.
One issue that may cause an ImagePullBackOff
especially if you are pulling from a private registry is if the pod is not configured with the imagePullSecret
of the private registry.
An authentication error may cause an imagePullBackOff
.