From 77d7c5ebec6830cbefb3ac855b1c26874a74d06d Mon Sep 17 00:00:00 2001 From: Jirka Kremser Date: Tue, 26 Mar 2024 11:44:38 +0100 Subject: [PATCH] feat: Add a way to customize the 'managed-by' label Signed-off-by: Jirka Kremser --- keda/README.md | 1 + keda/templates/_helpers.tpl | 2 +- keda/values.yaml | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/keda/README.md b/keda/README.md index 3180562b..342cc0e0 100644 --- a/keda/README.md +++ b/keda/README.md @@ -80,6 +80,7 @@ their default values. | `clusterName` | string | `"kubernetes-default"` | Kubernetes cluster name. Used in features such as emitting CloudEvents | | `crds.additionalAnnotations` | object | `{}` | Custom annotations specifically for CRDs | | `crds.install` | bool | `true` | Defines whether the KEDA CRDs have to be installed or not. | +| `customManagedBy` | string | `""` | When specified, each rendered resource will have `app.kubernetes.io/managed-by: ${this}` label on it. Useful, when using only helm template with some other solution. | | `env` | list | `[]` | Additional environment variables that will be passed onto all KEDA components | | `extraObjects` | list | `[]` | Array of extra K8s manifests to deploy | | `global.image.registry` | string | `nil` | Global image registry of KEDA components | diff --git a/keda/templates/_helpers.tpl b/keda/templates/_helpers.tpl index 3963c42f..e64afaa2 100644 --- a/keda/templates/_helpers.tpl +++ b/keda/templates/_helpers.tpl @@ -13,7 +13,7 @@ Generate basic labels for CRD {{- define "keda.crd-labels" }} helm.sh/chart: {{ include "keda.chart" . }} app.kubernetes.io/component: operator -app.kubernetes.io/managed-by: {{ .Release.Service }} +app.kubernetes.io/managed-by: {{ .Values.customManagedBy | default .Release.Service }} app.kubernetes.io/part-of: {{ .Values.operator.name }} {{- if .Chart.AppVersion }} app.kubernetes.io/version: {{ .Chart.AppVersion }} diff --git a/keda/values.yaml b/keda/values.yaml index 0dff0ade..3230920c 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -812,3 +812,6 @@ extraObjects: [] # -- Capability to turn on/off ASCII art in Helm installation notes asciiArt: true + +# -- When specified, each rendered resource will have `app.kubernetes.io/managed-by: ${this}` label on it. Useful, when using only helm template with some other solution. +customManagedBy: ""