Ref: https://kubernetes.io/docs/concepts/workloads/controllers/daemonset/
Deployment: Suitable software regular applications
Daemonset: suitable for apps which must run a pod in everynode presernt in k8 cluster ex: logs & monitoring
Staatefullset: suitable for database applications such as mysql and elasticsearch it has ordinal sequential index like 0,1,2.. in case of pod delete or re created it will have same name where as in deployment and statefulset the name will change for pod whenever the it will update the pod name will change
A Deamonset is a Kubernetes resource that ensures that a copy of a specific pod runs on each node in a cluster. Unlike a Deployment, which ensures a specified number of replicas running across the entire cluster, a Deamonset runs exactly one instance of a pod on each node. This makes Deamonset suitable for tasks that need to run on every node, such as log collection, monitoring agents, or network-related tasks.
Here are some key characteristics and use cases for DaemonSets:
One Pod Per Node: The primary purpose of a DaemonSet is to run a single instance of a pod on each node in the cluster. As nodes are added or removed, the DaemonSet automatically adjusts to maintain the desired state.
Infrastructure Tasks: DaemonSets are commonly used for running infrastructure-related tasks on each node, such as log collection agents (e.g., Fluentd or Filebeat), monitoring agents (e.g., Prometheus Node Exporter), or network-related components (e.g., CNI plugins).
Node-Level Operations: Some applications or services need to perform node-specific operations. DaemonSets are well-suited for such scenarios, as they ensure that each node has an instance of the pod running.
Kubelet-Level Operations: If you need to perform operations at the Kubelet level (the component on each node responsible for managing containers), a DaemonSet can be used to deploy a pod that interacts with the Kubelet directly.
Daemon set it will ensure the pod will run per node always event you drain traffic to node while performing patching activities where as deployment if you delete pod it will delete it
when we delete the pod is part of daemonset it recreated again in same node.
-----------------------------------------statefulset-------------------------------------------------------
0 Comments