Automatically runs a copy of a Pod on each node.

DaemonSets and Scheduling DaemonSets respect normal scheduling rules around node labels, taints, and tolerations. If a pod would not normally be scheduled on a node, a DaemonSet will not create a copy of the Pod on that Node.

apiVersion: apps/v1
kind: DaemonSet
metadata: beebox-cleanup
  name: 
spec:
  selector:
    matchLabels:
      name: beebox-cleanup
  template:
    metadata:
      labels:
        name: beebox-cleanup
    spec:
      containers:
      - name: busybox
        image: busybox:1.27
        command: ['sh', '-c', 'while true; do rm -rf /beebox-temp/*; sleep 60; done']
        volumeMounts:
        - name: beebox-tmp
          mountPath: /beebox-temp
      volumes:
      - name: beebox-tmp
        hostPath:
          path: /etc/beebox/tmp