kubectl is not looking for local image on one node but works fine on other node

3/23/2018

I have a two node cluster in AWS:

[centos@node2 sample_code]$ kubectl get nodes
NAME      STATUS    ROLES         AGE       VERSION
node1     Ready     master        3h        v1.9.4+coreos.0
node2     Ready     master,node   3h        v1.9.4+coreos.0

and i have a simple deployment:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
  name: nginx-deployment
  labels:
    app: nginxpinalabel
spec:

  replicas: 3
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx
        image: nginx:1.13
        imagePullPolicy: Never

so when i tried to deploy this, i have 3 pods and which ever pods are in node1 are fine but on node2 it shows error:

NAME                                READY     STATUS              RESTARTS   AGE
nginx-deployment-6c5ff867c5-dtjwr   0/1       ErrImageNeverPull   0          21m
nginx-deployment-6c5ff867c5-jvnvn   0/1       ErrImageNeverPull   0          21m
nginx-deployment-6c5ff867c5-kpzgf   1/1       Running             0          21m

but still i have nginx:1.13 in my registery of node2:

sudo docker images | grep nginx
10.3.5.206:5000/nginx                                   1.13                3f8a4339aadd        12 weeks ago        108.5 MB
-- jamuna
docker
kubectl
kubernetes

1 Answer

3/23/2018

Change the image name from 10.3.5.206:5000/nginx to nginx.

-- Yuankun
Source: StackOverflow