调度程序没有为主节点中的 DaemonSet 调度 Pod [英] Scheduler is not scheduling Pod for DaemonSet in Master node

查看:29
本文介绍了调度程序没有为主节点中的 DaemonSet 调度 Pod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

I want to deploy a DaemonSet for monitoring purpose. So these Pods need to be deployed in all Nodes.

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

A DaemonSet ensures that all (or some) Nodes run a copy of a Pod.

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

I am using a DaemonSet so that all nodes get a copy.

    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 在我的主节点中运行.

When I'm creating this DaemonSet in my Kubernetes cluster, I don't see Pod running in my master node.

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

Pod for this DaemonSet are running in all nodes except Master node.

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

What am I missing here? How can I enforce scheduler to schedule a Pod in Master node?

推荐答案

从 Kubernetes 1.6 开始,DaemonSets 默认不在主节点上调度.为了在 master 上调度它,你必须在 Pod 规范部分添加一个容忍:

Since Kubernetes 1.6, DaemonSets do not schedule on master nodes by default. In order to schedule it on master, you have to add a toleration into the Pod spec section:

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

有关更多详细信息,请查看 Kubernetss DeamonSet 文档.在如何调度 Daemon Pods 一章中也提到了这一点.

For more details, check out the example YAML files in Kubernetss DeamonSet docu. It is also mentioned in the chapter How Daemon Pods are Scheduled.

这篇关于调度程序没有为主节点中的 DaemonSet 调度 Pod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆