DaemonSet automatically schedules a single replica of a pod on all the nodes in the cluster. It can be though of as a way to run a daemon process on all the nodes in the cluster.

Untitled

KubeProxy can be deployed as a DaemonSet in the cluster so that the kube-proxy process runs as a single pod on all of the nodes. Networking solutions, log collectors and monitoring agents are often deployed as DaemonSets on the cluster.

Definition file

Exactly like Deployment except for the replicas field. To generate a sample definition file, first generate one for a deployment and edit it.

apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: monitoring-daemon
  labels:
    name: monitoring-agent
spec:
  selector:
    matchLabels:
      name: monitoring-agent
  template:
    metadata:
      labels:
        name: monitoring-agent
    spec:
      containers:
      - name: monitoring-agent
        image: monitoring-agent

Commands