码迷,mamicode.com
首页 > 其他好文 > 详细

k8s简单的来部署一下tomcat

时间:2018-12-06 14:33:32      阅读:398      评论:0      收藏:0      [点我收藏+]

标签: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

技术分享图片

 

 》》》》》》》》》》》一个大坑的记录》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》》

 

 

 

 

 

 

 

 

 

 

 

 

 

k8s简单的来部署一下tomcat

标签:cer   stat   esc   HERE   for   code   his   cert   rpm   

原文地址:https://www.cnblogs.com/spll/p/10075781.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!