K8S (kubernetes)pod服务 Status 处于 Containercreating,Ready处于0/1 的问题解决

运行命令

kubectl get pod

pod的status是ContainerCreating,Ready处于0/1

[root@localhost ca]# kubectl get pod
NAME                       READY     STATUS              RESTARTS   AGE
my-nginx-379829228-mmsww   0/1       ContainerCreating   0          1h

错误信息为

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)"

根据网上资料进行手工pull,提示报错误

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

cd到/etc/docker/certs.d/registry.access.redhat.com/看到有一个redhat-ca.crt文件,使用 ll 命令查看

ll redhat-ca.crt

是个link文件,redhat-ca.crt -> /etc/rhsm/ca/redhat-uep.pem还一直闪啊闪,说明没有这个链接的文件。 

按照网上思路,进行更新安装,然后查询

yum update

yum search rhsm
==================================================================================== N/S matched: rhsm =====================================================================================
librhsm-devel.x86_64 : Development libraries and header files for librhsm
librhsm.x86_64 : Red Hat Subscription Manager library
python-rhsm.x86_64 : A Python library to communicate with a Red Hat Unified Entitlement Platform
python-rhsm-certificates.x86_64 : Certificates required to communicate with a Red Hat Unified Entitlement Platform
rhsm-gtk.x86_64 : GTK+ widgets used by subscription-manager-gui and initial_setup
subscription-manager-rhsm.x86_64 : A Python library to communicate with a Red Hat Unified Entitlement Platform
subscription-manager-rhsm-certificates.x86_64 : Certificates required to communicate with a Red Hat Unified Entitlement Platform

按网上思路使用命令安装 rhsm 的文件

yum install *rhsm*

然而,问题依然存在,仔细看信息发现

Package python-rhsm-certificates is obsoleted by subscription-manager-rhsm-certificates, trying to install subscription-manager-rhsm-certificates-1.21.10-3.el7.centos.x86_64 instead

说明python-rhsm-certificates 被 subscription-manager-rhsm-certificates 替代,所以python-rhsm-certificates一直无法安装

解决方案:

先将subscription-manager-rhsm-certificates卸载

yum remove subscription-manager-rhsm-certificates.x86_64

然后安装python-rhsm-certificates.x86_64

yum install python-rhsm-certificates.x86_64

最终安装成功,pod的状态变为Running,Ready为1/1

[root@localhost ca]# kubectl get pod
NAME                       READY     STATUS    RESTARTS   AGE
my-nginx-379829228-mmsww   1/1       Running   0          2h

 

你可能感兴趣的:(record)