apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: promtail
  labels:
    app: promtail
spec:
  selector:
    matchLabels:
      app: promtail
  template:
    metadata:
      labels:
        app: promtail
    spec:
      containers:
        - name: promtail
          image: grafana/promtail:1.5.0
          args:
            - "-config.file=/etc/promtail/promtail_config.yaml"
          resources: {}
          volumeMounts:
            - mountPath: /etc/promtail
              name: promtail-conf
            - mountPath: /var/lib/docker/containers
              name: docker-containers-logs
      restartPolicy: Always
      volumes:
        - name: promtail-conf
          configMap: 
            name: promtail-config
            items: 
              - key: promtail
                path: promtail_config.yaml
        - name: docker-containers-logs
          hostPath:
            path: /var/lib/docker/containers
