Day 12/40 - Kubernetes Daemonset Explained - Daemonsets, Job and Cronjob in Kubernetes

About this video

### Summary of the Video Content: 1. **Introduction and Overview**: - The video is part of the "CKA 2024" series, specifically video number 12. - The main topics covered are Cron Jobs, Jobs, and DaemonSets in Kubernetes. - Although Cron Jobs and Jobs are more relevant to the CKAD (Certified Kubernetes Application Developer) curriculum, they are briefly discussed for foundational understanding. - DaemonSets are emphasized as important for both the CKA (Certified Kubernetes Administrator) exam and Kubernetes operations. 2. **Engagement Goals**: - The creator aims for 200 likes and 120 comments within 24 hours. 3. **DaemonSets**: - **Purpose**: Ensures that a pod runs on all nodes in a cluster. - **Behavior**: - Unlike deployments or replica sets, DaemonSets create one replica per node. - Automatically adjusts when nodes are added or removed. - Common use cases include monitoring agents, logging agents, networking components (e.g., kube-proxy, WeaveNet, Calico), and other control plane components. - **Key Features**: - Ensures one running replica per node at all times. - Recreates pods if they are deleted, thanks to the controller. - **Example**: - A monitoring agent or logging agent must run continuously on every node to gather metrics or stream logs to external systems like Splunk or ELK. - **Demonstration**: - YAML structure for DaemonSets is similar to deployments but without the `replicas` field. - Pods may not schedule on control plane nodes due to taints unless tolerations are configured. - Example: Kube-proxy runs as a DaemonSet across all nodes. 4. **Cron Jobs**: - **Definition**: Automates tasks by scheduling jobs to run at specific intervals or times. - **Cron Syntax**: - Five fields: minute, hour, day of the month, month, and day of the week. - Examples: - Every Saturday at 11:45 PM: `45 23 * * 6`. - Every 5 minutes: `*/5 * * * *`. - **Use Cases**: - Generating periodic reports (daily, weekly, monthly). - Running cleanup tasks, such as deleting old logs. - **Manifest Example**: - A CronJob manifest spins up a pod with a specified image (e.g., BusyBox) and executes a command (e.g., printing the current time and a message). 5. **Jobs**: - **Definition**: Executes a task once and completes it. - **Use Cases**: - Part of installation scripts or automation pipelines. - Example: Provisioning a new cluster or performing one-time operations. - **Difference from Cron Jobs**: - Jobs do not have a schedule; they run only once. 6. **Practical Demonstration**: - The instructor demonstrates creating a DaemonSet using YAML and explains how it schedules pods across nodes. - Highlights the importance of understanding taints and tolerations when scheduling pods on control plane nodes. - Shows examples of existing DaemonSets in the cluster, such as Kube-proxy and KindNet. 7. **Conclusion**: - Recap of the topics covered: Cron Jobs, Jobs, and DaemonSets. - Encourages viewers to attempt the assignment in the GitHub repository (Day 12 folder). - Invites feedback and questions in the comments or Discord community. - Thanks viewers for watching and encourages them to meet the engagement targets for the next video. 8. **Additional Notes**: - Cron syntax is widely used in Unix-based systems and is essential for scheduling tasks in Kubernetes. - Networking components like WeaveNet, Flannel, and Calico are deployed as DaemonSets to ensure consistent network functionality across nodes.


Course: Certified Kubernetes Administrator Full Course For beginners | CKA 2025

This playlist contains the complete CKA series for beginners, based on the latest 2025 curriculum. It includes 40+ videos with hands-on demos, assignments, and exam-based scenarios. We will cover everything from the basics to the Advanced, including fundamental concepts such as Docker, containers, Docker storage and networking, DNS, etc.

View Full Course