apiVersion: v1
kind: ConfigMap
metadata:
  name: fluent-bit-config
  namespace: logging
  labels:
    app: fluent-bit
data:
  fluent-bit-service.conf: |-
    [SERVICE]
      Flush        1
      Daemon       Off
      Log_Level    info
      Parsers_File parsers.conf

  fluent-bit-input.conf: |-
    [INPUT]
      Name             tail
      Path             /var/log/containers/*.log
      Parser           docker
      Tag              kube.*
      Refresh_Interval 5
      Mem_Buf_Limit    5MB
      Skip_Long_Lines  On

  fluent-bit-filter.conf: |-
    [FILTER]
      Name                kubernetes
      Match               kube.*
      Kube_URL            https://kubernetes.logging.svc:443
      Kube_CA_File        /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
      Kube_Token_File     /var/run/secrets/kubernetes.io/serviceaccount/token
      Merge_Log           On
      K8S-Logging.Parser  On
      K8S-Logging.Exclude On

  fluent-bit-output.conf: |-
    [OUTPUT]
      Name            es
      Match           *
      Host            elasticsearch-cluster
      Port            9200
      Logstash_Format On
      Retry_Limit     False
      Type            flb_type
      Time_Key        @timestamp
      Replace_Dots    On
      Logstash_Prefix kubernetes_cluster

  fluent-bit.conf: |-
    @INCLUDE fluent-bit-service.conf
    @INCLUDE fluent-bit-input.conf
    @INCLUDE fluent-bit-filter.conf
    @INCLUDE fluent-bit-output.conf

  parsers.conf: |-
