← Back to Blog

πŸš€ How to Create a DaemonSet in Rancher Using YAML

πŸš€ How to Create a DaemonSet in Rancher Using YAML In this tutorial, I’ll walk you through creating a simple DaemonSet in Rancher using YAML. A DaemonSet ensures that a copy of a pod runs on all (or some) nodes in your Kubernetes cluster.

πŸš€ How to Create a DaemonSet in Rancher Using YAML

In this tutorial, I’ll walk you through creating a simple DaemonSet in Rancher using YAML. A DaemonSet ensures that a copy of a pod runs on all (or some) nodes in your Kubernetes cluster. It’s super useful for running background tasks across your cluster, such as logging or monitoring agents.

πŸ’‘ What You’ll Achieve:

By the end of this post, you’ll be able to:

  • Understand the structure of a DaemonSet YAML file.

  • Deploy a DaemonSet in Rancher.

  • Manage and scale your DaemonSet across the nodes in your cluster.


πŸ“ Sample DaemonSet YAML

Here's a basic example of a DaemonSet YAML configuration. This DaemonSet deploys a simple container on each node in your Kubernetes cluster:

apiVersion: apps/v1
kind: DaemonSet
metadata:
name: simple-daemonset
labels:
app: simple-daemonset
spec:
selector:
matchLabels:
app: simple-daemonset
template:
metadata:
labels:
app: simple-daemonset
spec:
containers:
- name: daemon-container
image: nginx:latest
ports:
- containerPort: 80
nodeSelector:
kubernetes.io/os: linux
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1

πŸš€ Steps to Deploy in Rancher

  • Access Rancher Dashboard:
    Open Rancher, navigate to your cluster, and select Workloads.

  • Create a DaemonSet:
    Click Deploy and select DaemonSet as the workload type.

  • Apply the YAML:
    Copy the YAML above and paste it into Rancher’s YAML Editor.

  • Deploy:
    Click Create to deploy the DaemonSet. It should now be running across all nodes!


πŸ–ΌοΈ Screenshot Pause

(Insert your screenshot of Rancher showing the DaemonSet deployed here)


πŸ” Managing the DaemonSet

  • Scaling: DaemonSets automatically ensure pods run on every node, so there's no need for manual scaling.

  • Monitoring: Check the logs in Rancher’s UI to ensure the DaemonSet is running smoothly.


I hope this simple guide helps you get started with DaemonSets in Rancher! It’s a powerful way to manage pod workloads across your entire cluster.

πŸ”— Connect with me:

Happy coding! πŸ’»


Imported from rifaterdemsahin.com Β· 2025