k8s node 操作与维护

查看设置标签

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'

评论

暂无评论