> ## Content Index
> Fetch the complete content index at: https://scriptcrunch.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Kubernetes DaemonSets: A Complete Guide (CKA Focus)
- URL: https://scriptcrunch.com/kubernetes-deamonsets/
- Published: 2025-11-10T10:21:00.000Z
- Updated: 2026-06-23T08:55:52.000Z
- Author: Aswin Vijayan
- Tags: #Migrated-1758801465347, #wp, #wp-post, #Import 2025-09-25 11:57, Kubernetes Certifications

DaemonSet is a very important topic in [CKA certification](https://scriptcrunch.com/kubernetes-exam-guide/).

In this blog, we will learn about a basic understanding of [Kubernetes](https://scriptcrunch.com/tag/kubernetes/) DaemonSets and how to create DaemonSets on Kubernetes.

## What is DaemonSets?

DaemonSet is an object of Kubernetes, which is deployed in every cluster node. When a pod is deployed as a DaemonSet, the pod deploys a copy of it in every available node in the cluster.

Also, you cannot increase the number of DaemonSet Pods on a single node since only one can run there.

However, if a DaemonSet Pod is removed from a node, the DaemonSet controller will detect the change and create a new Pod to replace it.

### Common Use Cases

Some typical examples of DaemonSets include:

- **kube-proxy:** manages network rules on each node.
- **Cluster Monitoring:** tracks node metrics similar to [Prometheus](https://scriptcrunch.com/tag/prometheus/) Node Exporter.
- **logging agents:** like Fluentd, Filebeat, or Logstash.
- **CNI plugins:** such as Calico etc.

You can list the available DaemonSets in your cluster using the following command

```bash
kubectl get daemonset -A
```

This command will list the available DaemonSets on all namespaces as shown below

![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-2.png)

And if you want to list the nodes the DaemonSet pod is running on, run the following command

```bash
kubectl get pods -l k8s-app=kube-proxy -o wide -n kube-system
```

This command will list the nodes in which the DaemonSet pod kube-proxy is running as shown below

![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-3.png)

## How to Create DaemonSet

Let’s create a simple DaemonSet that deploys an NGINX container on every node

### Step 1: Create a manifest file

First, create a manifest file named daemonset.yaml and copy the content provided below:

```yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: nginx-daemonset
  labels:
    app: nginx
spec:
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
      - name: nginx-container
        image: nginx:latest

```

This file will deploy a DaemonSet of Nginx on the default namespace on all available nodes.

### Step 2: Apply the DaemonSet

Run the following command to deploy the DaemonSet:

```
kubectl apply -f daemonset.yaml
```

### Step 3: Verify the Deployment

Once it is deployed you can verify if it's deployed as DaemonSet using the command:

```bash
kubectl get daemonsets

kubectl get po -o wide
```

![](https://storage.ghost.io/c/98/9f/989fb5e0-fca9-4938-afe7-999714e98540/content/images/2025/11/image-4.png)

### Cleaning Up

To delete the DaemonSet and all its Pods:

```bash
kubectl delete daemonset nginx-daemonset
```

> **Important Notes for the CKA Exam**

> DaemonSets run **one Pod per node** by default. When a node joins, the DaemonSet automatically deploys the Pod there. When a node leaves, its DaemonSet Pod is automatically removed.

## Conclusion

In summary, we have learned about DaemonSets and how to create one.

I believe this blog gives you a basic understanding of DaemonSets.