RKE K8S 集群增删节点

rke 删除节点:

修改cluster.yal 将需要删除的节点配置删除,然后运行

[root@cnvs-kubm-101-103 rke]# more cluster.yml
nodes:
  - address: 172.20.101.103
    user: ptmind
    role: [controlplane,worker,etcd]
  - address: 172.20.101.104
    user: ptmind
    role: [controlplane,worker,etcd]
  - address: 172.20.101.105
    user: ptmind
    role: [controlplane,worker,etcd]

删除#  - address: 172.20.101.106
删除#    user: ptmind
删除#    role: [worker]
删除#    labels: {traefik: traefik-outer}

执行删除节点操作

rke up --update-only

查看输出信息:

INFO[0010] [reconcile] Check etcd hosts to be deleted   
INFO[0010] [reconcile] Check etcd hosts to be added     
INFO[0010] [hosts] Cordoning host [172.20.101.106]      
INFO[0010] [hosts] Deleting host [172.20.101.106] from the cluster 
INFO[0010] [hosts] Successfully deleted host [172.20.101.106] from the cluster 
INFO[0010] [dialer] Setup tunnel for host [172.20.101.106] 
INFO[0011] [worker] Tearing down Worker Plane..         
INFO[0011] [remove/kubelet] Successfully removed container on host [172.20.101.106] 
INFO[0011] [remove/kube-proxy] Successfully removed container on host [172.20.101.106] 
INFO[0011] [remove/nginx-proxy] Successfully removed container on host [172.20.101.106] 
INFO[0011] [remove/service-sidekick] Successfully removed container on host [172.20.101.106] 
INFO[0011] [worker] Successfully tore down Worker Plane.. 
INFO[0011] [hosts] Cleaning up host [172.20.101.106]    
INFO[0011] [hosts] Running cleaner container on host [172.20.101.106] 
INFO[0012] [kube-cleaner] Successfully started [kube-cleaner] container on host [172.20.101.106] 
INFO[0012] Waiting for [kube-cleaner] container to exit on host [172.20.101.106] 
INFO[0012] Container [kube-cleaner] is still running on host [172.20.101.106] 
INFO[0013] Waiting for [kube-cleaner] container to exit on host [172.20.101.106] 
INFO[0013] [hosts] Removing cleaner container on host [172.20.101.106] 
INFO[0013] [hosts] Removing dead container logs on host [172.20.101.106] 
INFO[0014] [cleanup] Successfully started [rke-log-cleaner] container on host [172.20.101.106] 
INFO[0014] [remove/rke-log-cleaner] Successfully removed container on host [172.20.101.106] 
INFO[0014] [hosts] Successfully cleaned up host [172.20.101.106

添加节点:

修改cluster.yal 将需要添加的节点配置,然后运行

[root@cnvs-kubm-101-103 rke]# more cluster.yml
nodes:
  - address: 172.20.101.103
    user: ptmind
    role: [controlplane,worker,etcd]
  - address: 172.20.101.104
    user: ptmind
    role: [controlplane,worker,etcd]
  - address: 172.20.101.105
    user: ptmind
    role: [controlplane,worker,etcd]

  - address: 172.20.101.106
    user: ptmind
    role: [worker]
    labels: {traefik: traefik-outer}

执行添加节点操作

rke up --update-only

查看输出信息:

INFO[0025] [worker] Building up Worker Plane..          
INFO[0025] [worker] Successfully started [nginx-proxy] container on host [172.20.101.106] 
INFO[0026] [worker] Successfully started [rke-log-linker] container on host [172.20.101.106] 
INFO[0026] [remove/rke-log-linker] Successfully removed container on host [172.20.101.106] 
INFO[0027] [worker] Successfully started [kubelet] container on host [172.20.101.106] 
INFO[0027] [healthcheck] Start Healthcheck on service [kubelet] on host [172.20.101.106] 
INFO[0032] [healthcheck] service [kubelet] on host [172.20.101.106] is healthy 
INFO[0032] [worker] Successfully started [rke-log-linker] container on host [172.20.101.106] 
INFO[0033] [remove/rke-log-linker] Successfully removed container on host [172.20.101.106] 
INFO[0033] [worker] Successfully started [kube-proxy] container on host [172.20.101.106] 
INFO[0033] [healthcheck] Start Healthcheck on service [kube-proxy] on host [172.20.101.106] 
INFO[0038] [healthcheck] service [kube-proxy] on host [172.20.101.106] is healthy 
INFO[0039] [worker] Successfully started [rke-log-linker] container on host [172.20.101.106] 
INFO[0039] [remove/rke-log-linker] Successfully removed container on host [172.20.101.106] 
INFO[0039] [worker] Successfully started Worker Plane.. 
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值