使用k8s创建容器一直处于ContainerCreating状态

容器报错信息为(两种):

FailedSynError 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)" 13m 11s 56 {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\""

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)"

大致意思就是:未能通过ErrImagePull为“POD”启动“StartContainer”:“对于registry.access.redhat.com/rhel7/pod-infrastructure:latest,图像拉出失败,这可能是因为此请求上没有证书

检查发现:/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt这个目录中是一个软连接

 

发现实际上并没有这个文件:

 

其实在我的k8s编排工具使用文档中我提过这个错误,说是因为证书导致的, 网上很多文档说下载一个  yum remove *rhsm* -y  就可以解决,实际不是的

 

解决方法:下载rpm包安装

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

最后解决了!

 

 

 

Logo

技术共进,成长同行——讯飞AI开发者社区

更多推荐