kubernetes启动容器时,容器一直是ContainerCreating不能running

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了。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值