apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluent-bit-logging
  namespace: logging
  labels:
    app: fluent-bit-logging
spec:
  updateStrategy:
    type: RollingUpdate
  selector:
    matchLabels:
      app: fluent-bit-logging
  template:
    metadata:
      annotations:
        prometheus.io/scrape: "true"
        prometheus.io/port: "2020"
        prometheus.io/path: /api/v1/metrics/prometheus
      labels:
        app: fluent-bit-logging
    spec:
      terminationGracePeriodSeconds: 30
      serviceAccountName: fluentbit
      containers:
      - name: fluent-bit
        image: fluent/fluent-bit:0.14.4
        ports:
          - containerPort: 2020
        env:
        - name: FLUENT_ELASTICSEARCH_HOST
          value: "es-logging-svc"
        - name: FLUENT_ELASTICSEARCH_PORT
          value: "9200"
        resources:
          requests:
            cpu: 73m
            memory: 73Mi
          limits:
            cpu: 73m
            memory: 73Mi
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: fluent-bit-config
          mountPath: /fluent-bit/etc/
      tolerations:
      - key: node-role.kubernetes.io/master
        effect: NoSchedule
      volumes:
      - name: fluent-bit-config
        configMap:
          name: fluent-bit-config
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
