关于kubernetes: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'

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理