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

aer*_*ite 4 kubernetes daemonset

我想部署一个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
Run Code Online (Sandbox Code Playgroud)

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

此DaemonSet的Pod正在除主节点之外的所有节点中运行.

我在这里错过了什么?如何强制调度程序在主节点中安排Pod?

Jak*_*kub 16

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

tolerations:
- key: node-role.kubernetes.io/master
  effect: NoSchedule
Run Code Online (Sandbox Code Playgroud)

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

  • 现在看起来架构应该是“公差”:[{“操作员”:“存在”,“效果”:“ NoSchedule”} (2认同)