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

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

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,图像拉出失败,这多是由于此请求上没有证书 docker

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

发现实际上并无这个文件:工具

其实在个人k8s编排工具使用文档中我提过这个错误,说是由于证书致使的, 而后下载一个  yum remove *rhsm* -y  就能够解决,可是我最近温习一遍后发现这个rhsm文件被调换了,下载后发现是空的,而后找方法解决。this

 

解决方法:下载rpm包安装spa

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

  注释:rpm2cpio命令用于将rpm软件包转换为cpio格式的文件3d

       cpio命令主要是用来创建或者还原备份档的工具程序,cpio命令能够复制文件到归档包中,或者从归档包中复制文件。          code

           -i   还原备份档  blog

           -v  详细显示指令的执行过程ip

最后解决了!

相关文章
相关标签/搜索