码迷,mamicode.com
首页 > 其他好文 > 详细

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

时间:2018-07-01 16:55:52      阅读:471      评论:0      收藏:0      [点我收藏+]

标签:etc   bsp   back   als   -o   rhs   python-r   docker   tee   

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

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  就可以解决,但是我最近温习一遍后发现这个rhsm文件被调换了,下载后发现是空的,然后找方法解决。

 

解决方法:下载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

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

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

           -i   还原备份档  

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

最后解决了!

技术分享图片

 

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

标签:etc   bsp   back   als   -o   rhs   python-r   docker   tee   

原文地址:https://www.cnblogs.com/lyq863987322/p/9250470.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!