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

【腾讯云】轻量 2核2G4M,首年65元

阿里云限时活动-云数据库 RDS MySQL  1核2G配置 1.88/月 速抢

本文由乐趣区整理发布,转载请注明出处,谢谢。

您可能还喜欢...

发表回复

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

此站点使用Akismet来减少垃圾评论。了解我们如何处理您的评论数据