Shashikant shah

Wednesday 16 December 2020

What is DaemonSet in kubernetes Part-09

 How do you deploy only one pod on every node and particular cluster.

i) A DaemonSet ensures that
 all (or some) Nodes run a copy of a Pod.
ii) As nodes are added to the cluster, Pods are added.
iii) As nodes are removed from the cluster, those Pods are garbage collected.
iv) Deleting a DaemonSet will clean up the Pods it created.
Use Cases:
i)Node monitoring daemons: Ex: collectd.
ii) Log collection daemons: Ex: fluentd.
iii) Storage daemons: Ex: ceph

1.Fluentd pods launch all worker node.
# vim fluentd-ds-allnodes.yaml


# kubectl apply -f fluentd-ds-allnodes.yaml --dry-run=client
# kubectl get ds




# kubectl get pods




# kubectl describe ds fluentd-ds












2.Deploy pod on “subset” of worker nodes inside k8s cluster using DaemonSet

i) attach label to the nodes.
# kubectl get nods
# kubectl label nodes worker1.example.com worker2.example.com disktype=ssd
# kubectl get node --show-labels












# kubectl get ds



# kubectl get pods -o wide





No comments:

Post a Comment