一、master节点操作
1、查看现有节点状态
kubectl get nodes
2、封锁k8s-node3这个node节点,排干该node节点上的pod资源
kubectl drain k8s-node-3 --delete-local-data --force --ignore-daemonsets
3、查看节点状态:
kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane,master 12h v1.20.0
k8s-node-1 Ready 12h v1.20.0
k8s-node-2 Ready 12h v1.20.0
k8s-node-3 Ready,SchedulingDisabled 12h v1.20.0
4、删除k8s-node-3这个节点
kubectl delete node k8s-node-3
node "k8s-node-3" deleted
5、查看节点状态:
kubectl get node
NAME STATUS ROLES AGE VERSION
k8s-master Ready control-plane,master 12h v1.20.0
k8s-node-1 Ready 12h v1.20.0
k8s-node-2 Ready 12h v1.20