From 6cb85a7846587269b0e32a9e57ebb6e032b0ddce Mon Sep 17 00:00:00 2001 From: thr Date: Mon, 6 Nov 2023 15:51:27 +0100 Subject: [PATCH] extraLabels support --- developerportal/helm/README.md | 1 + developerportal/helm/templates/ingress.yaml | 3 +++ developerportal/helm/templates/service.yaml | 5 ++++- developerportal/helm/templates/statefulset.yaml | 8 +++++++- developerportal/helm/values.yaml | 3 +++ microservicesruntime/helm/README.md | 3 ++- microservicesruntime/helm/templates/configmap.yaml | 3 +++ microservicesruntime/helm/templates/deployment.yaml | 6 ++++++ microservicesruntime/helm/templates/hpa.yaml | 3 +++ microservicesruntime/helm/templates/ingress.yaml | 3 +++ microservicesruntime/helm/templates/job.yaml | 10 ++++++++++ microservicesruntime/helm/templates/license.yaml | 3 +++ .../helm/templates/nginx-configmap.yaml | 3 +++ .../helm/templates/nginx-deployment.yaml | 6 ++++++ microservicesruntime/helm/templates/nginx-svc.yaml | 3 +++ microservicesruntime/helm/templates/pvc.yaml | 3 +++ microservicesruntime/helm/templates/service.yaml | 3 +++ .../helm/templates/serviceaccount.yaml | 3 +++ .../helm/templates/servicemonitor.yaml | 3 +++ microservicesruntime/helm/values.yaml | 3 +++ mywebmethodsserver/helm/README.md | 1 + mywebmethodsserver/helm/templates/hpa.yaml | 3 +++ mywebmethodsserver/helm/templates/ingress.yaml | 3 +++ mywebmethodsserver/helm/templates/service.yaml | 3 +++ mywebmethodsserver/helm/templates/statefulset.yaml | 6 ++++++ mywebmethodsserver/helm/values.yaml | 3 +++ universalmessaging/helm/README.md | 1 + universalmessaging/helm/templates/configmap.yaml | 3 +++ universalmessaging/helm/templates/ingress.yaml | 3 +++ universalmessaging/helm/templates/job.yaml | 10 ++++++++++ universalmessaging/helm/templates/service.yaml | 4 ++++ universalmessaging/helm/templates/serviceaccount.yaml | 3 +++ universalmessaging/helm/templates/statefulset.yaml | 6 ++++++ universalmessaging/helm/values.yaml | 3 +++ 34 files changed, 127 insertions(+), 3 deletions(-) diff --git a/developerportal/helm/README.md b/developerportal/helm/README.md index c1797f4..bc8a9bc 100644 --- a/developerportal/helm/README.md +++ b/developerportal/helm/README.md @@ -77,6 +77,7 @@ helm install webmethods/developerportal devportal | extraContainers | list | `[]` | Extra containers which should run in addition to the main container as a sidecar | | extraEnvs | object | `{}` | Exta environment properties to be passed on to the container | | extraInitContainers | list | `[]` | Extra init containers that are executed before starting the main container | +| extraLabels | object | `{}` | Extra Labels | | extraVolumeMounts | list | `[]` | Extra volume mounts | | extraVolumes | list | `[]` | Exta volumes that should be mounted. | | fullnameOverride | string | `""` | Overwrites full workload name. As default, the workload name is release name + '-' + Chart name. | diff --git a/developerportal/helm/templates/ingress.yaml b/developerportal/helm/templates/ingress.yaml index 29256fa..c40e74a 100644 --- a/developerportal/helm/templates/ingress.yaml +++ b/developerportal/helm/templates/ingress.yaml @@ -37,6 +37,9 @@ metadata: name: {{ $fullName }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/developerportal/helm/templates/service.yaml b/developerportal/helm/templates/service.yaml index c97de2c..3560b55 100644 --- a/developerportal/helm/templates/service.yaml +++ b/developerportal/helm/templates/service.yaml @@ -21,7 +21,10 @@ kind: Service metadata: name: {{ include "common.names.fullname" . }} labels: - {{ include "common.labels.standard" . | nindent 6 }} + {{ include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: clusterIP: None ports: diff --git a/developerportal/helm/templates/statefulset.yaml b/developerportal/helm/templates/statefulset.yaml index ed81c7c..8494fcf 100644 --- a/developerportal/helm/templates/statefulset.yaml +++ b/developerportal/helm/templates/statefulset.yaml @@ -21,7 +21,10 @@ kind: StatefulSet metadata: name: {{ include "common.names.fullname" . }} labels: - {{ include "common.labels.standard" . | nindent 6 }} + {{ include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: podManagementPolicy: Parallel serviceName: {{ include "common.names.fullname" . }}-svc @@ -34,6 +37,9 @@ spec: metadata: labels: {{- include "common.labels.standard" . | nindent 8 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 8 }} + {{- end }} name: {{ include "common.names.fullname" . }} annotations: {{- include "common.prometheus.annotations" (dict "port" .Values.prometheus.port "path" .Values.prometheus.path "scheme" .Values.prometheus.scheme "scrape" .Values.prometheus.scrape ) | nindent 8 }} diff --git a/developerportal/helm/values.yaml b/developerportal/helm/values.yaml index 78f7cdf..fef02b6 100644 --- a/developerportal/helm/values.yaml +++ b/developerportal/helm/values.yaml @@ -110,6 +110,9 @@ tolerations: [] affinity: {} +# -- Extra Labels +extraLabels: {} + # -- Exta environment properties to be passed on to the container extraEnvs: {} diff --git a/microservicesruntime/helm/README.md b/microservicesruntime/helm/README.md index b8cb81d..b22baf2 100644 --- a/microservicesruntime/helm/README.md +++ b/microservicesruntime/helm/README.md @@ -102,6 +102,7 @@ helm install wm-msr webmethods/microservicesruntime \ | extraContainers | list | `[]` | Extra containers which should run in addtion to the main container as a sidecar | | extraEnvs | list | `[]` | Exta environment properties to be passed on to the microservice runtime | | extraInitContainers | list | `[]` | Extra init containers that are executed before starting the main container | +| extraLabels | object | `{}` | Extra Labels | | extraPorts | list | `[]` | Extra Ports to be defined, note: these ports need to be created | | extraVolumeMounts | list | `[]` | Extra volume mounts | | extraVolumes | list | `[]` | Exta volumes that should be mounted. | @@ -141,7 +142,7 @@ helm install wm-msr webmethods/microservicesruntime \ | microservicesruntime.httpsPortScheme | string | `"HTTPS"` | Defines scheme of runtime port | | microservicesruntime.installDir | string | `"/opt/softwareag/IntegrationServer"` | Defines installation folder which was using on image creation | | microservicesruntime.javaCustomOpts | string | `nil` | list of custom java opts e.g. "-Dmy.prop1=value1" "-Dmy.prop2=value2" | -| microservicesruntime.licenseConfigMap | string | `"microservicesruntime-license-key"` | Name of config map which contains the license key | +| microservicesruntime.licenseConfigMap | string | `"microservicesruntime-license-key"` | Name of config map which contains the license key. If you ommit this, it defaults to the release name + microservicesruntime-license. | | microservicesruntime.memoryHeap.max | string | `"512M"` | Maximum of heap memory | | microservicesruntime.memoryHeap.min | string | `"512M"` | | | microservicesruntime.properties | object | `{}` | List of application properties which are added into config map in YAML format. See [Integration Server Configuration Variables](https://documentation.softwareag.com/webmethods/integration_server/pie10-15/webhelp/pie-webhelp/index.html#page/pie-webhelp%2Fre-configuration_variables_assets.html) | diff --git a/microservicesruntime/helm/templates/configmap.yaml b/microservicesruntime/helm/templates/configmap.yaml index 45a91ba..4b8633f 100644 --- a/microservicesruntime/helm/templates/configmap.yaml +++ b/microservicesruntime/helm/templates/configmap.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} data: applicationFile.properties: | diff --git a/microservicesruntime/helm/templates/deployment.yaml b/microservicesruntime/helm/templates/deployment.yaml index 1a494e6..1daac75 100644 --- a/microservicesruntime/helm/templates/deployment.yaml +++ b/microservicesruntime/helm/templates/deployment.yaml @@ -23,6 +23,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} @@ -42,6 +45,9 @@ spec: {{- include "common.prometheus.annotations" (dict "port" .Values.service.port) | nindent 8 }} labels: {{- include "common.labels.matchLabels" . | nindent 8 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/microservicesruntime/helm/templates/hpa.yaml b/microservicesruntime/helm/templates/hpa.yaml index 4ac4c13..fdec630 100644 --- a/microservicesruntime/helm/templates/hpa.yaml +++ b/microservicesruntime/helm/templates/hpa.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/microservicesruntime/helm/templates/ingress.yaml b/microservicesruntime/helm/templates/ingress.yaml index 29256fa..c40e74a 100644 --- a/microservicesruntime/helm/templates/ingress.yaml +++ b/microservicesruntime/helm/templates/ingress.yaml @@ -37,6 +37,9 @@ metadata: name: {{ $fullName }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/microservicesruntime/helm/templates/job.yaml b/microservicesruntime/helm/templates/job.yaml index 212dba2..b6ed50d 100644 --- a/microservicesruntime/helm/templates/job.yaml +++ b/microservicesruntime/helm/templates/job.yaml @@ -20,6 +20,7 @@ {{- $fullName := include "common.names.fullname" . -}} {{- $labels := include "common.labels.standard" . -}} {{- $imagePullSecrets := .Values.imagePullSecrets -}} +{{- $extraLabels := .Values.extraLabels -}} {{- $context := . }} {{- range $job := .Values.jobs }} @@ -30,6 +31,9 @@ metadata: name: {{ $fullName }}-{{ $job.name }} labels: {{- $labels | nindent 4 }} + {{- with $extraLabels }} + {{- toYaml $extraLabels | nindent 4 }} + {{- end }} {{- with $job.annotations }} annotations: {{ toYaml . | indent 4 }} @@ -43,6 +47,9 @@ spec: name: {{ $fullName }}-{{ $job.name }} labels: {{- $labels | nindent 12 }} + {{- with $extraLabels }} + {{- toYaml $extraLabels | nindent 12 }} + {{- end }} spec: {{- if hasKey $job "serviceAccount" }} {{- if hasKey $job.serviceAccount "name" }} @@ -124,6 +131,9 @@ spec: name: {{ $fullName }}-{{ $job.name }} labels: {{- $labels | nindent 8 }} + {{- with $extraLabels }} + {{- toYaml $extraLabels | nindent 8 }} + {{- end }} spec: {{- if hasKey $job "serviceAccount" }} {{- if hasKey $job.serviceAccount "name" }} diff --git a/microservicesruntime/helm/templates/license.yaml b/microservicesruntime/helm/templates/license.yaml index 4ad24f7..8da2674 100644 --- a/microservicesruntime/helm/templates/license.yaml +++ b/microservicesruntime/helm/templates/license.yaml @@ -25,6 +25,9 @@ metadata: name: {{ include "microservicesruntime.licenseConfigMapName" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} annotations: helm.sh/resource-policy: keep data: diff --git a/microservicesruntime/helm/templates/nginx-configmap.yaml b/microservicesruntime/helm/templates/nginx-configmap.yaml index 8d2ac28..9c75cc2 100644 --- a/microservicesruntime/helm/templates/nginx-configmap.yaml +++ b/microservicesruntime/helm/templates/nginx-configmap.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.fullname" . }}-nginx labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} data: nginx.conf: | diff --git a/microservicesruntime/helm/templates/nginx-deployment.yaml b/microservicesruntime/helm/templates/nginx-deployment.yaml index a7f4f47..0925f01 100644 --- a/microservicesruntime/helm/templates/nginx-deployment.yaml +++ b/microservicesruntime/helm/templates/nginx-deployment.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.fullname" . }}-nginx labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: replicas: 1 @@ -40,6 +43,9 @@ spec: creationTimestamp: null labels: {{- include "common.labels.standard" . | nindent 8 }}-nginx + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 8 }} + {{- end }} spec: containers: - name: nginx diff --git a/microservicesruntime/helm/templates/nginx-svc.yaml b/microservicesruntime/helm/templates/nginx-svc.yaml index 3dc4a69..0857f46 100644 --- a/microservicesruntime/helm/templates/nginx-svc.yaml +++ b/microservicesruntime/helm/templates/nginx-svc.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.fullname" . }}-nginx labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} diff --git a/microservicesruntime/helm/templates/pvc.yaml b/microservicesruntime/helm/templates/pvc.yaml index c814f3a..e8ea308 100644 --- a/microservicesruntime/helm/templates/pvc.yaml +++ b/microservicesruntime/helm/templates/pvc.yaml @@ -25,6 +25,9 @@ metadata: namespace: {{ .Release.Namespace | quote }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.persistence.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/microservicesruntime/helm/templates/service.yaml b/microservicesruntime/helm/templates/service.yaml index fd6a43a..d41ac60 100644 --- a/microservicesruntime/helm/templates/service.yaml +++ b/microservicesruntime/helm/templates/service.yaml @@ -23,6 +23,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/microservicesruntime/helm/templates/serviceaccount.yaml b/microservicesruntime/helm/templates/serviceaccount.yaml index 19ba6dd..ec1354c 100644 --- a/microservicesruntime/helm/templates/serviceaccount.yaml +++ b/microservicesruntime/helm/templates/serviceaccount.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.serviceAccountName" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/microservicesruntime/helm/templates/servicemonitor.yaml b/microservicesruntime/helm/templates/servicemonitor.yaml index 7cf7afa..3c4fd84 100644 --- a/microservicesruntime/helm/templates/servicemonitor.yaml +++ b/microservicesruntime/helm/templates/servicemonitor.yaml @@ -24,6 +24,9 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: endpoints: - targetPort: {{ .Values.microservicesruntime.adminPort }} diff --git a/microservicesruntime/helm/values.yaml b/microservicesruntime/helm/values.yaml index d68c83f..fc7c5df 100644 --- a/microservicesruntime/helm/values.yaml +++ b/microservicesruntime/helm/values.yaml @@ -29,6 +29,9 @@ fullnameOverride: "" # -- The name of the main container, by default this will be msr- containerName: +# -- Extra Labels +extraLabels: {} + # -- Exta volumes that should be mounted. extraVolumes: [] # - name: extras diff --git a/mywebmethodsserver/helm/README.md b/mywebmethodsserver/helm/README.md index 5f62e5e..eb3e7b7 100644 --- a/mywebmethodsserver/helm/README.md +++ b/mywebmethodsserver/helm/README.md @@ -52,6 +52,7 @@ helm install wm-mws microservicesruntime | extraContainers | string | `nil` | Extra containers which should run in addtion to the main container as a sidecar - name: do-something image: busybox command: ['do', 'something'] | | extraEnvs | object | `{}` | Exta environment properties to be passed on to the MyWebMethods Server | | extraInitContainers | list | `[]` | Extra init containers that are executed before starting the main container - name: do-something image: busybox command: ['do', 'something'] | +| extraLabels | object | `{}` | Extra Labels | | extraVolumeClaimTemplates | list | `[]` | Exta volumes that should be mounted. Example: - metadata: name: shared-volume spec: accessModes: ["ReadWriteMany"] storageClassName: nfs resources: requests: storage: 10 | | extraVolumeMounts | list | `[]` | Extra volume mounts - name: extras mountPath: /usr/share/extras readOnly: true | | fullnameOverride | string | `""` | Overwrites full workload name. As default, the workload name is release name + '-' + Chart name. | diff --git a/mywebmethodsserver/helm/templates/hpa.yaml b/mywebmethodsserver/helm/templates/hpa.yaml index 27272ca..ff8ddd0 100644 --- a/mywebmethodsserver/helm/templates/hpa.yaml +++ b/mywebmethodsserver/helm/templates/hpa.yaml @@ -23,6 +23,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: scaleTargetRef: apiVersion: apps/v1 diff --git a/mywebmethodsserver/helm/templates/ingress.yaml b/mywebmethodsserver/helm/templates/ingress.yaml index 43aba82..65f08cb 100644 --- a/mywebmethodsserver/helm/templates/ingress.yaml +++ b/mywebmethodsserver/helm/templates/ingress.yaml @@ -37,6 +37,9 @@ metadata: name: {{ $fullName }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/mywebmethodsserver/helm/templates/service.yaml b/mywebmethodsserver/helm/templates/service.yaml index 76cf6fa..6e65979 100644 --- a/mywebmethodsserver/helm/templates/service.yaml +++ b/mywebmethodsserver/helm/templates/service.yaml @@ -22,6 +22,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: type: {{ .Values.service.type }} ports: diff --git a/mywebmethodsserver/helm/templates/statefulset.yaml b/mywebmethodsserver/helm/templates/statefulset.yaml index 3e0a22c..6668d57 100644 --- a/mywebmethodsserver/helm/templates/statefulset.yaml +++ b/mywebmethodsserver/helm/templates/statefulset.yaml @@ -22,6 +22,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: {{- if not .Values.autoscaling.enabled }} replicas: {{ .Values.replicaCount }} @@ -39,6 +42,9 @@ spec: {{- end }} labels: {{- include "common.labels.matchLabels" . | nindent 8 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/mywebmethodsserver/helm/values.yaml b/mywebmethodsserver/helm/values.yaml index 14a9fce..f52dd56 100644 --- a/mywebmethodsserver/helm/values.yaml +++ b/mywebmethodsserver/helm/values.yaml @@ -19,6 +19,9 @@ fullnameOverride: "" serviceAccount: create: false +# -- Extra Labels for API Gateway +extraLabels: {} + # -- Exta environment properties to be passed on to the MyWebMethods Server extraEnvs: {} diff --git a/universalmessaging/helm/README.md b/universalmessaging/helm/README.md index 91c758d..71100b7 100644 --- a/universalmessaging/helm/README.md +++ b/universalmessaging/helm/README.md @@ -49,6 +49,7 @@ helm install um webmethods/universalmessaging | extraContainers | list | `[]` | Extra containers which should run in addition to the main container as a sidecar | | extraEnvs | object | `{}` | Exta environment properties to be passed on to the container | | extraInitContainers | list | `[]` | Extra init containers that are executed before starting the main container | +| extraLabels | object | `{}` | Extra Labels | | extraVolumeMounts | list | `[]` | Extra volume mounts | | extraVolumes | list | `[]` | Exta volumes that should be mounted. | | fullnameOverride | string | `""` | Overwrites full workload name. As default, the workload name is release name + '-' + Chart name. | diff --git a/universalmessaging/helm/templates/configmap.yaml b/universalmessaging/helm/templates/configmap.yaml index 94ea6f2..9edc1f5 100644 --- a/universalmessaging/helm/templates/configmap.yaml +++ b/universalmessaging/helm/templates/configmap.yaml @@ -23,6 +23,9 @@ metadata: name: {{ include "common.names.fullname" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} data: {{ if .Values.customServerConfig.content }} Custom_Server_Common.conf: | diff --git a/universalmessaging/helm/templates/ingress.yaml b/universalmessaging/helm/templates/ingress.yaml index 4180892..3ff2733 100644 --- a/universalmessaging/helm/templates/ingress.yaml +++ b/universalmessaging/helm/templates/ingress.yaml @@ -37,6 +37,9 @@ metadata: name: {{ $fullName }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.ingress.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/universalmessaging/helm/templates/job.yaml b/universalmessaging/helm/templates/job.yaml index 4b7c482..a021355 100644 --- a/universalmessaging/helm/templates/job.yaml +++ b/universalmessaging/helm/templates/job.yaml @@ -21,6 +21,7 @@ {{- $labels := include "common.labels.standard" . -}} {{- $imagePullSecrets := .Values.imagePullSecrets -}} {{- $replicaCount := .Values.replicaCount }} +{{- $extraLabels := .Values.extraLabels -}} {{- $context := . }} {{- range $job := .Values.jobs }} @@ -33,6 +34,9 @@ metadata: name: {{ $fullName }}-{{ $job.name }} labels: {{- $labels | nindent 4 }} + {{- with $extraLabels }} + {{- toYaml $extraLabels | nindent 4 }} + {{- end }} {{- with $job.annotations }} annotations: {{ toYaml . | indent 4 }} @@ -46,6 +50,9 @@ spec: name: {{ $fullName }}-{{ $job.name }} labels: {{- $labels | nindent 12 }} + {{- with $extraLabels }} + {{- toYaml $extraLabels | nindent 12 }} + {{- end }} spec: {{- if hasKey $job "serviceAccount" }} {{- if hasKey $job.serviceAccount "name" }} @@ -127,6 +134,9 @@ spec: name: {{ $fullName }}-{{ $job.name }} labels: {{- $labels | nindent 8 }} + {{- with $extraLabels }} + {{- toYaml $extraLabels | nindent 8 }} + {{- end }} spec: {{- if hasKey $job "serviceAccount" }} {{- if hasKey $job.serviceAccount "name" }} diff --git a/universalmessaging/helm/templates/service.yaml b/universalmessaging/helm/templates/service.yaml index e0f4168..b535f62 100644 --- a/universalmessaging/helm/templates/service.yaml +++ b/universalmessaging/helm/templates/service.yaml @@ -17,6 +17,7 @@ # * # */ +{{- $extraLabels := .Values.extraLabels -}} {{- range $replicaIndex := until (int .Values.replicaCount) }} --- apiVersion: v1 @@ -25,6 +26,9 @@ metadata: name: {{ include "common.names.fullname" $ }}-{{ $replicaIndex }} labels: {{- include "common.labels.standard" $ | nindent 4 }} + {{- with $extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: selector: statefulset.kubernetes.io/pod-name: {{ include "common.names.fullname" $ }}-{{ $replicaIndex }} diff --git a/universalmessaging/helm/templates/serviceaccount.yaml b/universalmessaging/helm/templates/serviceaccount.yaml index 19ba6dd..ec1354c 100644 --- a/universalmessaging/helm/templates/serviceaccount.yaml +++ b/universalmessaging/helm/templates/serviceaccount.yaml @@ -24,6 +24,9 @@ metadata: name: {{ include "common.names.serviceAccountName" . }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} {{- with .Values.serviceAccount.annotations }} annotations: {{- toYaml . | nindent 4 }} diff --git a/universalmessaging/helm/templates/statefulset.yaml b/universalmessaging/helm/templates/statefulset.yaml index 756c2c2..5719659 100644 --- a/universalmessaging/helm/templates/statefulset.yaml +++ b/universalmessaging/helm/templates/statefulset.yaml @@ -24,6 +24,9 @@ metadata: namespace: {{ .Release.Namespace }} labels: {{- include "common.labels.standard" . | nindent 4 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 4 }} + {{- end }} spec: replicas: {{ .Values.replicaCount }} serviceName: {{ include "common.names.fullname" . }} @@ -39,6 +42,9 @@ spec: {{- include "common.prometheus.annotations" (dict "port" .Values.service.metricPort) | nindent 8 }} labels: {{- include "common.labels.matchLabels" . | nindent 8 }} + {{- with .Values.extraLabels -}} + {{ toYaml . | nindent 8 }} + {{- end }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: diff --git a/universalmessaging/helm/values.yaml b/universalmessaging/helm/values.yaml index 0b782a4..841630f 100644 --- a/universalmessaging/helm/values.yaml +++ b/universalmessaging/helm/values.yaml @@ -21,6 +21,9 @@ licenseConfigMap: "universalmessaging-licence-key" imagePullSecrets: - name: regcred +# -- Extra Labels +extraLabels: {} + # -- Exta environment properties to be passed on to the container extraEnvs: {}