From the course: Certified Kubernetes Application Developer (CKAD) Cert Prep

Unlock this course with a free trial

Join today to access over 25,300 courses taught by industry experts.

DaemonSet

DaemonSet

- All right, let's talk about DaemonSet. So what is DaemonSet? Well, DaemonSet is a Deployment that starts one Pod instance on every node in the cluster. And that is useful in cases where a software component like an agent needs to be available on all cluster nodes. You do it for the network plugin for instance, that needs to be running on all the nodes in the cluster. Now, when nodes are added or removed, the DaemonSet automatically changes the number of Pods accordingly. There is no imperative way to create a DaemonSet. You need to use YAML code to create it. And you know what? You can easily do that by modifying a YAML file that creates a Deployment. Let me show you. So to create this DaemonSet, I'm going to use kubectl create deploy daemonginx --image is nginx --dry-run is client, dry-run is essential here, -o yaml, and I'm redirecting that to daemon.yaml. And then there's a couple of modifications that we need to make to daemon.yaml. First, the kind is currently set to…

Contents