删除一个节点前,先驱赶掉上面的pod
kubectl drain node-06 --delete-local-data --force --ignore-daemonsets
此时节点上面的pod开始迁移
检查节点状态,被标记为不可调度节点
[root@node-01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
node-01 Ready master 2d19h v1.14.1
node-02 Ready master 2d18h v1.14.1
node-03 Ready master 2d18h v1.14.1
node-04 Ready <none> 2d18h v1.14.1
node-05 Ready <none> 2d18h v1.14.1
node-06 Ready,SchedulingDisabled <none> 2d18h v1.14.1
最后删除节点
[root@node-01 ~]# kubectl delete node node-06
node "node-06” deleted
[root@node-01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
node-01 Ready master 2d19h v1.14.1
node-02 Ready master 2d19h v1.14.1
node-03 Ready master 2d19h v1.14.1
node-04 Ready <none> 2d18h v1.14.1
node-05 Ready <none> 2d18h v1.14.1
连到node-06服务器卸载kubernetes数据
kubeadm reset