apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: dind
spec:
  selector:
    matchLabels:
      name: dind
  template:
    metadata:
      labels:
        name: dind
    spec:
      tolerations:
      # this toleration is to have the daemonset runnable on master nodes
      # remove it if your masters can't run pods
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      containers:
      - name: dind
        image: docker:20.10
        securityContext:
          privileged: true
        command:
        - tail
        - -f
        - /dev/null
        volumeMounts:
        - name: dind-storage
          mountPath: /var/lib/docker
        - name: dockersock
          mountPath: /var/run/docker.sock
      volumes:
      - name: dind-storage
        emptyDir: {}
      - name: dockersock
        hostPath:
          path: /var/run/docker.sock
      # - name: fluentd-elasticsearch
      #   image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
      #   resources:
      #     limits:
      #       memory: 200Mi
      #     requests:
      #       cpu: 100m
      #       memory: 200Mi
      #   volumeMounts:
      #   - name: varlog
      #     mountPath: /var/log
      #   - name: varlibdockercontainers
      #     mountPath: /var/lib/docker/containers
      #     readOnly: true
      # terminationGracePeriodSeconds: 30
      # volumes:
      # - name: varlog
      #   hostPath:
      #     path: /var/log
      # - name: varlibdockercontainers
      #   hostPath:
      #     path: /var/lib/docker/containers
