gpt4 book ai didi

kubernetes - 从节点中删除 Daemonset pod

转载 作者:行者123 更新时间:2023-12-03 07:00:19 61 4
gpt4 key购买 nike

我有一个正在运行的DaemonSet,它正在所有节点上运行。我想将其从节点中删除以完全耗尽它,因为 kubectl dance 不会删除它们。在不删除我的 DaemonSet 的情况下,暂时从节点中删除这些 pod 的好方法是什么?我已尝试耗尽它并删除 DaemonSet Pod,但 DaemonSet 仍会重新安排它们,忽略节点设置为 Unschedulable: true.

最佳答案

当您耗尽 kubernetes 节点时,您需要使用 --ignore-daemonsets 键:

--ignore-daemonsets=false: Ignore DaemonSet-managed pods.

因此,为了在集群中使用 DaemonSets 排空 kubernetes 节点,您需要执行:

kubectl drain <node_name> --ignore-daemonsets

如果您需要从节点中完全删除 DaemonSet pod,您可以在 DaemonSet 中指定一个 .spec.template.spec.nodeSelector (DaemonSet Controller 将在与该节点选择器匹配的节点上创建 Pod)并将该标签设置为除需要完全耗尽的节点之外的所有节点。

关于kubernetes - 从节点中删除 Daemonset pod,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48078196/

61 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com