【问题标题】:Scheduler is not scheduling Pod for DaemonSet in Master node调度程序没有为 Master 节点中的 DaemonSet 调度 Pod
【发布时间】:2018-07-07 19:04:09
【问题描述】:

我想部署一个 DaemonSet 用于监控目的。所以这些 Pod 需要部署在所有的 Node 上。

DaemonSet 确保所有(或部分)节点运行 Pod 的副本。

我正在使用 DaemonSet,以便所有节点都获得一份副本。

    spec:
      containers:
      - name: fluentd
        image: aerocloud.io/containers/fluentd:0.0.1
        volumeMounts:
        - name: varlog
          mountPath: /var/log
      volumes:
      - name: varlog
        hostPath:
          path: /var/log

当我在我的 Kubernetes 集群中创建这个 DaemonSet 时,我没有看到 Pod 在我的主节点中运行。

这个 DaemonSet 的 Pod 在除 Master 节点之外的所有节点中运行。

我在这里缺少什么?如何强制调度程序在 Master 节点中调度 Pod?

【问题讨论】:

  • 你能执行这个吗? kubectl describe node <master_node_name>查看主节点是否有可用资源来调度新的Pod?

标签: kubernetes daemonset


【解决方案1】:

自 Kubernetes 1.6 起,DaemonSets 默认不在主节点上调度。为了在 master 上安排它,您必须在 Pod 规范部分添加一个容忍度:

tolerations:
- key: node-role.kubernetes.io/master
  effect: NoSchedule

有关更多详细信息,请查看 Kubernetss DeamonSet docu 中的示例 YAML 文件。在如何调度 Daemon Pods 一章中也提到了这一点。

【讨论】:

  • 对我来说,这仅在添加“运算符:存在”时有效
  • 现在看起来架构应该是 "tolerations": [ { "operator": "Exists", "effect": "NoSchedule" }
猜你喜欢
  • 2019-07-16
  • 1970-01-01
  • 1970-01-01
  • 2020-04-16
  • 1970-01-01
  • 1970-01-01
  • 2019-08-22
  • 1970-01-01
  • 2016-10-20
相关资源
最近更新 更多