[root@linux - node1 ~] # kubectl create -f hello.yaml pod "hello-world" created [root@linux - node1 ~] # kubectl get pods NAME READY STATUS RESTARTS AGE hello - world 0 / 1 ContainerCreating 0 6s #一直处于ContainerCreating状态,查看生成过程 [root@linux - node1 ~] # kubectl get pods NAME READY STATUS RESTARTS AGE hello - world 0 / 1 ContainerCreating 0 7m [root@linux - node1 ~] # kubectl describe pod hello-world Name: hello - world Namespace: default Node: 192.168 . 182.171 / 192.168 . 182.171 。。。 。。。 arning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ErrImagePull: "image pull failed for registry.access.redhat.com/rhel7/pod-infrastructure:latest, this may be because there are no credentials on this request. details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)" 10m 15s 43 {kubelet 192.168 . 182.171 } Warning FailedSync Error syncing pod, skipping: failed to "StartContainer" for "POD" with ImagePullBackOff: "Back-off pulling image \"registry.access.redhat.com/rhel7/pod-infrastructure:latest\"" #上面的报错原因为不能打开这个文件/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt #通过ll 查看这个文件是否存在,状态是软连接,不停闪烁,说明这个软件接有问题,证书不存在 [root@linux - node2 ~] # ll /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt lrwxrwxrwx 1 root root 27 Jul 19 14 : 02 / etc / docker / certs.d / registry.access.redhat.com / redhat - ca.crt - > / etc / rhsm / ca / redhat - uep.pem #接下来就要生成这个证书文件,注意:是在node节点生成这个证书,而不是master节点 [root@linux - node2 ~] # yum install python-rhsm* -y Installed: subscription - manager - rhsm.x86_64 0 : 1.20 . 11 - 1.el7 .centos subscription - manager - rhsm - certificates.x86_64 0 : 1.20 . 11 - 1.el7 .centos #安装的subscription-manager-rhsm-certificates.x86_64 0:1.20.11-1.el7.centos并不是我们需要的证书安装包,所以要把这个包卸载掉,下载正确的证书安装包 [root@linux - node2 ~] # yum remove subscription-manager-rhsm-certificates.x86_64 0:1.20.11-1.el7.centos [root@linux - node2 ~] # wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm [root@linux - node2 ~] # yum install python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm #这时候再打开这个证书文件软连接就正常了 [root@linux - node2 ~] # ll /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt lrwxrwxrwx 1 root root 27 Jul 19 14 : 11 / etc / docker / certs.d / registry.access.redhat.com / redhat - ca.crt - > / etc / rhsm / ca / redhat - uep.pem #最后重新创建一个编排后,node节点就可以pull拉取对应的images了 |