diff --git a/http-add-on/templates/_helpers.tpl b/http-add-on/templates/_helpers.tpl index df9291d8..5fccfba9 100644 --- a/http-add-on/templates/_helpers.tpl +++ b/http-add-on/templates/_helpers.tpl @@ -8,14 +8,23 @@ Create chart name and version as used by the chart label. {{- end -}} {{/* -Generate basic labels +Generate match labels +IMPORTANT: Any change of these labels will block +future upgrades */}} -{{- define "keda-http-add-on.labels" }} -helm.sh/chart: {{ include "keda-http-add-on.chart" . }} +{{- define "keda-http-add-on.matchLabels" }} app.kubernetes.io/part-of: {{ .Chart.Name }} app.kubernetes.io/managed-by: {{ .Release.Service }} app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} + +{{/* +Generate basic labels +*/}} +{{- define "keda-http-add-on.labels" }} +{{- include "keda-http-add-on.matchLabels" . }} app.kubernetes.io/version: {{ .Values.images.tag | default .Chart.AppVersion }} +helm.sh/chart: {{ include "keda-http-add-on.chart" . }} {{- if .Values.additionalLabels }} {{ toYaml .Values.additionalLabels }} {{- end }} diff --git a/http-add-on/templates/interceptor/deployment.yaml b/http-add-on/templates/interceptor/deployment.yaml index 79c6b9d8..0aeaa994 100644 --- a/http-add-on/templates/interceptor/deployment.yaml +++ b/http-add-on/templates/interceptor/deployment.yaml @@ -10,7 +10,7 @@ spec: selector: matchLabels: app.kubernetes.io/component: interceptor - {{- include "keda-http-add-on.labels" . | indent 6 }} + {{- include "keda-http-add-on.matchLabels" . | indent 6 }} template: metadata: labels: diff --git a/http-add-on/templates/interceptor/service-admin.yaml b/http-add-on/templates/interceptor/service-admin.yaml index bea0d586..0e33fcc6 100644 --- a/http-add-on/templates/interceptor/service-admin.yaml +++ b/http-add-on/templates/interceptor/service-admin.yaml @@ -13,4 +13,4 @@ spec: targetPort: admin selector: app.kubernetes.io/component: interceptor - {{- include "keda-http-add-on.labels" . | indent 4 }} + {{- include "keda-http-add-on.matchLabels" . | indent 4 }} diff --git a/http-add-on/templates/interceptor/service-proxy.yaml b/http-add-on/templates/interceptor/service-proxy.yaml index 422de5ca..bcb41229 100644 --- a/http-add-on/templates/interceptor/service-proxy.yaml +++ b/http-add-on/templates/interceptor/service-proxy.yaml @@ -13,4 +13,4 @@ spec: targetPort: proxy selector: app.kubernetes.io/component: interceptor - {{- include "keda-http-add-on.labels" . | indent 4 }} + {{- include "keda-http-add-on.matchLabels" . | indent 4 }} diff --git a/http-add-on/templates/operator/deployment.yaml b/http-add-on/templates/operator/deployment.yaml index 5705e42d..93bda3dc 100644 --- a/http-add-on/templates/operator/deployment.yaml +++ b/http-add-on/templates/operator/deployment.yaml @@ -11,7 +11,7 @@ spec: selector: matchLabels: app.kubernetes.io/component: operator - {{- include "keda-http-add-on.labels" . | indent 6 }} + {{- include "keda-http-add-on.matchLabels" . | indent 6 }} template: metadata: labels: diff --git a/http-add-on/templates/operator/service.yaml b/http-add-on/templates/operator/service.yaml index b0b15cba..71f6990a 100644 --- a/http-add-on/templates/operator/service.yaml +++ b/http-add-on/templates/operator/service.yaml @@ -13,4 +13,4 @@ spec: targetPort: metrics selector: app.kubernetes.io/component: operator - {{- include "keda-http-add-on.labels" . | indent 4 }} + {{- include "keda-http-add-on.matchLabels" . | indent 4 }} diff --git a/http-add-on/templates/scaler/deployment.yaml b/http-add-on/templates/scaler/deployment.yaml index c5493f1e..aacc6d38 100644 --- a/http-add-on/templates/scaler/deployment.yaml +++ b/http-add-on/templates/scaler/deployment.yaml @@ -11,7 +11,7 @@ spec: selector: matchLabels: app.kubernetes.io/component: scaler - {{- include "keda-http-add-on.labels" . | indent 6 }} + {{- include "keda-http-add-on.matchLabels" . | indent 6 }} template: metadata: labels: diff --git a/http-add-on/templates/scaler/service.yaml b/http-add-on/templates/scaler/service.yaml index 308c9f0c..98e3a205 100644 --- a/http-add-on/templates/scaler/service.yaml +++ b/http-add-on/templates/scaler/service.yaml @@ -13,4 +13,4 @@ spec: targetPort: grpc selector: app.kubernetes.io/component: scaler - {{- include "keda-http-add-on.labels" . | indent 4 }} + {{- include "keda-http-add-on.matchLabels" . | indent 4 }} 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 174e7549..a2a38249 100644 --- a/keda/values.yaml +++ b/keda/values.yaml @@ -496,11 +496,11 @@ resources: # -- Manage [resource request & limits] of KEDA admission webhooks pod webhooks: limits: - cpu: 50m - memory: 100Mi + cpu: 1 + memory: 1000Mi requests: - cpu: 10m - memory: 10Mi + cpu: 100m + memory: 100Mi # -- Node selector for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/)) nodeSelector: {} # -- Tolerations for pod scheduling ([docs](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)) @@ -845,3 +845,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: ""