From 2e3bf75ab244adc78e32d7e63bdfaf6f785a51be Mon Sep 17 00:00:00 2001 From: Christian Lefebvre Date: Tue, 11 Apr 2023 16:19:30 +0200 Subject: [PATCH] add labels to cm, secret, ingress and service use .Values.labels, as deployment defaults to --- ae/templates/engine-configmap.yaml | 3 +++ ae/templates/engine-ingress.yaml | 3 +++ ae/templates/engine-service.yaml | 3 +++ ae/templates/licenses-secrets.yaml | 6 ++++++ 4 files changed, 15 insertions(+) diff --git a/ae/templates/engine-configmap.yaml b/ae/templates/engine-configmap.yaml index 4642c9ce..ff433f76 100644 --- a/ae/templates/engine-configmap.yaml +++ b/ae/templates/engine-configmap.yaml @@ -10,6 +10,9 @@ metadata: app.kubernetes.io/component: "{{ .Values.engine.name }}" app.kubernetes.io/managed-by: {{ .Release.Service }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} data: gravitee.yml: | ingesters: diff --git a/ae/templates/engine-ingress.yaml b/ae/templates/engine-ingress.yaml index 2908f5fe..d36bedb1 100644 --- a/ae/templates/engine-ingress.yaml +++ b/ae/templates/engine-ingress.yaml @@ -15,6 +15,9 @@ metadata: app.kubernetes.io/component: "{{ .Values.engine.name }}" app.kubernetes.io/managed-by: {{ .Release.Service }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} annotations: {{- if .Values.engine.ingress.annotations }} {{- include "common.ingress.annotations.render" (dict "annotations" .Values.engine.ingress.annotations "ingressClassName" .Values.engine.ingress.ingressClassName "context" $) | nindent 4 }} diff --git a/ae/templates/engine-service.yaml b/ae/templates/engine-service.yaml index c95d25ad..6d48a922 100644 --- a/ae/templates/engine-service.yaml +++ b/ae/templates/engine-service.yaml @@ -10,6 +10,9 @@ metadata: app.kubernetes.io/component: "{{ .Values.engine.name }}" app.kubernetes.io/managed-by: {{ .Release.Service }} helm.sh/chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + {{- range $key, $value := .Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} annotations: {{- range $key, $value := .Values.engine.service.annotations }} {{ $key }}: {{ $value | quote }} diff --git a/ae/templates/licenses-secrets.yaml b/ae/templates/licenses-secrets.yaml index f2e0805c..4df364ab 100644 --- a/ae/templates/licenses-secrets.yaml +++ b/ae/templates/licenses-secrets.yaml @@ -5,6 +5,12 @@ apiVersion: v1 kind: Secret metadata: name: {{ .name }} + {{- if $.Values.labels }} + labels: + {{- range $key, $value := $.Values.labels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} type: Opaque data: licensekey: {{ .key }}