解除不可调度
kubectl uncordon k8s-node01
设置不可调度
kubectl cordon k8s-node01
信息如下:
[root@k8s-master01 ~]# kubectl cordon k8s-node01
node/k8s-node01 cordoned
[root@k8s-master01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master01 Ready control-plane,master 146d v1.23.0
k8s-master02 Ready control-plane,master 146d v1.23.3
k8s-master03 Ready control-plane,master 146d v1.23.3
k8s-node01 Ready,SchedulingDisabled worker 146d v1.23.3
k8s-node02 Ready worker 146d v1.23.3
[root@k8s-master01 ~]# kubectl uncordon k8s-node01
node/k8s-node01 uncordoned
[root@k8s-master01 ~]# kubectl get nodes
NAME STATUS ROLES AGE VERSION
k8s-master01 Ready control-plane,master 146d v1.23.0
k8s-master02 Ready control-plane,master 146d v1.23.3
k8s-master03 Ready control-plane,master 146d v1.23.3
k8s-node01 Ready worker 146d v1.23.3
k8s-node02 Ready worker 146d v1.23.3
设置排水,即把所在节点的服务驱逐出去,但是除了dameset以及kube-system类型服务