实验环境:服务器3台 centos 7.9
172.16.2.15 harbor 服务器,rancher server
172.16.2.29 master1,etcd,wor
172.16.2.42 master2
初始化服务器:
172.16.2.15 运行
docker run -d --restart=unless-stopped -p 80:80 -p 443:443 --privileged rancher/rancher
在另外节点运行
sudo docker run -d --privileged --restart=unless-stopped --net=host -v /etc/kubernetes:/etc/kubernetes -v /var/run:/var/run rancher/rancher-agent:v2.5.7 --server https://172.16.2.15 --token 7tvvgkknzp5zrg8mbqdlwmcr9q56l8qnsxxgkfb5zzxwq8ffx7kj4r --ca-checksum e646b7a7271847e8992b338c6636229196b322efb329ecc12efacfc77b7c80c4 --etcd --controlplane --worker
关停rancher server后,无法查看其资源,但是网站访问正常,不影响服务
[root@client_15_k8s_clould lnmp]# kubectl get node
The connection to the server 119.91.135.25 was refused - did you specify the right host or port?
[root@client_15_k8s_clould lnmp]# kubectl get pod
The connection to the server 119.91.135.25 was refused - did you specify the right host or port?