<p>I'm trying to run Kubernetes on Windows using Minikube and Hyper-V. I've managed to succesfully run Minikube using <code>minikube start --vm-driver=hyperv --hyperv-virtual-switch=KuberNAT</code> and checking <code>minikube status</code> gives me</p>

<pre><code>PS &gt; minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.1.74
</code></pre>

<p>but now I'm trying to run an image in kubernetes using kubectl, I've managed to get my powershell window to point towards the kubernetes vm with <code>minikube docker-env | Invoke-Expression</code> (powershell only, I haven't been able to do something similar on Command Prompt) and I have to insert this command in every powershell window I want to use to push an image to the kubernetes images.</p>

<p>The issue I'm having is that that I can't run a container, I can "deploy" an image with <code>kubectl run cloudconfig --image=cloudconfig</code> but the created pod is giving me this error:</p>

<blockquote>
<pre><code>Failed to pull image "cloudconfig": rpc error: code = Unknown desc =
Error response from daemon: repository cloudconfig not found: does not
exist or no pull access
</code></pre>
</blockquote>

<p>If I run <code>docker image ls</code> I get</p>

<pre><code>REPOSITORY                                             TAG                 IMAGE ID            CREATED             SIZE
cloudconfig                                            latest              9199d500e746        2 minutes ago       105MB
openjdk                                                8-jre-alpine        5699ac7295f9        6 days ago          81.4MB
gcr.io/google_containers/k8s-dns-sidecar-amd64         1.14.5              fed89e8b4248        5 weeks ago         41.8MB
gcr.io/google_containers/k8s-dns-kube-dns-amd64        1.14.5              512cd7425a73        5 weeks ago         49.4MB
gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64   1.14.5              459944ce8cc4        5 weeks ago         41.4MB
gcr.io/google_containers/kubernetes-dashboard-amd64    v1.7.0              284ec2f8ed6c        5 weeks ago         128MB
gcr.io/google-containers/kube-addon-manager            v6.4-beta.2         0a951668696f        4 months ago        79.2MB
gcr.io/google_containers/pause-amd64                   3.0                 99e59f495ffa        18 months ago       747kB
</code></pre>

<p>and <code>docker container ls</code> gives me</p>

<pre><code>CONTAINER ID        IMAGE                                                  COMMAND                  CREATED             STATUS              PORTS               NAMES
3d79bab2a212        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 41 seconds ago      Up 40 seconds                           k8s_POD_cloudconfig-88c867589-qpqph_default_ac2dd8bb-bee1-11e7-8e51-00155d00ba16_0
e6723a726c26        gcr.io/google_containers/k8s-dns-sidecar-amd64         "/sidecar --v=2 --..."   43 minutes ago      Up 43 minutes                           k8s_sidecar_kube-dns-6fc954457d-gvmz6_kube-system_f5de0b0e-be4b-11e7-8699-00155d00ba16_1
36980feeff76        gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64   "/dnsmasq-nanny -v..."   43 minutes ago      Up 43 minutes                           k8s_dnsmasq_kube-dns-6fc954457d-gvmz6_kube-system_f5de0b0e-be4b-11e7-8699-00155d00ba16_1
d3d61e3861f0        gcr.io/google_containers/k8s-dns-kube-dns-amd64        "/kube-dns --domai..."   43 minutes ago      Up 43 minutes                           k8s_kubedns_kube-dns-6fc954457d-gvmz6_kube-system_f5de0b0e-be4b-11e7-8699-00155d00ba16_1
45208e98bd7f        gcr.io/google_containers/kubernetes-dashboard-amd64    "/dashboard --inse..."   43 minutes ago      Up 43 minutes                           k8s_kubernetes-dashboard_kubernetes-dashboard-8hw2w_kube-system_f5bb8241-be4b-11e7-8699-00155d00ba16_1
1fbb3688711d        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 43 minutes ago      Up 43 minutes                           k8s_POD_kube-dns-6fc954457d-gvmz6_kube-system_f5de0b0e-be4b-11e7-8699-00155d00ba16_1
c71ab868584c        gcr.io/google-containers/kube-addon-manager            "/opt/kube-addons.sh"    43 minutes ago      Up 43 minutes                           k8s_kube-addon-manager_kube-addon-manager-minikube_kube-system_9831e93c3188555873fdb49f43198eef_1
1df643d195d2        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 43 minutes ago      Up 43 minutes                           k8s_POD_kubernetes-dashboard-8hw2w_kube-system_f5bb8241-be4b-11e7-8699-00155d00ba16_1
28f48e09fd46        gcr.io/google_containers/pause-amd64:3.0               "/pause"                 43 minutes ago      Up 43 minutes                           k8s_POD_kube-addon-manager-minikube_kube-system_9831e93c3188555873fdb49f43198eef_1
</code></pre>

<p>So I'm assuming all the other things are working correctly and kubernetes just somehow doesn't know where to find my image. Does anyone know how I can get it working?</p>

<p>I've found the solution, it's suggested by a user in <a href="https://github.com/kubernetes/kubernetes/issues/24903#issuecomment-274319080" rel="nofollow noreferrer">this</a> github thread</p>

<blockquote>
  <p>If anyone else ends up on this thread, the solution that worked for me
  was updating the image pull policy, you can find info on this here.
  From the docs: Be default, the kubelet will try to pull each image
  from the specified registry. You need to update this so it can look
  locally.</p>
  
  <p>If you're running from the CLI, add --image-pull-policy=IfNotPresent
  to your kubectl run, i.e.</p>
  
  <p>kubectl run some-node-proj --image=my-awesome-local-image:v1
  --image-pull-policy=IfNotPresent</p>
</blockquote>

<p>adding <code>--image-pull-policy=IfNotPresent</code> allowed me to run the containers no problem.</p>
