Hello As per lecture of DaemonSets video , DaemonSets uses node affinity and d . . .

I Malla:
Hello

As per lecture of DaemonSets video , DaemonSets uses node affinity and default scheduler to place a pod in each node.
Default scheduler means kube scheduler right.

But in the end of static pod video , it is said that static pod and DaemonSets are ignored by kube-scheduler.

Could someone please elaborate ?

Fernando Jimenez:
Maybe this will help?

A DaemonSet ensures that all eligible nodes run a copy of a Pod. Normally, the node that a Pod runs on is selected by the Kubernetes scheduler. However, DaemonSet pods are created and scheduled by the DaemonSet controller instead.

DaemonSet pods are created and scheduled by the DaemonSet controller instead.
https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/#scheduled-by-default-scheduler

I Malla:
But @Fernando Jimenez all controllers are a part of kube-controller-manager right ?
I thought daemonset controller communicate with kubeapi server to get the details of new node from ETCD and then further tells kube-scheduler through apiserver to create a pod in new node .

Fernando Jimenez:
Where do you see that it conflicts? The document explains that for normal pods the kube-scheduler is what it schedules, but that for daemonset’s pods, the daemonset controller is what creates and schedules the pods, one in each node. If the daemonset is what manages the setup of pods, in nodes and keeps tracks of it, it makes sense that something else ( the normal scheduler ) should NOT interfere.

SaidBen:
@I Malla I do not think DaemonSets use any affinity rules; its by design that a DaemonSet object places a pod on each node,

I Malla:
@Fernando Jimenez thank you for the explanation and I got the point .

But I did not understand how daemonset controller does the scheduling job.

Also,
http://pointnode.kubernetes.io/unschedulable:NoSchedule|node.kubernetes.io/unschedulable:NoSchedule toleration is added automatically to DaemonSet Pods.
This point from documentation means that pod can be created in any node even if taint is applied as unschedulable?

But for master node to run pod , do we need to add below mentioned toleration manually in daemonset yaml file
spec:
tolerations:
# this toleration is to have the daemonset runnable on master nodes
# remove it if your masters can’t run pods
- key: http://node-role.kubernetes.io/master|node-role.kubernetes.io/master
operator: Exists
effect: NoSchedule

I Malla:
@SaidBen yes as per documentation link provided above by Fernando
If you specify a .spec.template.spec.affinity, then DaemonSet controller will create Pods on nodes which match that node affinity.
And if not specify ,then the DaemonSet controller will create Pods on all nodes.

Fernando Jimenez:
@I Malla Your questions are always welcome, especially if something is not clear to you or not understood or it is bothering you. For that last set you pointed out, I wonder if an experiment on your own would not yield a better understanding.
Yes, a daemonset could be set to only certain nodes and not all of them, like we normally talk about. Then, some form of node affinity will help to only select the subset of nodes wanted.

I Malla:
Thank you for the response as always . I will continue my learning :pray:

SaidBen:
@I Malla im curious about that last question regarding running daemonsets on a master node, have you got a chance to deploy a new daemonsets and see if it runs on a master node without adding the master node toleration to the daemonset ? Im not in front of my laptop otherwise I would test it out.

I Malla:
@SaidBen No it didn’t run in master without toleration