<p>kubernetes cannot pull a public image. Standard images like nginx are downloading successfully, but my pet project is not downloading. I'm using minikube for launch kubernetes-cluster</p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: api-gateway-deploumnet
  labels:
    app: api-gateway
spec:
  replicas: 3
  selector:
    matchLabels:
      app: api-gateway
  template:
    metadata:
      labels:
        app: api-gateway
    spec:
      containers:
      - name: api-gateway
        image: creatorsprodhouse/api-gateway:latest
        imagePullPolicy: Always
        ports:
        - containerPort: 80
</code></pre>
<p>when I try to create a deployment I get an error that kubernetes cannot download my public image.</p>
<pre class="lang-bash prettyprint-override"><code>$ kubectl get pods
</code></pre>
<p>result:</p>
<pre class="lang-js prettyprint-override"><code>NAME                                      READY   STATUS             RESTARTS   AGE
api-gateway-deploumnet-599c784984-j9mf2   0/1     ImagePullBackOff   0          13m
api-gateway-deploumnet-599c784984-qzklt   0/1     ImagePullBackOff   0          13m
api-gateway-deploumnet-599c784984-csxln   0/1     ImagePullBackOff   0          13m
</code></pre>
<pre class="lang-bash prettyprint-override"><code>$ kubectl logs api-gateway-deploumnet-599c784984-csxln 
</code></pre>
<p>result</p>
<pre><code>Error from server (BadRequest): container &quot;api-gateway&quot; in pod &quot;api-gateway-deploumnet-86f6cc5b65-xdx85&quot; is waiting to start: trying and failing to pull image
</code></pre>
<p>What could be the problem? The standard images are downloading but my public one is not. Any help would be appreciated.</p>
<p><strong>EDIT 1</strong></p>
<pre><code>$ api-gateway-deploumnet-599c784984-csxln
</code></pre>
<p>result:</p>
<pre><code>Events:
  Type     Reason     Age                    From               Message
  ----     ------     ----                   ----               -------
  Normal   Scheduled  8m22s                  default-scheduler  Successfully assigned default/api-gateway-deploumnet-849899786d-mq4td to minikube
  Warning  Failed     3m8s                   kubelet            Failed to pull image &quot;creatorsprodhouse/api-gateway:latest&quot;: rpc error: code = Unknown desc = context deadline exceeded
  Warning  Failed     3m8s                   kubelet            Error: ErrImagePull
  Normal   BackOff    3m7s                   kubelet            Back-off pulling image &quot;creatorsprodhouse/api-gateway:latest&quot;
  Warning  Failed     3m7s                   kubelet            Error: ImagePullBackOff
  Normal   Pulling    2m53s (x2 over 8m21s)  kubelet            Pulling image &quot;creatorsprodhouse/api-gateway:latest&quot;
</code></pre>
<p><strong>EDIT 2</strong></p>
<p>If I try to download a separate docker image, it's fine</p>
<pre><code>$ docker pull creatorsprodhouse/api-gateway:latest
</code></pre>
<p>result:</p>
<pre><code>Digest: sha256:e664a9dd9025f80a3dd60d157ce1464d4df7d0f8a00538e6a137d44f9f9f12aa
Status: Downloaded newer image for creatorsprodhouse/api-gateway:latest
docker.io/creatorsprodhouse/api-gateway:latest
</code></pre>
<p><strong>EDIT 3</strong>
After advice to restart minikube</p>
<pre><code>$ minikube stop

$ minikube delete --purge

$ minikube start --cni=calico
</code></pre>
<p>I started the pods.</p>
<pre><code>
Events:
  Type     Reason                  Age    From               Message
  ----     ------                  ----   ----               -------
  Normal   Scheduled               4m28s  default-scheduler  Successfully assigned default/api-gateway-deploumnet-849899786d-bkr28 to minikube
  Warning  FailedCreatePodSandBox  4m27s  kubelet            Failed to create pod sandbox: rpc error: code = Unknown desc = [failed to set up sandbox container &quot;7e112c92e24199f268ec9c6f3a6db69c2572c0751db9fd57a852d1b9b412e0a1&quot; network for pod &quot;api-gateway-deploumnet-849899786d-bkr28&quot;: networkPlugin cni failed to set up pod &quot;api-gateway-deploumnet-849899786d-bkr28_default&quot; network: failed to set bridge addr: could not add IP address to &quot;cni0&quot;: permission denied, failed to clean up sandbox container &quot;7e112c92e24199f268ec9c6f3a6db69c2572c0751db9fd57a852d1b9b412e0a1&quot; network for pod &quot;api-gateway-deploumnet-849899786d-bkr28&quot;: networkPlugin cni failed to teardown pod &quot;api-gateway-deploumnet-849899786d-bkr28_default&quot; network: running [/usr/sbin/iptables -t nat -D POSTROUTING -s 10.85.0.34 -j CNI-57e7da7379b524635074e6d0 -m comment --comment name: &quot;crio&quot; id: &quot;7e112c92e24199f268ec9c6f3a6db69c2572c0751db9fd57a852d1b9b412e0a1&quot; --wait]: exit status 2: iptables v1.8.4 (legacy): Couldn't load target `CNI-57e7da7379b524635074e6d0':No such file or directory

Try `iptables -h' or 'iptables --help' for more information.

</code></pre>

MiyRon
<p>I could not solve the problem in the ways I was suggested. However, it worked when <strong>I ran minikube with a different driver</strong></p>
<pre><code>$ minikube start --driver=none
</code></pre>
<p><em><strong>--driver=none</strong></em> means that the cluster will run on your host instead of the standard <em><strong>--driver=docker</strong></em> which runs the cluster in docker.</p>
<p>It is better to run minikube with <em><strong>--driver=docker</strong></em> as it is safer and easier, but it didn't work for me as I could not download my images. For me personally it is ok to use <em><strong>--driver=none</strong></em> although it is a bit dangerous.</p>
<p>In general, if anyone knows what the problem is, please answer my question. In the meantime you can try to run minikube cluster on your host with the command I mentioned above.</p>
<p>In any case, thank you very much for your attention!</p>
