apiVersion: apps/v1
kind: DaemonSet
metadata: 
  name: log-daemonset
  namespace: kube-system
  labels: 
    daemon: log
spec:
  selector:
    matchLabels:
      app: log
  template:
    metadata:
      labels:
        app: log
    spec:
      containers:
      - 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
      volumes:
      - name: varlog
        hostPath: 
          path: /home/var/log
      - name: varlibdockercontainers
        hostPath: 
          path: /home/var/lib/docker/containers
      nodeSelector:
        web: learn
 
