apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: hostpath-helper
spec:
  selector:
    matchLabels:
      name: hostpath-helper
  template:
    metadata:
      labels:
        name: hostpath-helper
    spec:
      containers:
      - name: cleanup
        image: ubuntu
        command: ["bash", "-xc", "rm -rf /mnt/tmp/data-dir /mnt/tmp/proxy-dir; install -m 777 -d /mnt/tmp/data-dir /mnt/tmp/proxy-dir && sleep 100500"]
        volumeMounts:
        - name: root
          mountPath: /mnt
        securityContext: 
          runAsUser: 0
      volumes:
      - name: root
        hostPath:
          path: /

# sudo rm -rf /tmp/data-dir
# sudo install -m777 -g 0 -d /tmp/data-dir
# sudo chcon -R unconfined_u:object_r:svirt_sandbox_file_t:s0 /tmp /tmp/data-dir
