Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
651 views
in Technique[技术] by (71.8m points)

kubernetes - Scheduler is not scheduling Pod for DaemonSet in Master node

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

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

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

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

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...