pod状态一直是ContainerCreating ,不能变成Running的状态。
查找错误
kubectl describe pod mysql-b0xrn
查看pod状态,发现错误:
21m 4m 8 {kubelet 127.0.0.1} Warning 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)"
20m 3s 89 {kubelet 127.0.0.1} 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\""
试着用docker pull 下载
docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest
又出现以下错误:
Trying to pull repository registry.access.redhat.com/rhel7/pod-infrastructure ...
open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory
进入到
/etc/docker/certs.d/registry.access.redhat.com/
目录,发现redhat-ca.crt是一个软连接,指向/etc/rhsm/ca/redhat-uep.pem。
去网上查找解决办法
yum install *rhsm*
下载完成之后,/etc/下面是有rhsm/ca 目录,但是ca文件夹下面没有redhat-uep.pem文件,试着用下述方法解决:
wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
rpm2cpio python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm | cpio -iv --to-stdout ./etc/rhsm/ca/redhat-uep.pem | tee /etc/rhsm/ca/redhat-uep.pem
运行完这两个命令,删除掉原来的rc,重新create。就OK了。