Daemonset in kubernetes
Jun 22, 2023
Basics of daemonsets in kubernetes
Daemonset ensures that all the available worker nodes have a copy of a running pod defined within the DaemonSet.
As new nodes are added the pods of daemonset are added to them.
Daemonsets follow the regular scheduling rules and if the scheduling rules don’t allow pods to run on a particular node then the daemonset will respect scheduling rule and won’t assign pod to it.
Usage :
- logs collection
- node monitoring
- anything that requires a pod running on node for doing some routing task related to the node.
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: nginx-daemon-set
spec:
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
containers:
- name: nginx
image: nginx
search_query: daemonset
ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/