解决 Kubernetes 创建pod一直处于ContainerCreating 状态

本文记录了在Kubernetes环境中遇到Pod启动失败的问题及解决过程。Pod状态停留在ContainerCreating阶段,通过排查发现是由于拉取镜像时缺少rhsm证书文件导致。经过手动安装rhsm相关组件和配置后,成功解决了Pod启动问题。

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

用k8s创建完pod后,查了一下pods状态,发现都在containercreationg状态中

 ==> kubectl get pods

用kubectl describe查看 pods的详情,发现 registry.access.redhat.com/rhel7/pod-infrastructure:latest 镜像报错

 ==> kubectl describe pod mysql

使用docker pull  拉取镜像,缺失rhsm 文件

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

yum 安装 rhsm,发现 python-rhsm-certificates  已被 subscription-manager-rhsm-certificates 替换,无法yum 成功

==> yum install *rhsm*

使用 wget 获取python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm  rpm包并安装 python-rhsm-certificates

==>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

 

再次使用使用docker pull  拉取镜像

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

pods 已成功 在Running 状态中

 ==> kubectl get pods

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值