From 999fda290c9cd0cb7923f205b10804d763d217ac Mon Sep 17 00:00:00 2001 From: Naseem Date: Mon, 4 Mar 2019 12:40:57 -0500 Subject: [PATCH] update helpers (#11594) Signed-off-by: Naseem Ullah --- stable/fluent-bit/Chart.yaml | 2 +- stable/fluent-bit/README.md | 8 +++++++- stable/fluent-bit/templates/_helpers.tpl | 16 ++++++++++++++++ stable/fluent-bit/values.yaml | 3 +++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/stable/fluent-bit/Chart.yaml b/stable/fluent-bit/Chart.yaml index 79939fb253..44c8fa42a6 100755 --- a/stable/fluent-bit/Chart.yaml +++ b/stable/fluent-bit/Chart.yaml @@ -1,5 +1,5 @@ name: fluent-bit -version: 1.7.0 +version: 1.8.0 appVersion: 1.0.4 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 27ddf7e9e5..7307a2b803 100644 --- a/stable/fluent-bit/README.md +++ b/stable/fluent-bit/README.md @@ -99,6 +99,8 @@ The following table lists the configurable parameters of the Fluent-Bit chart an | `image.fluent_bit.repository` | Image | `fluent/fluent-bit` | | `image.fluent_bit.tag` | Image tag | `1.0.4` | | `image.pullPolicy` | Image pull policy | `IfNotPresent` | +| `nameOverride` | Override name of app | `nil` | +| `fullnameOverride` | Override full name of app | `nil` | | `image.pullSecrets` | Specify image pull secrets | `nil` | | `input.tail.memBufLimit` | Specify Mem_Buf_Limit in tail input | `5MB` | | `input.tail.parser` | Specify Parser in tail input. | `docker` | @@ -138,8 +140,12 @@ $ helm install --name my-release -f values.yaml stable/fluent-bit ## Upgrading -### From < 1.0.0 To 1.0.0 +### From < 1.0.0 To >= 1.0.0 Values `extraInputs`, `extraFilters` and `extraOutputs` have been removed in version `1.0.0` of the fluent-bit chart. To add additional entries to the existing sections, please use the `extraEntries.input`, `extraEntries.filter` and `extraEntries.output` values. For entire sections, please use the `rawConfig` value, inserting blocks of text as desired. + +### From < 1.8.0 to >= 1.8.0 + +Version `1.8.0` introduces the use of release name as full name if it contains the chart name(fluent-bit in this case). E.g. with a release name of `fluent-bit`, this renames the DaemonSet from `fluent-bit-fluent-bit` to `fluent-bit`. The suggested approach is to delete the release and reinstall it. \ No newline at end of file diff --git a/stable/fluent-bit/templates/_helpers.tpl b/stable/fluent-bit/templates/_helpers.tpl index dca15d75a8..42453daea6 100644 --- a/stable/fluent-bit/templates/_helpers.tpl +++ b/stable/fluent-bit/templates/_helpers.tpl @@ -9,11 +9,27 @@ Expand the name of the chart. {{/* Create a default fully qualified app name. We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. */}} {{- define "fluent-bit.fullname" -}} +{{- if .Values.fullnameOverride -}} +{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- $name := default .Chart.Name .Values.nameOverride -}} +{{- if contains $name .Release.Name -}} +{{- .Release.Name | trunc 63 | trimSuffix "-" -}} +{{- else -}} {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} {{- end -}} +{{- end -}} +{{- end -}} + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "fluent-bit.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} +{{- end -}} {{/* Return the appropriate apiVersion for RBAC APIs. diff --git a/stable/fluent-bit/values.yaml b/stable/fluent-bit/values.yaml index 46e68d286a..3095957047 100644 --- a/stable/fluent-bit/values.yaml +++ b/stable/fluent-bit/values.yaml @@ -8,6 +8,9 @@ image: tag: 1.0.4 pullPolicy: IfNotPresent +nameOverride: "" +fullnameOverride: "" + # When enabled, exposes json and prometheus metrics on {{ .Release.Name }}-metrics service metrics: enabled: false