apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluent-bit
  namespace: logging
  labels:
    app: fluent-bit
spec:
  revisionHistoryLimit: 5
  selector:
    matchLabels:
      app: fluent-bit
  template:
    metadata:
      labels:
        app: fluent-bit
    spec:
      containers:
      - name: default
        image: fluent/fluent-bit:1.7.4
        imagePullPolicy: Always
        resources:
          limits:
            cpu: 100m
            memory: 64Mi
        ports:
        - name: metrics
          protocol: TCP
          containerPort: 2020
        livenessProbe:
          failureThreshold: 3
          httpGet:
            port: 2020
            path: /
            scheme: HTTP
          initialDelaySeconds: 120
          periodSeconds: 60
          successThreshold: 1
          timeoutSeconds: 1
        volumeMounts:
        - name: varlog
          mountPath: /var/log
        - name: varlibkubeletpods
          mountPath: /var/lib/kubelet/pods
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: fluent-bit-conf
          mountPath: /fluent-bit/etc/
      volumes:
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibkubeletpods
        hostPath:
          path: /var/lib/kubelet/pods
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: fluent-bit-conf
        configMap:
          name: fluent-bit-config
