Skip to content
Snippets Groups Projects
Commit c6c3db28 authored by Guillermo Facundo Colunga's avatar Guillermo Facundo Colunga
Browse files

[MONIT-4106] fluentbit/metrics: add support for user provided lua scripts

While doing trying to mimic the OpenShift logging setup with the current
Helm chart we noticed that they were using the lua scripts input from
the fluent bit official Helm chart. In our case this was not possible
and had to be done by adding secrets one by one.

We agreed to mimic this behaviour and had our own helm chart have the
option to add lua scripts to the fluent bit via helm chart values.

This commit modifies the configmap used to create the lua script that
we required for the timestampt in such a way that now it creates this
first lua script but also creates any other provided by the users via
the values of the helm chart.

Reported-at: https://its.cern.ch/jira/browse/MONIT-4106


Signed-off-by: default avatarGuillermo Facundo Colunga <guillermo.facundo.colunga@gmail.com>
Signed-off-by: Guillermo Facundo Colunga's avatarGuillermo Facundo Colunga <guillermo.facundo.colunga@cern.ch>
parent b24b0d7e
No related branches found
No related tags found
No related merge requests found
{{- if and .Values.metrics.enabled .Values.metrics.fluentbit.enabled -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: it-monit-metrics-collector-fluentbit-scripts
data:
{{- if .Values.metrics.fluentbit.luaScripts -}}
{{ range $key, $value := .Values.metrics.fluentbit.luaScripts }}
{{ $key }}: {{ $value | quote }}
{{ end }}
{{ end }}
{{- end -}}
\ No newline at end of file
...@@ -33,6 +33,8 @@ spec: ...@@ -33,6 +33,8 @@ spec:
volumeMounts: volumeMounts:
- name: config - name: config
mountPath: /fluent-bit/etc/conf mountPath: /fluent-bit/etc/conf
- name: scripts
mountPath: /fluent-bit/etc/scripts
- name: fluentbit - name: fluentbit
mountPath: /flb-storage/ mountPath: /flb-storage/
{{- if .Values.metrics.fluentbit.extraVolumeMounts }} {{- if .Values.metrics.fluentbit.extraVolumeMounts }}
...@@ -46,6 +48,9 @@ spec: ...@@ -46,6 +48,9 @@ spec:
- name: config - name: config
configMap: configMap:
name: it-monit-metrics-collector-fluentbit name: it-monit-metrics-collector-fluentbit
- name: scripts
configMap:
name: it-monit-metrics-collector-fluentbit-scripts
- name: fluentbit - name: fluentbit
emptyDir: emptyDir:
sizeLimit: {{ .Values.metrics.fluentbit.diskMaxCache }} sizeLimit: {{ .Values.metrics.fluentbit.diskMaxCache }}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment