使用rancher 搭建k8s

实验环境:服务器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?

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值