k8s集群移除node
作者:互联网
先drain节点上的pod
使用kubectl drain node03 --delete-local-data --force --ignore-daemonsets
之后删除node
[root@master01 ~]# kg node
NAME STATUS ROLES AGE VERSION
master01 Ready master 97d v1.18.2
master02 Ready master 97d v1.18.2
master03 Ready master 97d v1.18.2
node01 Ready <none> 97d v1.18.2
node02 Ready <none> 92d v1.18.2
node03 Ready <none> 91d v1.18.2
[root@master01 ~]# kubectl drain node03 --delete-local-data --force --ignore-daemonsets
node/node03 cordoned
WARNING: ignoring DaemonSet-managed Pods: kube-system/calico-node-vv7nj, kube-system/kube-proxy-gtg5v
evicting pod default/my-test01-68c4c897cb-hl2np
pod/my-test01-68c4c897cb-hl2np evicted
node/node03 evicted
[root@master01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master01 Ready master 97d v1.18.2
master02 Ready master 97d v1.18.2
master03 Ready master 97d v1.18.2
node01 Ready <none> 97d v1.18.2
node02 Ready <none> 92d v1.18.2
node03 Ready,SchedulingDisabled <none> 91d v1.18.2
[root@master01 ~]# kubectl delete node node03
node "node03" deleted
[root@master01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
master01 Ready master 97d v1.18.2
master02 Ready master 97d v1.18.2
master03 Ready master 97d v1.18.2
node01 Ready <none> 97d v1.18.2
node02 Ready <none> 92d v1.18.2
[root@master01 ~]#
标签:node,v1.18,master01,97d,master,移除,Ready,k8s 来源: https://www.cnblogs.com/faberbeta/p/14410038.html