apiVersion: apps/v1
kind: DaemonSet
metadata:
  labels:
    k8s-app: fluentd-cloudwatch
    kustomize.component: fluentd-cloud-watch
  name: fluentd-cloudwatch
  namespace: kube-system
spec:
  selector:
    matchLabels:
      kustomize.component: fluentd-cloud-watch
  template:
    metadata:
      labels:
        k8s-app: fluentd-cloudwatch
        kustomize.component: fluentd-cloud-watch
    spec:
      containers:
      - env:
        - name: REGION
          value: us-west-2
        - name: CLUSTER_NAME
          value: ""
        - name: CI_VERSION
          value: k8s/1.0.1
        image: fluent/fluentd-kubernetes-daemonset:v1.7.3-debian-cloudwatch-1.0
        name: fluentd-cloudwatch
        resources:
          limits:
            memory: 400Mi
          requests:
            cpu: 100m
            memory: 200Mi
        volumeMounts:
        - mountPath: /config-volume
          name: config-volume
        - mountPath: /fluentd/etc
          name: fluentdconf
        - mountPath: /var/log
          name: varlog
        - mountPath: /var/lib/docker/containers
          name: varlibdockercontainers
          readOnly: true
        - mountPath: /run/log/journal
          name: runlogjournal
          readOnly: true
        - mountPath: /var/log/dmesg
          name: dmesg
          readOnly: true
      initContainers:
      - command:
        - sh
        - -c
        - cp /config-volume/..data/* /fluentd/etc
        image: busybox
        name: copy-fluentd-config
        volumeMounts:
        - mountPath: /config-volume
          name: config-volume
        - mountPath: /fluentd/etc
          name: fluentdconf
      - command:
        - sh
        - -c
        - ""
        image: busybox
        name: update-log-driver
      serviceAccountName: fluentd
      terminationGracePeriodSeconds: 30
      volumes:
      - configMap:
          name: fluentd-config
        name: config-volume
      - emptyDir: {}
        name: fluentdconf
      - hostPath:
          path: /var/log
        name: varlog
      - hostPath:
          path: /var/lib/docker/containers
        name: varlibdockercontainers
      - hostPath:
          path: /run/log/journal
        name: runlogjournal
      - hostPath:
          path: /var/log/dmesg
        name: dmesg
