apiVersion: apps/v1
kind: DaemonSet
metadata:
  name: fluent-bit
  namespace: kube-system
  labels:
    k8s-app: fluent-bit-logging
    version: v1
    kubernetes.io/cluster-service: "true"
spec:
  selector:
    matchLabels:
      k8s-app: fluent-bit-logging
  template:
    metadata:
      labels:
        k8s-app: fluent-bit-logging
        version: v1
        kubernetes.io/cluster-service: "true"
    spec:
      containers:
      - name: fluent-bit
        image: fluent/fluent-bit:0.12.19
        env:
          - name:  KAFKA_REST_HOST
            value: rest.kafka.svc.cluster.local
          - name:  KAFKA_REST_PORT
            value: "80"
          - name:  KAFKA_TOPIC
            value: fluent-bit
        command:
          - /fluent-bit/bin/fluent-bit
          - -c
          - /fluent-bit/etc/fluent-bit.conf
        resources:
          limits:
            memory: 100Mi
          requests:
            cpu: 100m
            memory: 100Mi
        volumeMounts:
        - name: config
          mountPath: /fluent-bit/etc
        - name: varlog
          mountPath: /var/log
        - name: varlibdockercontainers
          mountPath: /var/lib/docker/containers
          readOnly: true
        - name: minikube
          mountPath: /mnt/sda1/var/lib/docker/containers
          readOnly: true
      terminationGracePeriodSeconds: 10
      volumes:
      - name: config
        configMap:
          name: fluent-bit-config-kafka-rest
      - name: varlog
        hostPath:
          path: /var/log
      - name: varlibdockercontainers
        hostPath:
          path: /var/lib/docker/containers
      - name: minikube
        hostPath:
          path: /mnt/sda1/var/lib/docker/containers
