Why am I getting an ErrImagePull error in this Kubernetes deployment? Why am I getting an ErrImagePull error in this Kubernetes deployment? kubernetes kubernetes

Why am I getting an ErrImagePull error in this Kubernetes deployment?


It looks like you're running the registry on the host. In fact, you need to run the registry inside the VM. You can point your docker client to the docker daemon inside the minikube VM by running this command firsteval $(minikube docker-env)in your shell.

Then, you can run the docker build command on your host, but it will build inside the VM.

In fact, if your goal is to simply run the local version of your images, you should run the eval $(minikube docker-env) to point towards the docker daemon in your VM, and set the imagePullPolicy: IfNotPresent in your pod YAML. Then, kubernetes will use a locally built image if available.


Had a same issue with Docker-Desktop > Kubernetes and I tried setting imagePullPolicy to Never and it just worked.

As I understood from kubectl describe pod mypd, Kubectl was trying to pull the image, and of course this image doesn't exis on remote server, hence the failure.

Above property will avoid connecting to registry and will use image from docker local images cache.

spec:  template:    spec:      containers:        - image: my/local-image          imagePullPolicy: Never