Mastering Kubernetes DaemonSet: A Must-Know for Cluster Management! 🚀
A DaemonSet ensures that a copy of a Pod runs on every node (or a specific subset) in a Kubernetes cluster. It's essential for deploying background services and agents across all nodes. 🔥
Why Use a DaemonSet?
✅ Logging Agents – Collect logs from all nodes (e.g., Fluentd).
✅ Monitoring Agents – Monitor system metrics (e.g., Prometheus Node Exporter).
✅ Security Agents – Run intrusion detection software.
✅ Storage Daemons – Manage distributed file systems.
Key Features of DaemonSet
🔹 Ensures one Pod per node and automatically scales with node changes.
🔹 Deletes Pods when nodes are removed from the cluster.
🔹 Supports node selectors and node affinities to target specific nodes.
🔹 Allows rolling updates & rollbacks for smooth deployments.
🔹 Two update strategies:
RollingUpdate (default) – Replaces Pods one by one.
OnDelete – Pods are recreated only when manually deleted.
Hands-on with DaemonSet 🛠️
1️⃣ Deploy a DaemonSet:
2️⃣ Verify Deployment:
3️⃣ Delete a Pod and Watch It Recreate:
4️⃣ Perform Rolling Update:
5️⃣ Check Rollout History & Undo Changes:
Understanding ControllerRevision in DaemonSet
🔍 ControllerRevision stores DaemonSet history, enabling manual rollbacks.
🔍 Unlike Deployments, DaemonSet rollbacks require YAML updates.
🔍 Check revisions:
🔍 Delete a revision and observe:
Mastering DaemonSet is crucial for effective Kubernetes cluster management!
💡 Have you used DaemonSet in production?
Share your experiences in the comments! 👇
#Kubernetes #DevOps #CloudNative #DaemonSet #K8s