Kubernetes YAML Workloads/Basic DaemonSet YAML

Deploy a log collector or node agent everywhere.

Section: DaemonSets

Basic DaemonSet YAML

yaml
yaml
apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: node-exporter
spec:
  selector:
    matchLabels:
      app: node-exporter
  template:
    metadata:
      labels:
        app: node-exporter
    spec:
      hostNetwork: true
      tolerations:
        - operator: Exists
      containers:
        - name: node-exporter
          image: prom/node-exporter:v1.8.2
          ports:
            - name: metrics
              containerPort: 9100

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing DaemonSets
Restart a DaemonSet rollout
Trigger rollout after a config change.
OpenIn sheetbashsame section
Basic StatefulSet YAML
Run stateful replicas with stable ordinals.
Basic Job YAML
Run a one-time batch task with retries.
HorizontalPodAutoscaler YAML
Scale Deployment based on CPU utilization.
Set rolling update partition
Control StatefulSet ordinal rollout.
Basic CronJob YAML
Schedule recurring batch work.