From 983796fdb5749a41a3da70a2e769b3e9ac63aa16 Mon Sep 17 00:00:00 2001 From: Pavel Dmytrenko Date: Sat, 18 Jul 2020 15:40:50 +0300 Subject: [PATCH] [stable/fluent-bit] Add support for init containers (#23074) * [stable/fluent-bit] Implement support for init containers Signed-off-by: Pavel Dmytrenko * [stable/fluent-bit] Update README Signed-off-by: Pavel Dmytrenko * [stable/fluent-bit] Bump chart version Signed-off-by: Pavel Dmytrenko * [stable/fluent-bit] Resolve conflict Signed-off-by: Pavel Dmytrenko --- stable/fluent-bit/Chart.yaml | 2 +- stable/fluent-bit/README.md | 1 + stable/fluent-bit/templates/daemonset.yaml | 7 +++++++ stable/fluent-bit/values.yaml | 18 ++++++++++++++++++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/stable/fluent-bit/Chart.yaml b/stable/fluent-bit/Chart.yaml index aba3bfb6fa..a2dacab735 100755 --- a/stable/fluent-bit/Chart.yaml +++ b/stable/fluent-bit/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: fluent-bit -version: 2.9.0 +version: 2.10.0 appVersion: 1.3.7 description: Fast and Lightweight Log/Data Forwarder for Linux, BSD and OSX keywords: diff --git a/stable/fluent-bit/README.md b/stable/fluent-bit/README.md index 9ae73278a2..f9ef75d65c 100644 --- a/stable/fluent-bit/README.md +++ b/stable/fluent-bit/README.md @@ -112,6 +112,7 @@ The following table lists the configurable parameters of the Fluent-Bit chart an | `extraPorts` | List of extra ports | | | `extraVolumeMounts` | Mount an extra volume, required to mount ssl certificates when elasticsearch has tls enabled | | | `extraVolume` | Extra volume | | +| `initContainers` | Init containers | `{}` | | `service.flush` | Interval to flush output (seconds) | `1` | | `service.logLevel` | Diagnostic level (error/warning/info/debug/trace) | `info` | | `filter.enableExclude` | Enable the use of monitoring for a pod annotation of `fluentbit.io/exclude: true`. If present, discard logs from that pod. | `true` | diff --git a/stable/fluent-bit/templates/daemonset.yaml b/stable/fluent-bit/templates/daemonset.yaml index c58b02ca9e..5a7aae285e 100644 --- a/stable/fluent-bit/templates/daemonset.yaml +++ b/stable/fluent-bit/templates/daemonset.yaml @@ -49,6 +49,13 @@ spec: {{ toYaml .Values.dnsConfig | indent 8 }} {{- end }} serviceAccountName: {{ template "fluent-bit.serviceAccountName" . }} +{{- if .Values.initContainers }} + initContainers: +{{- range $key, $value := .Values.initContainers }} + - name: "{{ $key }}" +{{ toYaml $value | indent 8 }} +{{- end }} +{{- end }} containers: - name: fluent-bit image: "{{ .Values.image.fluent_bit.repository }}:{{ .Values.image.fluent_bit.tag }}" diff --git a/stable/fluent-bit/values.yaml b/stable/fluent-bit/values.yaml index 8305e85de9..71afee6cb0 100644 --- a/stable/fluent-bit/values.yaml +++ b/stable/fluent-bit/values.yaml @@ -331,3 +331,21 @@ securityContext: {} podSecurityContext: {} # podSecurityContext: # runAsUser: 1000 + +## Add your own init container (example installation of Lua filter plugin) +## Ref: https://kubernetes.io/docs/concepts/workloads/pods/init-containers/ +initContainers: {} + # load-plugin: + # image: "appropriate/curl:latest" + # imagePullPolicy: "IfNotPresent" + # # Assumed plugins volume is configured at Pod level via extraVolumes + # volumeMounts: + # - name: plugins + # mountPath: /fluent-bit/plugins + # command: + # - "/bin/sh" + # - "-c" + # - | + # curl -sS -o /plugin.zip + # unzip /plugin.zip + # cp -av /fluent-bit/plugins/