Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 847
Shahriar Avatar asked Jan 29 '18 06:01

Shahriar


People also ask

Why are pods not scheduled on master nodes?

Security pods are not scheduled since the master nodes do not meet the required memory or CPU requirements. The output has the information about memory and CPU requirements. If the resource requirement is not met, increase the master node's memory or CPU.

Does DaemonSet run on master node?

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. 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.

How do you schedule pods on master node?

If you want to be able to schedule pods on the Kubernetes control-plane node, you need to remove a taint on the master nodes. This will remove the node-role.kubernetes.io/master taint from any nodes that have it, including the control-plane node, meaning that the scheduler will then be able to schedule pods everywhere.

How do you not schedule a pod on a specific node?

Put security on gate: Apply taint on node Above command places a taint on node “<node-name>”. The taint has key “type”, value “db”, and taint effect “NoSchedule”. This means that no pod will be scheduled on node <node-name> unless it has a matching toleration.


1 Answers

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.

like image 88
Jakub Avatar answered Oct 08 '22 11:10

Jakub