open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory

本文介绍了解决Kubernetes中容器启动失败的问题,特别是当遇到因证书文件缺失导致的ContainerCreating状态时的具体步骤。通过更换镜像源和修改kubelet配置等方法,最终实现了容器的成功部署。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory

容器ContainerCreating

查看容器状态为ContainerCreating
kubectl get pod
nginx-2168765860-v3ph8 0/1 ContainerCreating 0 20s

FailedSync原因

查看容器信息:
kubectl describe nginx-2168765860-v3ph8
提示错误:
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)”

百度网上的解决方法

方法一. yum安装(尝试未成功)
yum install *rhsm*

方法二 (redhat下载速度极慢,pull image时超时,未成功)

 执行命令:

   ①   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    

   前两个命令会生成/etc/rhsm/ca/redhat-uep.pem文件.     

   ③    docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest

自己的解决方法

根据方法二的思路,在node上操作搜索:
1、搜索可用镜像
docker search pod-infrastructure
docker.io docker.io/tianyebj/pod-infrastructure 选择该镜像pull
2、拉取
docker pull docker.io/tianyebj/pod-infrastructure
3、修改kubelet
cat /etc/kubernetes/kubelet
vim /etc/kubernetes/kubelet

KUBELET_POD_INFRA_CONTAINER="–pod-infra-container-image=docker.io/tianyebj/pod-infrastructure:latest"
完成。

重启删除POD

在master节点上
kubectl delete pod nginx-2168765860-v3ph8

kubectl get pod

nginx-2168765860-lk9bg 1/1 Running

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值