kubectl不是在一个节点上寻找本地图像,而是在其他节点上正常工作

时间:2018-03-23 01:53:48

标签: docker kubernetes kubectl

我在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

我有一个简单的部署:

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

所以当我尝试部署这个时,我有3个pod并且pod1在node1中都很好但是在node2上它显示错误:

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

但我仍然在我的node2注册中拥有nginx:1.13:

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

1 个答案:

答案 0 :(得分:2)

将图片名称从10.3.5.206:5000/nginx更改为nginx