ErrImageNeverPull when deploying to Minikube

9/5/2019

Created a simple MVC app in VS2019. Created a Dockerfile and ran docker build successfully.

Was able to successfully run with:

docker run -d -p 8080:80 --name mvc2 mvc2

browsing to localhost:8080 opens up mvc home page.

Issue is that when I deploy to minikube I get ErrImageNeverPull

My deployment.yaml:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: mvc
spec:
  replicas: 1
  template:
    metadata:
      labels:
        app: mvc
    spec:
      containers:
      - name: mvc
        imagePullPolicy: Never # <-- here we go!
        image: mvc2:latest
        ports:
        - containerPort: 80

Output: enter image description here

-- ShaneKm
.net
c#
docker
kubernetes
minikube

1 Answer

9/5/2019

Probably you missed performing the eval of Minikube Docker env (eval $(minikube docker-env) on Unix like but, since you're running Win, minikube docker-env | Invoke-Expression) before creating the Docker image.

So, right now, you have two options:

  1. copy the mvc2:latest image using the Docker save command
  2. build the mvc2:latest image using the Docker environment variables in order to get it saved on Minikube.
-- prometherion
Source: StackOverflow