apiVersion: "apps/v1"
kind: "DaemonSet"
metadata:
  name: fluentd-elasticsearch
  namespace: kube-system
  labels:
    k8s-app: fluentd-logging
    env: prod
spec:
  selector:
    matchLabels:
     name: fluentd-elasticsearch 
  template:
    metadata:
      labels:
       name: fluentd-elasticsearch
    spec: 
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      containers:
      - name: fluentd-elasticsearch
        image: xuegod/fluentd:v2.5.1
        imagePullPolicy: IfNotPresent
        resources:
          limits:
            memory: "215Mi"
            cpu: "500m"
          requests:
            memory: "64Mi"
            cpu: "250m"
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers