diff --git a/kubernetes/helm/collabora-online/README.md b/kubernetes/helm/collabora-online/README.md index 4743770f2..68d7b3f11 100644 --- a/kubernetes/helm/collabora-online/README.md +++ b/kubernetes/helm/collabora-online/README.md @@ -241,6 +241,47 @@ In order for Collaborative Editing and copy/paste to function correctly on kuber --- + +## Kubernetes cluster logging +1. Install [Logging Operator](https://kube-logging.dev/) with an ClusterOutput "default". + +2. Enable logging flow in your + + + `my_values.yaml` + + ```yaml + logging: + enabled: true + ecs: true + dedot: "-" + additionalFilters: + - grep: + exclude: + - key: "$['log']['level']" + pattern: '/(info|debug|trace)/' + globalOutputRefs: + - "default" + dynamicConfig: + logging: + enabled: true + ecs: true + dedot: "-" + globalOutputRefs: + - "default" + upload: + logging: + enabled: true + ecs: true + dedot: "-" + globalOutputRefs: + - "default" + ``` + + * `dedot`: usefull if the Logging has an [global filter](https://kube-logging.dev/4.0/docs/configuration/crds/v1beta1/logging_types/#loggingspec-globalfilters) for dedot an correction for selector is possible. + * `ecs`: Therefore the fields are remapped to filter to the [ElasticCommonSchema](https://www.elastic.co/guide/en/ecs/current/index.html). + * `additionalFilters`: Add more filter of the logging-operator + ## Dynamic/Remote configuration in kubernetes For big setups, you may not want to restart every pod to modify WOPI diff --git a/kubernetes/helm/collabora-online/templates/_helpers.tpl b/kubernetes/helm/collabora-online/templates/_helpers.tpl index f56b03c8f..b005f4b40 100644 --- a/kubernetes/helm/collabora-online/templates/_helpers.tpl +++ b/kubernetes/helm/collabora-online/templates/_helpers.tpl @@ -50,6 +50,18 @@ app.kubernetes.io/name: {{ include "collabora-online.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} {{- end }} +{{/* +Selector Log labels +*/}} +{{- define "collabora-online.selectorLogLabels" -}} +{{- if .Values.logging.dedot }} +app{{.Values.logging.dedot }}kubernetes{{.Values.logging.dedot }}io/name: {{ include "collabora-online.name" . }} +app{{.Values.logging.dedot }}kubernetes{{.Values.logging.dedot }}io/instance: {{ .Release.Name }} +{{- else }} +{{ include "collabora-online.selectorLabels" . }} +{{- end }} +{{- end }} + {{/* Create the name of the service account to use */}} diff --git a/kubernetes/helm/collabora-online/templates/dynamicConfig/flow_dynconfig.yaml b/kubernetes/helm/collabora-online/templates/dynamicConfig/flow_dynconfig.yaml new file mode 100644 index 000000000..b884d720a --- /dev/null +++ b/kubernetes/helm/collabora-online/templates/dynamicConfig/flow_dynconfig.yaml @@ -0,0 +1,81 @@ +{{- with .Values.dynamicConfig.logging }} +{{- if and .enabled $.Values.dynamicConfig.enabled }} + +--- +apiVersion: logging.banzaicloud.io/v1beta1 +kind: Flow +metadata: + name: {{ include "collabora-online.fullname" $ }}-dynconfig +spec: + match: + - select: + labels: + type: dynconfig + {{- include "collabora-online.selectorLogLabels" $ | nindent 10 }} + container_names: + - "{{ $.Chart.Name }}-dynconfig" + + filters: + - parser: + hash_value_field: "nginx" + reserve_data: true + remove_key_name_field: true + parse: + type: "multi_format" + patterns: + - format: "regexp" + # for + expression: '^(?[^ ]*) -?(?.*) -?(?[^ ]*) \[(?