apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluent-bit
  namespace: fluent-bit
  labels:
    app: fluent-bit
spec:
  updateStrategy:
    type: "RollingUpdate"
  template:
    metadata:
      labels:
        app: fluent-bit
      annotations:
        fluentbit.io/exclude: "true"
    spec:
      containers:
        - name: fluent-bit
          image: fluent/fluent-bit:1.7.5
          imagePullPolicy: "IfNotPresent"
          ports:
            - name: http
              containerPort: 2020
              protocol: TCP
          livenessProbe:
            httpGet:
              path: /
              port: http
          readinessProbe:
            httpGet:
              path: /
              port: http
          resources: {}
          securityContext: {}
          volumeMounts:
            - name: var-log
              mountPath: /var/log
            - name: var-lib-docker-containers
              mountPath: /var/lib/docker/containers
              readOnly: true
            - name: fluent-bit-config
              mountPath: /fluent-bit/etc/
            - name: systemd-log
              mountPath: /run/log
      terminationGracePeriodSeconds: 10
      volumes:
        - name: var-log
          hostPath:
            path: /var/log
        - name: var-lib-docker-containers
          hostPath:
            path: /var/lib/docker/containers
        - name: systemd-log
          hostPath:
            path: /run/log
        - name: fluent-bit-config
          configMap:
            name: fluent-bit-config
      serviceAccountName: fluent-bit-sa
      tolerations:
        - key: node-role.kubernetes.io/master
          operator: Exists
          effect: NoSchedule
        - operator: "Exists"
          effect: "NoExecute"
        - operator: "Exists"
          effect: "NoSchedule"
  selector:
    matchLabels:
      app: fluent-bit
