<p>I've created my own image just called <code>v2</code> but when I do <code>kubectl get pods</code>, it keeps erroring out...<code>with Failed to pull image &quot;v2&quot;: rpc error: code = Unknown desc = Error response from daemon: pull access denied for v2, repository does not exist or may require 'docker login': denied: requested access to the resource is denied</code>
I'm using minukube by the way</p>
<p>This is my deployment file, also called v2.yaml</p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  name: v2
spec:
  selector:
    name: v2
  ports:
    - port: 8080
      targetPort: 80
---
# ... Deployment YAML definition
apiVersion: apps/v1
kind: Deployment
metadata:
  name: v2
spec:
  replicas: 1
  selector:
    matchLabels:
      name: v2
  template:
    metadata:
      labels:
        name: v2
    spec:
      containers:
        - name: v2
          image: v2
          ports:
            - containerPort: 80
          imagePullPolicy: IfNotPresent
---
# ... Ingress YAML definition
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
  name: v2
  annotations:
    nginx.ingress.kubernetes.io/rewrite-target: /
spec:
  rules:
    - http:
        paths:
          - path: /second
            pathType: Prefix
            backend:
              service:
                name: v2
                port:
                  number: 8080
</code></pre>
<p>any help gratefully received</p>

<p>My suspicion is that you have built your container image against your local Docker daemon, rather than minikube's. Hence, because your <code>imagePullPolicy</code> is set to <code>IfNotPresent</code>, the node will try pulling it from Docker hub (the default container registry).</p>
<p>You can run <code>minikube ssh</code> to open a shell and then run <code>docker image ls</code> to verify the image is not present in the minikube Docker daemon.</p>
<p>The solution here is to first run the following command from your local shell (i.e. not the one in minikube):</p>
<pre><code>$ eval $(minikube -p minikube docker-env)
</code></pre>
<p>It will set up your current shell to use minikube's docker daemon. After that, in the <strong>same shell</strong>, rebuild your image. Now when minikube tries pulling the image, it should find it and bring up the pod successfully.</p>
