kubernetes权威指南踩坑

kubernetes权威指南踩坑

按照书上步骤能搭成功,我服你。

扫坑

Pod一直处于ContainerCreating状态

kubectl describe pod ,发现错误是:
details: (open /etc/docker/certs.d/registry.access.redhat.com/redhat-ca.crt: no such file or directory)
这是因为缺少 rshm 软件包:
yum install -y *rhsm*
如果依然报错:
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

访问 localhost:30001/demo/无响应

systemctl start firewalld.service
firewall-cmd --permanent --zone=public --add-port=30001/tcp
systemctl stop firewalld.service

无法连接Mysql

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException
kubectl get ep
获取mysql ip
把myweb-rc.yaml中的MYSQL_SERVICE_HOST换成该ip,然后
kubectl delete -f myweb-rc.yaml
kubectl delete -f myweb-svc.yaml
kubectl create -f myweb-rc.yaml
kubectl create -f myweb-svc.yaml
重新创建myweb服务

仍然无法连接Mysql

Error:com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.

这是因为mysql镜像的版本不对,把mysql-rc.yaml中的镜像版本改为
mysql:5.7即可。

你可能感兴趣的:(kubernetes)