查看设置标签
kubectl get nodes --show-labels
kubectl label nodes node1 monitor=prometheus
使节点离线,这将阻止新的 pod 落到它们下面,驱赶现有的pod(除了DaemonSet)。默认工夫为5 分钟,由 controller-manager 的 --pod-eviction-timeout 管制,pod不会从新抉择节点
kubectl drain x.x.x.x --ignore-daemonsets
查看108上的pod
kubectl get pods --all-namespaces -o wide |grep 'x.x.x.x'
kubectl get nodes
x.x.x.x Ready,SchedulingDisabled
从新使节点可调度
kubectl uncordon x.x.x.x
kubectl get nodes
x.x.x.x Ready
查看xxx上的pod
kubectl get pods --all-namespaces -o wide |grep 'x.x.x.x'