kubernetescadvisor

Is there a way to deploy DaemonSet only on nodes with active deployments?


I'm deploying my service under my namespace. We have a worker node farm and my service will only utilize a small subset of its nodes.

I want to deploy a DaemontSet of cAdvisors but I only want them to run in the nodes not related to my namespace. If possible, how to do that?

Thanks!


Solution

  • DaemonSet runs one pod per node. However, you can also control it to run on selected nodes.

    If you specify a .spec.template.spec.nodeSelector, then the DaemonSet controller will create Pods on nodes which match that node selector.

    Similarly, if you specify a .spec.template.spec.affinity, then DaemonSet controller will create Pods on nodes which match that node affinity.

    If you do not specify either, then the DaemonSet controller will create Pods on all nodes.