Make a DaemonSet schedule a pod on the master node(s)
Who hasn't been building a small Pi-based Kubernetes cluster at home?
Well, on mine I wanted to deploy a DaemonSet with node_exporter for my external Prometheus service to scrape metrics of each node in the cluster, so I wrote up a DaemonSet manifest and applied it to my cluster. On first glance everything seemed happy, but quickly I noticed that the master node was not running a node-exporter pod!
A quick Stack Overflow search led me to this answer and informed me that since Kubernetes 1.6 you have to add a toleration to the Pod spec section of your DaemonSet manifest:
tolerations:
- key: node-role.kubernetes.io/master
effect: NoSchedule
I added this, and my master node was now running a node-exporter pod—just as I wished.
Dec 8, 2020