configmap.yaml 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. ---
  2. # Source: loki-stack/charts/fluent-bit/templates/configmap.yaml
  3. apiVersion: v1
  4. kind: ConfigMap
  5. metadata:
  6. name: loki-fluent-bit-loki
  7. namespace: loki
  8. labels:
  9. app: fluent-bit-loki
  10. chart: fluent-bit-0.0.2
  11. release: loki
  12. heritage: Tiller
  13. data:
  14. fluent-bit.conf: |-
  15. [SERVICE]
  16. Flush 1
  17. Daemon Off
  18. Log_Level warn
  19. Parsers_File parsers.conf
  20. [INPUT]
  21. Name tail
  22. Tag kube.*
  23. Path /var/log/containers/*.log
  24. Parser docker
  25. DB /run/fluent-bit/flb_kube.db
  26. Mem_Buf_Limit 5MB
  27. [FILTER]
  28. Name kubernetes
  29. Match kube.*
  30. Kube_URL https://kubernetes.default.svc:443
  31. Merge_Log On
  32. [Output]
  33. Name loki
  34. Match *
  35. Url http://loki:3100/api/prom/push
  36. Labels {job="fluent-bit"}
  37. RemoveKeys kubernetes,stream
  38. LabelMapPath /fluent-bit/etc/labelmap.json
  39. LineFormat json
  40. LogLevel warn
  41. parsers.conf: |-
  42. [PARSER]
  43. Name docker
  44. Format json
  45. Time_Key time
  46. Time_Format %Y-%m-%dT%H:%M:%S.%L
  47. labelmap.json: |-
  48. {
  49. "kubernetes": {
  50. "container_name": "container",
  51. "host": "node",
  52. "labels": {
  53. "app": "app",
  54. "release": "release"
  55. },
  56. "namespace_name": "namespace",
  57. "pod_name": "instance"
  58. },
  59. "stream": "stream"
  60. }