diff --git a/charts/fluent-operator/templates/fluentbit-servicemonitor.yaml b/charts/fluent-operator/templates/fluentbit-servicemonitor.yaml index e0b4ee39..c3a22d67 100644 --- a/charts/fluent-operator/templates/fluentbit-servicemonitor.yaml +++ b/charts/fluent-operator/templates/fluentbit-servicemonitor.yaml @@ -5,19 +5,24 @@ apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: fluent-bit + namespace: {{ template "fluent-operator.namespace" . }} labels: app.kubernetes.io/name: fluent-bit - namespace: {{ template "fluent-operator.namespace" . }} + {{- with .Values.fluentbit.serviceMonitor.labels }} + {{- toYaml . | nindent 4 }} + {{- end }} spec: endpoints: - port: metrics - path: {{ .Values.fluentbit.serviceMonitor.path }} - interval: {{ .Values.fluentbit.serviceMonitor.interval }} + path: {{ .Values.fluentbit.serviceMonitor.path }} {{- if .Values.fluentbit.serviceMonitor.secure }} scheme: https + {{- if .Values.fluentbit.serviceMonitor.tlsConfig }} tlsConfig: {{- toYaml .Values.fluentbit.serviceMonitor.tlsConfig }} {{- end }} + {{- end }} + interval: {{ .Values.fluentbit.serviceMonitor.interval }} scrapeTimeout: {{ .Values.fluentbit.serviceMonitor.scrapeTimeout }} {{- with .Values.fluentbit.serviceMonitor.relabelings }} relabelings: @@ -35,7 +40,7 @@ spec: {{- end }} namespaceSelector: matchNames: - - {{ template "fluent-operator.namespace" . }} + - {{ template "fluent-operator.namespace" . }} {{- end }} {{- end }} {{- end }} diff --git a/charts/fluent-operator/values.yaml b/charts/fluent-operator/values.yaml index 093a7860..e27603e4 100644 --- a/charts/fluent-operator/values.yaml +++ b/charts/fluent-operator/values.yaml @@ -14,7 +14,6 @@ operator: initcontainer: repository: "docker" tag: "20.10" - resources: limits: cpu: 100m @@ -77,15 +76,34 @@ fluentbit: # Installs a sub chart carrying the CRDs for the fluent-bit controller. The sub chart is enabled by default. crdsEnable: true enable: true + serviceMonitor: enable: false - interval: 30s + ## Labels that the Prometheus Operator looks for to act on this ServiceMonitor + # labels: + # release: prometheus-stack path: /api/v2/metrics/prometheus - scrapeTimeout: 10s + ## Applies "scheme: https" and tlsConfig if true secure: false - tlsConfig: {} - relabelings: [] - metricRelabelings: [] + # tlsConfig: {} + interval: 30s + scrapeTimeout: 10s + ## Relabel configs to apply to samples after ingestion + # relabelings: + # - sourceLabels: [__meta_kubernetes_pod_node_name] + # separator: ; + # regex: ^(.*)$ + # targetLabel: nodename + # replacement: $1 + # action: replace + ## Metric relabel configs to apply to samples before ingestion + # metricRelabelings: + # - sourceLabels: [__meta_kubernetes_service_label_cluster] + # targetLabel: cluster + # regex: (.*) + # replacement: ${1} + # action: replace + livenessProbe: enabled: true initialDelaySeconds: 10 @@ -107,12 +125,11 @@ fluentbit: cpu: 10m memory: 25Mi # Specify custom annotations to be added to each FluentBit pod. - annotations: - {} - ## Request to Fluent Bit to exclude or not the logs generated by the Pod. - # fluentbit.io/exclude: "true" - ## Prometheus can use this tag to automatically discover the Pod and collect monitoring data - # prometheus.io/scrape: "true" + annotations: {} + ## Request to Fluent Bit to exclude or not the logs generated by the Pod. + # fluentbit.io/exclude: "true" + ## Prometheus can use this tag to automatically discover the Pod and collect monitoring data + # prometheus.io/scrape: "true" # Specify additional custom labels for fluentbit-pods labels: {} @@ -230,18 +247,18 @@ fluentbit: pauseOnChunksOverlimit: "off" nodeExporterMetrics: {} # uncomment below nodeExporterMetrics section if you want to collect node exporter metrics - # nodeExporterMetrics: - # tag: node_metrics - # scrapeInterval: 15s - # path: - # procfs: /host/proc - # sysfs: /host/sys + # nodeExporterMetrics: + # tag: node_metrics + # scrapeInterval: 15s + # path: + # procfs: /host/proc + # sysfs: /host/sys fluentBitMetrics: {} # uncomment below fluentBitMetrics section if you want to collect fluentBit metrics -# fluentBitMetrics: -# scrapeInterval: "2" -# scrapeOnStart: true -# tag: "fb.metrics" + # fluentBitMetrics: + # scrapeInterval: "2" + # scrapeOnStart: true + # tag: "fb.metrics" # Configure the output plugin parameter in FluentBit. # You can set enable to true to output logs to the specified location. @@ -254,26 +271,26 @@ fluentbit: logstashPrefix: ks-logstash-log bufferSize: 20MB traceError: true - # logstashPrefixKey: ks-logstash-log - # suppressTypeName: "On" - # path: "" - # bufferSize: "4KB" - # index: "fluent-bit" - # httpUser: - # httpPassword: - # logstashFormat: true - # replaceDots: false - # enableTLS: false - # writeOperation: upsert - # tls: - # verify: On - # debug: 1 - # caFile: "" - # caPath: "" - # crtFile: "" - # keyFile: "" - # keyPassword: - # vhost: "" + # logstashPrefixKey: ks-logstash-log + # suppressTypeName: "On" + # path: "" + # bufferSize: "4KB" + # index: "fluent-bit" + # httpUser: + # httpPassword: + # logstashFormat: true + # replaceDots: false + # enableTLS: false + # writeOperation: upsert + # tls: + # verify: On + # debug: 1 + # caFile: "" + # caPath: "" + # crtFile: "" + # keyFile: "" + # keyPassword: + # vhost: "" kafka: enable: false brokers: "" @@ -284,15 +301,15 @@ fluentbit: # You can configure the opensearch-related configuration here stdout: enable: false - # Uncomment the following section to enable Prometheus metrics exporter. prometheusMetricsExporter: {} -# prometheusMetricsExporter: -# match: "fb.metrics" -# metricsExporter: -# host: "0.0.0.0" -# port: 2020 -# addLabels: -# app: "fluentbit" + # uncomment the following section to enable Prometheus metrics exporter + # prometheusMetricsExporter: + # match: "fb.metrics" + # metricsExporter: + # host: "0.0.0.0" + # port: 2020 + # addLabels: + # app: "fluentbit" # Loki fluentbit ClusterOutput, to be encapsulated in fluentbit config # See https://github.com/fluent/fluent-operator/blob/master/docs/plugins/fluentbit/output/loki.md @@ -349,15 +366,15 @@ fluentbit: service: storage: {} -# Remove the above storage section and uncomment below section if you want to configure file-system as storage for buffer -# storage: -# path: "/host/fluent-bit-buffer/" -# backlogMemLimit: "50MB" -# checksum: "off" -# deleteIrrecoverableChunks: "on" -# maxChunksUp: 128 -# metrics: "on" -# sync: normal + # uncomment below section if you want to configure file-system as storage for buffer + # storage: + # path: "/host/fluent-bit-buffer/" + # backlogMemLimit: "50MB" + # checksum: "off" + # deleteIrrecoverableChunks: "on" + # maxChunksUp: 128 + # metrics: "on" + # sync: normal # Configure the default filters in FluentBit. # The `filter` will filter and parse the collected log information and output the logs into a uniform format. You can choose whether to turn this on or not.