【问题标题】:Remove Daemonset pod from a node从节点中删除 Daemonset pod
【发布时间】:2018-01-03 21:50:06
【问题描述】:

我有一个正在运行的DaemonSet,它在所有节点上运行。我想从节点中删除它以完全耗尽它,因为kubectl drain 并没有摆脱它们。在不删除我的DaemonSet 的情况下,有什么好方法可以暂时从节点中删除这些 pod?我已经尝试排空它并删除 DaemonSet pod,但 DaemonSet 仍会重新安排它们,不管节点设置为 Unschedulable: true

【问题讨论】:

    标签: kubernetes


    【解决方案1】:

    你在排空kubernetes节点时需要使用--ignore-daemonsets键:

    --ignore-daemonsets=false:忽略 DaemonSet 管理的 pod。

    所以,为了排空集群中DaemonSets的kubernetes节点,你需要执行:

    kubectl drain <node_name> --ignore-daemonsets
    

    如果您需要从节点中完全移除 DaemonSet pod,您可以在 DaemonSet 中指定 .spec.template.spec.nodeSelector(DaemonSet 控制器将在与该节点选择器匹配的节点上创建 Pod)并设置除您需要完全排空的节点之外的所有节点。

    【讨论】:

      猜你喜欢
      • 2021-05-29
      • 1970-01-01
      • 2019-10-27
      • 2022-01-25
      • 1970-01-01
      • 2018-12-20
      • 2018-07-07
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多