From 7310235fa214e984e954730167441e200bf478e1 Mon Sep 17 00:00:00 2001 From: Stefan Reimer Date: Sat, 22 Aug 2020 18:27:18 +0100 Subject: [PATCH] Add fluent-bit support to kuberzero-logging, istio fixes --- charts/fluent-bit | 1 + .../templates/istio-private-ingress.yaml | 8 +- charts/kubezero-lib/templates/_helpers.tpl | 2 +- charts/kubezero-logging/Chart.yaml | 7 +- charts/kubezero-logging/values-fluentbit.yaml | 8 ++ charts/kubezero-logging/values.yaml | 108 +++++++++++++++++- deploy/templates/values.yaml | 12 ++ deploy/values.yaml | 2 + scripts/publish.sh | 5 +- 9 files changed, 144 insertions(+), 9 deletions(-) create mode 120000 charts/fluent-bit create mode 100644 charts/kubezero-logging/values-fluentbit.yaml diff --git a/charts/fluent-bit b/charts/fluent-bit new file mode 120000 index 00000000..cd73d773 --- /dev/null +++ b/charts/fluent-bit @@ -0,0 +1 @@ +../../helm-charts/charts/fluent-bit \ No newline at end of file diff --git a/charts/kubezero-istio/templates/istio-private-ingress.yaml b/charts/kubezero-istio/templates/istio-private-ingress.yaml index 79665393..bcb998c0 100644 --- a/charts/kubezero-istio/templates/istio-private-ingress.yaml +++ b/charts/kubezero-istio/templates/istio-private-ingress.yaml @@ -45,11 +45,11 @@ spec: {{- end }} resources: limits: - cpu: 2000m + # cpu: 2000m memory: 1024Mi requests: cpu: 100m - memory: 128Mi + memory: 64Mi strategy: rollingUpdate: maxSurge: 100% @@ -115,11 +115,11 @@ spec: image: node-agent-k8s resources: limits: - #cpu: 2000m + cpu: 2000m memory: 1024Mi requests: cpu: 100m - memory: 64Mi + memory: 128Mi secretVolumes: - mountPath: /etc/istio/ingressgateway-certs name: ingressgateway-certs diff --git a/charts/kubezero-lib/templates/_helpers.tpl b/charts/kubezero-lib/templates/_helpers.tpl index f0de5480..808f73b8 100644 --- a/charts/kubezero-lib/templates/_helpers.tpl +++ b/charts/kubezero-lib/templates/_helpers.tpl @@ -2,7 +2,7 @@ Common set of labels */ -}} {{- define "kubezero-lib.labels" -}} -helm.sh/chart: {{ include "kubezero-lib.chart . }} +helm.sh/chart: {{ include "kubezero-lib.chart" . }} app.kubernetes.io/name: {{ include "kubezero-lib.name" . }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/part-of: kubezero diff --git a/charts/kubezero-logging/Chart.yaml b/charts/kubezero-logging/Chart.yaml index 07508218..71cdf36e 100644 --- a/charts/kubezero-logging/Chart.yaml +++ b/charts/kubezero-logging/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: kubezero-logging description: KubeZero Umbrella Chart for complete EFK stack type: application -version: 0.2.0 +version: 0.3.1 appVersion: 1.2.1 home: https://kubezero.com icon: https://cdn.zero-downtime.net/assets/kubezero/logo-small-64.png @@ -22,4 +22,9 @@ dependencies: version: 2.5.1 repository: https://kubernetes-charts.storage.googleapis.com/ condition: fluentd.enabled + - name: fluent-bit + version: 0.6.3 + repository: https://zero-down-time.github.io/kubezero/ + # repository: https://fluent.github.io/helm-charts + condition: fluent-bit.enabled kubeVersion: ">= 1.16.0" diff --git a/charts/kubezero-logging/values-fluentbit.yaml b/charts/kubezero-logging/values-fluentbit.yaml new file mode 100644 index 00000000..298b39a4 --- /dev/null +++ b/charts/kubezero-logging/values-fluentbit.yaml @@ -0,0 +1,8 @@ +fluent-bit: + enabled: true + + metrics: + enabled: true + + url: fluentd.example.com + diff --git a/charts/kubezero-logging/values.yaml b/charts/kubezero-logging/values.yaml index 1a537d44..6f34ef8b 100644 --- a/charts/kubezero-logging/values.yaml +++ b/charts/kubezero-logging/values.yaml @@ -125,7 +125,7 @@ fluentd: id_key id remove_keys id - # This pipeline incl. eg. GeoIP + # KubeZero pipeline incl. GeoIP etc. pipeline fluentd host "#{ENV['OUTPUT_HOST']}" @@ -193,3 +193,109 @@ fluentd: # # # + + +fluent-bit: + enabled: true + test: + enabled: false + + config: + outputs: | + [OUTPUT] + Match * + Name forward + Host fluentd + Port 24224 + tls on + tls.verify off + Shared_Key cloudbender + + inputs: | + [INPUT] + Name tail + Path /var/log/containers/*.log + Parser cri + Tag kube.* + Mem_Buf_Limit 5MB + Skip_Long_Lines On + Refresh_Interval 10 + DB /var/log/flb_kube.db + DB.Sync Normal + + filters: | + [FILTER] + Name kubernetes + Match kube.* + Merge_Log On + Keep_Log Off + K8S-Logging.Parser On + K8S-Logging.Exclude On + + [FILTER] + Name lua + Match kube.* + script /fluent-bit/etc/functions.lua + call dedot + + customParsers: | + [PARSER] + # http://rubular.com/r/tjUt3Awgg4 + Name cri + Format regex + Regex ^(?