<p>I using kbuernetes &amp; docker in a isolate environment without Internet, and I always pull image and save to .tar file in other machine and load to the isolate environment, but sometimes kubernetes's Pod cann't launch successful and says the Pod is pull image but network is not ok.
But I check docker's image, the image has loaded, why I also need to pull the same image again?</p>

<p><strong>this is docker's image, MYSQL's image has loaded:</strong></p>

<pre><code>[root@localhost kubecfg]# docker images
REPOSITORY                                                       TAG                 IMAGE ID            CREATED             SIZE
quay.io/kubernetes-ingress-controller/nginx-ingress-controller   0.12.0              4a9cd8a2008a        3 weeks ago         230.5 MB
docker.io/mysql                                                  latest              5195076672a7        3 weeks ago         371.4 MB
gcr.io/google_containers/kube-apiserver-amd64                    v1.9.2              7109112be2c7        11 weeks ago        210.4 MB
</code></pre>

<p><strong>this is kubernetes's error log</strong></p>

<pre><code>[root@localhost kubecfg]# kubectl describe pod mysql-vmwdw
Name:           mysql-vmwdw
Namespace:      default
Node:           localhost.localdomain/192.168.88.129
Start Time:     Mon, 02 Apr 2018 14:14:07 +0800
Labels:         app=mysql
Annotations:    &lt;none&gt;
Status:         Running
IP:             192.168.0.61
Controlled By:  ReplicationController/mysql
Containers:
  mysql:
    Container ID:   docker://9aa3128eaa1f330dfd0d6ebf732dca5a99ad49d7d6d4002a2384bdb03e056d7d
    Image:          docker.io/mysql
    Image ID:       docker-pullable://docker.io/mysql@sha256:691c55aabb3c4e3b89b953dd2f022f7ea845e5443954767d321d5f5fa394e28c
    Port:           3306/TCP
    State:          Waiting
      Reason:       ImagePullBackOff
    Last State:     Terminated
      Reason:       Error
      Exit Code:    1
      Started:      Tue, 10 Apr 2018 14:56:04 +0800
      Finished:     Wed, 11 Apr 2018 08:56:04 +0800
    Ready:          False
    Restart Count:  3
    Environment:
      MYSQL_ROOT_PASSWORD:  123456
    Mounts:
      /var/run/secrets/kubernetes.io/serviceaccount from default-token-s7kq2 (ro)
Conditions:
  Type           Status
  Initialized    True 
  Ready          False 
  PodScheduled   True 
Volumes:
  default-token-s7kq2:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  default-token-s7kq2
    Optional:    false
QoS Class:       BestEffort
Node-Selectors:  &lt;none&gt;
Tolerations:     node.kubernetes.io/not-ready:NoExecute for 300s
                 node.kubernetes.io/unreachable:NoExecute for 300s
Events:
  Type     Reason                  Age                 From                            Message
  ----     ------                  ----                ----                            -------
  Normal   SuccessfulMountVolume   19m                 kubelet, localhost.localdomain  MountVolume.SetUp succeeded for volume "default-token-s7kq2"
  Normal   SandboxChanged          19m (x12 over 19m)  kubelet, localhost.localdomain  Pod sandbox changed, it will be killed and re-created.
  Warning  FailedCreatePodSandBox  19m (x12 over 19m)  kubelet, localhost.localdomain  Failed create pod sandbox.
  Warning  Failed                  9m (x6 over 18m)    kubelet, localhost.localdomain  Failed to pull image "docker.io/mysql": rpc error: code = Unknown desc = Network timed out while trying to connect to https://index.docker.io/v1/repositories/library/mysql/images. You may want to check your internet connection or if you are behind a proxy.
  Warning  Failed                  4m (x41 over 18m)   kubelet, localhost.localdomain  Error: ImagePullBackOff
</code></pre>

<p>It says:   <strong>" Failed to pull image "docker.io/mysql": rpc error: code = Unknown desc = Network timed out while trying to connect to <a href="https://index.docker.io/v1/repositories/library/mysql/images" rel="nofollow noreferrer">https://index.docker.io/v1/repositories/library/mysql/images</a>. You may want to check your internet connection or if you are behind a proxy."</strong></p>

<p>I had load the image, why docker would pull the same image again? And what should I do to resolve the problem?</p>

<p>In your case creating the deployment by</p>

<pre><code> kubectl run mysql --image=docker.io/mysql --imagePullPolicy=Never
</code></pre>

<p>should solve the problem. Alternatively you could set <code>imagePullPolicy</code> to <code>Never</code> or <code>IfNotPresent</code> in the <code>yaml</code> spec of your deployment to fix this error.</p>
