i build the docker image on my local machine and trying to pull docker image using kubectl. but its not starting the docker container.
images starts with docker command.
REPOSITORY TAG IMAGE ID CREATED SIZE
tomcat9 latest 8b228ac6f19f About an hour ago 111 MB
It stats with ImagePullBackOff massage.
$ kubectl get pods
NAME READY STATUS RESTARTS AGE
tomcat9-511437148-sgkwp 0/1 ImagePullBackOff 0 9m
How can I make kubectl to run this docker image?
Thanks
I see from your comments bellow you are using Minikube locally.
Minikube runs inside a virtual machine, the Docker running inside Minikube and the Docker running on you machine are two separate instances so will not have access to the same images, you can however link the Docker inside Minikube to your local Docker using
eval $(minikube docker-env)
, you can read more here.Also, you can get more information about why the
ImagePullBackOff
has happened by runningkubectl describe pods tomcat9-511437148-sgkwp
.I used this yaml file, now image is deployed on the cluster.