From c2fb56a0d8853f42ee91050e90dd2c6b2e27430a Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Thu, 10 Dec 2020 06:36:26 -0800 Subject: [PATCH] More logging tuning --- charts/kubezero-logging/Chart.yaml | 2 +- charts/kubezero-logging/README.md | 3 +-- .../charts/fluent-bit/conf/fluent-bit.conf | 20 +++++++++++-------- charts/kubezero-logging/values.yaml | 1 - charts/kubezero/bootstrap.sh | 4 ++-- docs/Upgrade.md | 5 ++++- 6 files changed, 20 insertions(+), 15 deletions(-) diff --git a/charts/kubezero-logging/Chart.yaml b/charts/kubezero-logging/Chart.yaml index 1c0c77e..d4cd152 100644 --- a/charts/kubezero-logging/Chart.yaml +++ b/charts/kubezero-logging/Chart.yaml @@ -19,7 +19,7 @@ dependencies: version: ">= 0.1.3" repository: https://zero-down-time.github.io/kubezero/ - name: eck-operator - version: 1.3.0 + version: 1.3.1 repository: https://helm.elastic.co condition: eck-operator.enabled - name: fluentd diff --git a/charts/kubezero-logging/README.md b/charts/kubezero-logging/README.md index 9178c0a..fabff0e 100644 --- a/charts/kubezero-logging/README.md +++ b/charts/kubezero-logging/README.md @@ -18,7 +18,7 @@ Kubernetes: `>= 1.16.0` | Repository | Name | Version | |------------|------|---------| -| https://helm.elastic.co | eck-operator | 1.3.0 | +| https://helm.elastic.co | eck-operator | 1.3.1 | | https://kubernetes-charts.storage.googleapis.com/ | fluentd | 2.5.1 | | https://zero-down-time.github.io/kubezero/ | kubezero-lib | >= 0.1.3 | @@ -73,7 +73,6 @@ Kubernetes: `>= 1.16.0` | fluent-bit.config.output.host | string | `"logging-fluentd"` | | | fluent-bit.config.output.sharedKey | string | `"cloudbender"` | | | fluent-bit.config.output.tls | bool | `false` | | -| fluent-bit.config.outputs | object | `{}` | | | fluent-bit.enabled | bool | `false` | | | fluent-bit.serviceMonitor.enabled | bool | `true` | | | fluent-bit.serviceMonitor.selector.release | string | `"metrics"` | | diff --git a/charts/kubezero-logging/charts/fluent-bit/conf/fluent-bit.conf b/charts/kubezero-logging/charts/fluent-bit/conf/fluent-bit.conf index 9ce6b67..cc0776c 100644 --- a/charts/kubezero-logging/charts/fluent-bit/conf/fluent-bit.conf +++ b/charts/kubezero-logging/charts/fluent-bit/conf/fluent-bit.conf @@ -13,11 +13,13 @@ Path /var/log/containers/*.log Parser cri-log Tag cri.* - Mem_Buf_Limit {{ .Values.config.input.memBufLimit }} Skip_Long_Lines On - Refresh_Interval {{ .Values.config.input.refreshInterval }} DB /var/log/flb_kube.db DB.Sync Normal + {{- with .Values.config.input }} + Mem_Buf_Limit {{ default "16MB" .memBufLimit }} + Refresh_Interval {{ default 10 .refreshInterval }} + {{- end }} [FILTER] Name lua @@ -57,16 +59,18 @@ script /fluent-bit/etc/functions.lua call nest_k8s_ns -{{- if .Values.config.outputs }} -{{ tpl .Values.config.outputs . }} -{{- else }} +{{- if not .Values.config.output }} +{{ .Values.config.outputs }} +{{- end }} + +{{- with .Values.config.output }} [OUTPUT] Match * Name forward - Host {{ .Values.config.output.host }} + Host {{ .host }} Port 24224 - Shared_Key {{ .Values.config.output.sharedKey }} - tls {{ ternary "on" "off" .Values.config.output.tls }} + Shared_Key {{ .sharedKey }} + tls {{ ternary "on" "off" .tls }} Send_options true Require_ack_response true {{- end }} diff --git a/charts/kubezero-logging/values.yaml b/charts/kubezero-logging/values.yaml index 884a1cf..7a883ac 100644 --- a/charts/kubezero-logging/values.yaml +++ b/charts/kubezero-logging/values.yaml @@ -193,7 +193,6 @@ fluent-bit: enabled: false config: - outputs: {} output: host: logging-fluentd sharedKey: cloudbender diff --git a/charts/kubezero/bootstrap.sh b/charts/kubezero/bootstrap.sh index 54a2cfb..f5384ec 100755 --- a/charts/kubezero/bootstrap.sh +++ b/charts/kubezero/bootstrap.sh @@ -197,8 +197,8 @@ function kiam-post() { ########### # eck operator still doesnt support helm v3 so we have to toggle settings in the eck subchart function logging-crds() { - helm template $(chart_location $chart) --namespace $namespace --name-template $release --skip-crds --set eck-operator.installCRDs=false > $TMPDIR/helm-no-crds.yaml - helm template $(chart_location $chart) --namespace $namespace --name-template $release --include-crds --set eck-operator.installCRDs=true > $TMPDIR/helm-crds.yaml + helm template $(chart_location $chart) --namespace $namespace --name-template $release --skip-crds -f $TMPDIR/values.yaml --set eck-operator.installCRDs=false > $TMPDIR/helm-no-crds.yaml + helm template $(chart_location $chart) --namespace $namespace --name-template $release --include-crds -f $TMPDIR/values.yaml --set eck-operator.installCRDs=true > $TMPDIR/helm-crds.yaml diff -e $TMPDIR/helm-no-crds.yaml $TMPDIR/helm-crds.yaml | head -n-1 | tail -n+2 > $TMPDIR/crds.yaml [ -s $TMPDIR/crds.yaml ] && kubectl apply -f $TMPDIR/crds.yaml } diff --git a/docs/Upgrade.md b/docs/Upgrade.md index 4e10fcf..bc7442d 100644 --- a/docs/Upgrade.md +++ b/docs/Upgrade.md @@ -93,7 +93,10 @@ https://sysdig.com/blog/whats-new-kubernetes-1-18/ - set priorty class of ingress components to cluster essential ### Logging -- ES/Kibana version bump, new ECK operator +- ES/Kibana version bump to 7.10 +- ECK operator is now installed on demand in logging ns +- Custom event fields configurable via new fluent-bit chart + e.g. clustername could be added to each event allowing easy filtering in case multiple clusters stream events into a single central ES cluster ### ArgoCD - version bump, new app of app architecure