调度程序未在主节点中为DaemonSet调度Pod [英] Scheduler is not scheduling Pod for DaemonSet in Master node
问题描述
我想部署DaemonSet进行监视.因此,这些Pod必须部署在所有节点中.
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在除主节点之外的所有节点上运行.
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不在主节点上进行调度.为了将其安排在主服务器上,您必须在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文档.在如何调度后台驻留程序一章中也提到了这一点.
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屋!