标签:cer stat esc HERE for code his cert rpm
2018年12月6日 今天终于把k8s运行tomcat打通了,耗了我几天时间一个一个坑踩过来,不容易啊,废话不多说。
1、kubectl create -f xxx.yaml在创建资源对象时,xxx.yaml配置文件里我配置了rc和service,下面表示创建成功,但问题来了
2、kubectl get pods时两个pods的状态都是ContainerCreating,而不是running,说明kubectl create -f xxx操作是失败的
3、kubectl describe pods myweb-3889544643-3sxrb 查看此pods的日志是什么问题,找到问题关系所在,下图:
4、查看另一个pod的日志:如下图,错误跟上一个pod的描述是一样的,都是少了一个文件。
5、我将错误内容翻译了一下:大意是说在pul镜像image的时候没有凭据,没有redhat-ca.crt文件
或者“POD”与ErrImagePull:“image pull for registration .access.redhat.com/rhel7/pod-infrastructure:latest失败,这可能是因为这个请求上没有凭据。
”详情:(打开/etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt:无此文件或目录)”
6、查到其他博客的解决办法,也确实解决了:
其实就是我的两个node节点机上没有一个叫redhat-ca.crt文件,此文件应该是用来连接主机master作凭证的吧,接下来下载这个凭证文件就是了。
在node节点机192.168.26.228上(192.168.26.108节点机也如此),执行以下命令:
1、wget http://mirror.centos.org/centos/7/os/x86_64/Packages/python-rhsm-certificates-1.19.10-1.el7_4.x86_64.rpm
2、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
3、docker pull registry.access.redhat.com/rhel7/pod-infrastructure:latest
7、报错or "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)"的问题解决成功了,成功如下图:
再用Kubectl get pods查看一下pod,发现两个pod的status状态都变成了Running
!
标签:cer stat esc HERE for code his cert rpm
原文地址:https://www.cnblogs.com/spll/p/10075781.html