首页 文章

调度程序未在主节点中为DaemonSet调度Pod

提问于
浏览
2

我想部署一个DaemonSet用于监视目的 . 所以这些Pod需要部署在所有节点中 .

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正在除主节点之外的所有节点中运行 .

我在这里想念的是什么?如何强制调度程序在主节点中调度Pod?

1 回答

  • 11

    从Kubernetes 1.6开始,DaemonSet默认情况下不会在主节点上进行调度 . 为了在master上安排它,你必须在Pod规范部分添加一个容忍:

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

    有关更多详细信息,请查看Kubernetss DeamonSet docu中的示例YAML文件 . 在如何计划守护程序窗格的章节中也提到了它 .

相关问题