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