RKE K8S 集群增删节点
admin
2023-01-23 21:42:00
0

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.. 

相关内容

热门资讯

探秘沧海之“晶”:海水制盐的原... 自古以来,海就是巨大的宝藏,尤其它那孕育“白色精灵”——食盐的魔力,更是人类文明的基石之一。海水如何...
日媒播出专题片揭露731部队罪... 当地时间21日夜间,日本广播协会播出侵华日军731部队相关专题片,题为《被隐藏的部队:沉默的战后》。...
苏州正式设立人工智能发展办公室 新京报讯 据“苏州发布”微信公众号消息,近日,苏州市正式设立人工智能发展办公室,进一步统筹苏州市人工...
警方通报“16岁高中生被刺死”... 7月22日,内蒙古乌拉特前旗公安局针对“16岁高中生被刺死,事发地疑为涉黄场所”发布警情通报,通报关...
达观数据陈运文:智能体竞争,正... 随着AI智能体加速进入产业应用,市场规模持续增长,但企业关注的重点正在发生变化。 中商产业研究院发布...
磁力混合器突破3D生物打印细胞... 3D生物打印是生物工程领域的重要技术,通过将活细胞混入柔性水凝胶(即"生物墨水")来打印活体组织,广...
王兴兴:做好准备迎接即将突破的... 王兴兴在开幕式上发表演讲。 王兴兴在演讲中提到,宇树科技成立于2016年,经过近10年努力,已经成为...
不排除提告!屡遭苏巧慧阵营抹黑... 海峡导报综合报道 国民党新北市长参选人李四川的板桥房产问题屡遭绿营质疑,对手苏巧慧阵营再度指控李四川...
俄外长:将在马尼拉同鲁比奥会晤... 据凤凰卫视报道,正在菲律宾出席东盟外长会的俄罗斯外长拉夫罗夫7月22日表示,他将于23日上午在马尼拉...
小鸭洗衣机皮带修理方法 小鸭洗衣机皮带在长时间使用过程中,可能会出现磨损或者老化,导致洗衣机无法转动或者转速变慢。这时候,我...