查看设置标签

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'

芒果牛奶
1 声望0 粉丝

运维背锅之路


« 上一篇
k8s 证书更新
下一篇 »
k8s-cert