一.k8s基本命令
kubectl get rc
kubectl delete rc mysql
kubectl get pod
kubectl delete pod mysql-xz2w
kubectl describe pod mysql-bx1rd
二.问题
1.k8s出现pod服务一直处于ContainerCreating状态
执行kubectl describe pod [pod_name]
1.1问题:Back-off pulling image \"registry.access.redhat.com/rhel7/pod-infrastructure:latest
镜像拉取失败 手动执行docker命令拉取该镜像
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
解决方案:
yum install *rhsm* -y
#再次尝试
docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest
如果还有问题执行一下操作
yum install -y wget 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文件。
再次拉取镜像应该就可以了。
所有评论(0)