From f2226652a98d2041c72c057eed278838ff82e637 Mon Sep 17 00:00:00 2001 From: semihbkgr Date: Tue, 19 Sep 2023 10:11:55 +0300 Subject: [PATCH 1/6] common labels and annotations --- stable/hazelcast/templates/config.yaml | 9 +++++++++ stable/hazelcast/templates/mancenter-config.yaml | 9 +++++++++ stable/hazelcast/templates/mancenter-ingress.yaml | 11 ++++++++--- stable/hazelcast/templates/mancenter-service.yaml | 8 +++++++- stable/hazelcast/templates/mancenter-statefulset.yaml | 8 +++++++- stable/hazelcast/templates/metrics-service.yaml | 9 ++++++++- stable/hazelcast/templates/poddisruptionbudget.yaml | 9 +++++++++ stable/hazelcast/templates/prometheusrule.yaml | 8 +++++++- stable/hazelcast/templates/role.yaml | 9 +++++++++ stable/hazelcast/templates/rolebinding.yaml | 9 +++++++++ stable/hazelcast/templates/service-external.yaml | 10 ++++++---- stable/hazelcast/templates/service.yaml | 8 +++++++- stable/hazelcast/templates/serviceaccount.yaml | 9 +++++++++ stable/hazelcast/templates/servicemonitor.yaml | 8 +++++++- stable/hazelcast/templates/statefulset.yaml | 8 ++++---- stable/hazelcast/values.yaml | 6 ++++++ 16 files changed, 121 insertions(+), 17 deletions(-) diff --git a/stable/hazelcast/templates/config.yaml b/stable/hazelcast/templates/config.yaml index 9ae20385..d6cc9bb5 100644 --- a/stable/hazelcast/templates/config.yaml +++ b/stable/hazelcast/templates/config.yaml @@ -8,6 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} data: {{- range $key, $val := .Values.hazelcast.configurationFiles }} {{ $key }}: |- diff --git a/stable/hazelcast/templates/mancenter-config.yaml b/stable/hazelcast/templates/mancenter-config.yaml index 06c9ff7f..fbb3c4ad 100644 --- a/stable/hazelcast/templates/mancenter-config.yaml +++ b/stable/hazelcast/templates/mancenter-config.yaml @@ -8,6 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} data: hazelcast-client.yaml: |- {{ toYaml .Values.mancenter.yaml | indent 4 }} diff --git a/stable/hazelcast/templates/mancenter-ingress.yaml b/stable/hazelcast/templates/mancenter-ingress.yaml index 204a8096..c0aeefc6 100644 --- a/stable/hazelcast/templates/mancenter-ingress.yaml +++ b/stable/hazelcast/templates/mancenter-ingress.yaml @@ -8,10 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" -{{- with .Values.mancenter.ingress.annotations }} + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if or .Values.mancenter.ingress.annotations .Values.commonAnnotations }} annotations: - {{- toYaml . | nindent 4 }} -{{- end }} + {{- range $key, $val := (merge .Values.mancenter.ingress.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: ingressClassName: {{ .Values.mancenter.ingress.className }} {{- if .Values.mancenter.ingress.tls }} diff --git a/stable/hazelcast/templates/mancenter-service.yaml b/stable/hazelcast/templates/mancenter-service.yaml index 2d458363..2a493f0c 100644 --- a/stable/hazelcast/templates/mancenter-service.yaml +++ b/stable/hazelcast/templates/mancenter-service.yaml @@ -12,9 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.mancenter.service.labels }} + {{- range $key, $value := (merge .Values.mancenter.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.mancenter.service.type }} {{- if .Values.mancenter.service.clusterIP }} diff --git a/stable/hazelcast/templates/mancenter-statefulset.yaml b/stable/hazelcast/templates/mancenter-statefulset.yaml index 4d20e256..903bc556 100644 --- a/stable/hazelcast/templates/mancenter-statefulset.yaml +++ b/stable/hazelcast/templates/mancenter-statefulset.yaml @@ -8,9 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.mancenter.labels }} + {{- range $key, $value := (merge .Values.mancenter.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: serviceName: {{ template "mancenter.fullname" . }} replicas: 1 diff --git a/stable/hazelcast/templates/metrics-service.yaml b/stable/hazelcast/templates/metrics-service.yaml index 2a760f8a..4ebf1bde 100644 --- a/stable/hazelcast/templates/metrics-service.yaml +++ b/stable/hazelcast/templates/metrics-service.yaml @@ -10,8 +10,15 @@ metadata: app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" app.kubernetes.io/component: metrics + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} annotations: -{{ toYaml .Values.metrics.service.annotations | indent 4 }} + {{- range $key, $val := (merge .Values.metrics.service.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.metrics.service.type }} {{- if (and (eq .Values.metrics.service.type "LoadBalancer") (.Values.metrics.service.loadBalancerIP)) }} diff --git a/stable/hazelcast/templates/poddisruptionbudget.yaml b/stable/hazelcast/templates/poddisruptionbudget.yaml index dee8e45a..523a0001 100644 --- a/stable/hazelcast/templates/poddisruptionbudget.yaml +++ b/stable/hazelcast/templates/poddisruptionbudget.yaml @@ -8,6 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: {{ toYaml .Values.podDisruptionBudget | indent 2 }} selector: diff --git a/stable/hazelcast/templates/prometheusrule.yaml b/stable/hazelcast/templates/prometheusrule.yaml index ec4bb455..ae6a9b2c 100644 --- a/stable/hazelcast/templates/prometheusrule.yaml +++ b/stable/hazelcast/templates/prometheusrule.yaml @@ -9,9 +9,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := .Values.metrics.prometheusRule.labels }} + {{- range $key, $val := (merge .Values.metrics.prometheusRule.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: groups: - name: {{ template "hazelcast.name" . }} diff --git a/stable/hazelcast/templates/role.yaml b/stable/hazelcast/templates/role.yaml index dc9d09b2..40ed5f08 100644 --- a/stable/hazelcast/templates/role.yaml +++ b/stable/hazelcast/templates/role.yaml @@ -12,6 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} rules: - apiGroups: - "" diff --git a/stable/hazelcast/templates/rolebinding.yaml b/stable/hazelcast/templates/rolebinding.yaml index dd347fe2..3d404f98 100644 --- a/stable/hazelcast/templates/rolebinding.yaml +++ b/stable/hazelcast/templates/rolebinding.yaml @@ -12,6 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io {{- if .Values.rbac.useClusterRole }} diff --git a/stable/hazelcast/templates/service-external.yaml b/stable/hazelcast/templates/service-external.yaml index ba7e9c2e..48a9a76e 100644 --- a/stable/hazelcast/templates/service-external.yaml +++ b/stable/hazelcast/templates/service-external.yaml @@ -12,13 +12,15 @@ metadata: app.kubernetes.io/instance: "{{ $.Release.Name }}" app.kubernetes.io/managed-by: "{{ $.Release.Service }}" pod: {{ $targetPod }} - {{- range $key, $value := $.Values.externalAccess.service.labels }} + {{- range $key, $value := (merge .Values.externalAccess.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} -{{- with $.Values.externalAccess.service.annotations }} + {{- if or .Values.externalAccess.service.annotations .Values.commonAnnotations }} annotations: - {{- toYaml . | nindent 4 }} -{{- end }} + {{- range $key, $val := (merge .Values.externalAccess.service.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ $.Values.externalAccess.service.type }} {{- if $.Values.externalAccess.service.loadBalancerIPs }} diff --git a/stable/hazelcast/templates/service.yaml b/stable/hazelcast/templates/service.yaml index 99d80559..db6ca463 100644 --- a/stable/hazelcast/templates/service.yaml +++ b/stable/hazelcast/templates/service.yaml @@ -12,9 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.service.labels }} + {{- range $key, $value := (merge .Values.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.service.type }} {{- if (and (eq .Values.service.type "ClusterIP") (.Values.service.clusterIP)) }} diff --git a/stable/hazelcast/templates/serviceaccount.yaml b/stable/hazelcast/templates/serviceaccount.yaml index 2d2cfdd4..65c74329 100644 --- a/stable/hazelcast/templates/serviceaccount.yaml +++ b/stable/hazelcast/templates/serviceaccount.yaml @@ -8,4 +8,13 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} {{- end -}} diff --git a/stable/hazelcast/templates/servicemonitor.yaml b/stable/hazelcast/templates/servicemonitor.yaml index 5e6c8d40..7b6bc8fe 100644 --- a/stable/hazelcast/templates/servicemonitor.yaml +++ b/stable/hazelcast/templates/servicemonitor.yaml @@ -9,9 +9,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := .Values.metrics.serviceMonitor.labels }} + {{- range $key, $val := (merge .Values.metrics.serviceMonitor.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: endpoints: - port: {{ .Values.metrics.service.portName }} diff --git a/stable/hazelcast/templates/statefulset.yaml b/stable/hazelcast/templates/statefulset.yaml index 0cfe26d2..8dcaaed8 100644 --- a/stable/hazelcast/templates/statefulset.yaml +++ b/stable/hazelcast/templates/statefulset.yaml @@ -8,15 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.labels }} + {{- range $key, $value := (merge .Values.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} - {{- if .Values.annotations }} + {{- if or .Values.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := .Values.annotations }} + {{- range $key, $val := (merge .Values.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} - {{- end }} + {{- end }} spec: serviceName: {{ template "hazelcast.fullname" . }} replicas: {{ .Values.cluster.memberCount }} diff --git a/stable/hazelcast/values.yaml b/stable/hazelcast/values.yaml index 245345a5..709b7832 100644 --- a/stable/hazelcast/values.yaml +++ b/stable/hazelcast/values.yaml @@ -25,6 +25,12 @@ cluster: # memberCount is the number Hazelcast members memberCount: 3 +# Labels to add to all deployed objects +commonLabels: {} + +# Annotations to add to all deployed objects +commonAnnotations: {} + # Hazelcast properties hazelcast: # enabled is a flag to enable Hazelcast application From 63f70b4354905156849d662f64d8207a1df9fa84 Mon Sep 17 00:00:00 2001 From: semihbkgr Date: Tue, 19 Sep 2023 10:24:49 +0300 Subject: [PATCH 2/6] apply the same changes on enterprise chart --- stable/hazelcast-enterprise/templates/config.yaml | 9 +++++++++ .../templates/mancenter-config.yaml | 9 +++++++++ .../templates/mancenter-ingress.yaml | 11 ++++++++--- .../templates/mancenter-service.yaml | 8 +++++++- .../templates/mancenter-statefulset.yaml | 8 +++++++- .../templates/metrics-service.yaml | 9 ++++++++- .../templates/poddisruptionbudget.yaml | 9 +++++++++ .../templates/prometheusrule.yaml | 8 +++++++- stable/hazelcast-enterprise/templates/role.yaml | 9 +++++++++ .../hazelcast-enterprise/templates/rolebinding.yaml | 9 +++++++++ .../templates/service-external.yaml | 10 ++++++---- stable/hazelcast-enterprise/templates/service.yaml | 8 +++++++- .../templates/serviceaccount.yaml | 9 +++++++++ .../templates/servicemonitor.yaml | 8 +++++++- .../hazelcast-enterprise/templates/statefulset.yaml | 6 +++--- stable/hazelcast-enterprise/values.yaml | 6 ++++++ 16 files changed, 120 insertions(+), 16 deletions(-) diff --git a/stable/hazelcast-enterprise/templates/config.yaml b/stable/hazelcast-enterprise/templates/config.yaml index 9ae20385..d6cc9bb5 100644 --- a/stable/hazelcast-enterprise/templates/config.yaml +++ b/stable/hazelcast-enterprise/templates/config.yaml @@ -8,6 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} data: {{- range $key, $val := .Values.hazelcast.configurationFiles }} {{ $key }}: |- diff --git a/stable/hazelcast-enterprise/templates/mancenter-config.yaml b/stable/hazelcast-enterprise/templates/mancenter-config.yaml index 06c9ff7f..fbb3c4ad 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-config.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-config.yaml @@ -8,6 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} data: hazelcast-client.yaml: |- {{ toYaml .Values.mancenter.yaml | indent 4 }} diff --git a/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml b/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml index 204a8096..c0aeefc6 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml @@ -8,10 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" -{{- with .Values.mancenter.ingress.annotations }} + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if or .Values.mancenter.ingress.annotations .Values.commonAnnotations }} annotations: - {{- toYaml . | nindent 4 }} -{{- end }} + {{- range $key, $val := (merge .Values.mancenter.ingress.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: ingressClassName: {{ .Values.mancenter.ingress.className }} {{- if .Values.mancenter.ingress.tls }} diff --git a/stable/hazelcast-enterprise/templates/mancenter-service.yaml b/stable/hazelcast-enterprise/templates/mancenter-service.yaml index 2d458363..2a493f0c 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-service.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-service.yaml @@ -12,9 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.mancenter.service.labels }} + {{- range $key, $value := (merge .Values.mancenter.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.mancenter.service.type }} {{- if .Values.mancenter.service.clusterIP }} diff --git a/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml b/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml index 9ccba590..0b5253e9 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml @@ -8,9 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.mancenter.labels }} + {{- range $key, $value := (merge .Values.mancenter.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: serviceName: {{ template "mancenter.fullname" . }} replicas: 1 diff --git a/stable/hazelcast-enterprise/templates/metrics-service.yaml b/stable/hazelcast-enterprise/templates/metrics-service.yaml index 2a760f8a..4ebf1bde 100644 --- a/stable/hazelcast-enterprise/templates/metrics-service.yaml +++ b/stable/hazelcast-enterprise/templates/metrics-service.yaml @@ -10,8 +10,15 @@ metadata: app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" app.kubernetes.io/component: metrics + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} annotations: -{{ toYaml .Values.metrics.service.annotations | indent 4 }} + {{- range $key, $val := (merge .Values.metrics.service.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.metrics.service.type }} {{- if (and (eq .Values.metrics.service.type "LoadBalancer") (.Values.metrics.service.loadBalancerIP)) }} diff --git a/stable/hazelcast-enterprise/templates/poddisruptionbudget.yaml b/stable/hazelcast-enterprise/templates/poddisruptionbudget.yaml index dee8e45a..523a0001 100644 --- a/stable/hazelcast-enterprise/templates/poddisruptionbudget.yaml +++ b/stable/hazelcast-enterprise/templates/poddisruptionbudget.yaml @@ -8,6 +8,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: {{ toYaml .Values.podDisruptionBudget | indent 2 }} selector: diff --git a/stable/hazelcast-enterprise/templates/prometheusrule.yaml b/stable/hazelcast-enterprise/templates/prometheusrule.yaml index ec4bb455..ae6a9b2c 100644 --- a/stable/hazelcast-enterprise/templates/prometheusrule.yaml +++ b/stable/hazelcast-enterprise/templates/prometheusrule.yaml @@ -9,9 +9,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := .Values.metrics.prometheusRule.labels }} + {{- range $key, $val := (merge .Values.metrics.prometheusRule.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: groups: - name: {{ template "hazelcast.name" . }} diff --git a/stable/hazelcast-enterprise/templates/role.yaml b/stable/hazelcast-enterprise/templates/role.yaml index 962ae812..673b1b70 100644 --- a/stable/hazelcast-enterprise/templates/role.yaml +++ b/stable/hazelcast-enterprise/templates/role.yaml @@ -12,6 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} rules: - apiGroups: - "" diff --git a/stable/hazelcast-enterprise/templates/rolebinding.yaml b/stable/hazelcast-enterprise/templates/rolebinding.yaml index dd347fe2..3d404f98 100644 --- a/stable/hazelcast-enterprise/templates/rolebinding.yaml +++ b/stable/hazelcast-enterprise/templates/rolebinding.yaml @@ -12,6 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} roleRef: apiGroup: rbac.authorization.k8s.io {{- if .Values.rbac.useClusterRole }} diff --git a/stable/hazelcast-enterprise/templates/service-external.yaml b/stable/hazelcast-enterprise/templates/service-external.yaml index ba7e9c2e..48a9a76e 100644 --- a/stable/hazelcast-enterprise/templates/service-external.yaml +++ b/stable/hazelcast-enterprise/templates/service-external.yaml @@ -12,13 +12,15 @@ metadata: app.kubernetes.io/instance: "{{ $.Release.Name }}" app.kubernetes.io/managed-by: "{{ $.Release.Service }}" pod: {{ $targetPod }} - {{- range $key, $value := $.Values.externalAccess.service.labels }} + {{- range $key, $value := (merge .Values.externalAccess.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} -{{- with $.Values.externalAccess.service.annotations }} + {{- if or .Values.externalAccess.service.annotations .Values.commonAnnotations }} annotations: - {{- toYaml . | nindent 4 }} -{{- end }} + {{- range $key, $val := (merge .Values.externalAccess.service.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ $.Values.externalAccess.service.type }} {{- if $.Values.externalAccess.service.loadBalancerIPs }} diff --git a/stable/hazelcast-enterprise/templates/service.yaml b/stable/hazelcast-enterprise/templates/service.yaml index 99d80559..db6ca463 100644 --- a/stable/hazelcast-enterprise/templates/service.yaml +++ b/stable/hazelcast-enterprise/templates/service.yaml @@ -12,9 +12,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.service.labels }} + {{- range $key, $value := (merge .Values.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: type: {{ .Values.service.type }} {{- if (and (eq .Values.service.type "ClusterIP") (.Values.service.clusterIP)) }} diff --git a/stable/hazelcast-enterprise/templates/serviceaccount.yaml b/stable/hazelcast-enterprise/templates/serviceaccount.yaml index 2d2cfdd4..65c74329 100644 --- a/stable/hazelcast-enterprise/templates/serviceaccount.yaml +++ b/stable/hazelcast-enterprise/templates/serviceaccount.yaml @@ -8,4 +8,13 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} {{- end -}} diff --git a/stable/hazelcast-enterprise/templates/servicemonitor.yaml b/stable/hazelcast-enterprise/templates/servicemonitor.yaml index 5e6c8d40..7b6bc8fe 100644 --- a/stable/hazelcast-enterprise/templates/servicemonitor.yaml +++ b/stable/hazelcast-enterprise/templates/servicemonitor.yaml @@ -9,9 +9,15 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := .Values.metrics.serviceMonitor.labels }} + {{- range $key, $val := (merge .Values.metrics.serviceMonitor.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: endpoints: - port: {{ .Values.metrics.service.portName }} diff --git a/stable/hazelcast-enterprise/templates/statefulset.yaml b/stable/hazelcast-enterprise/templates/statefulset.yaml index fb019a67..68248b29 100644 --- a/stable/hazelcast-enterprise/templates/statefulset.yaml +++ b/stable/hazelcast-enterprise/templates/statefulset.yaml @@ -8,12 +8,12 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := .Values.labels }} + {{- range $key, $value := (merge .Values.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} - {{- if .Values.annotations }} + {{- if or .Values.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := .Values.annotations }} + {{- range $key, $val := (merge .Values.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast-enterprise/values.yaml b/stable/hazelcast-enterprise/values.yaml index b6985af4..95663f48 100644 --- a/stable/hazelcast-enterprise/values.yaml +++ b/stable/hazelcast-enterprise/values.yaml @@ -25,6 +25,12 @@ cluster: # memberCount is the number Hazelcast members memberCount: 3 +# Labels to add to all deployed objects +commonLabels: {} + +# Annotations to add to all deployed objects +commonAnnotations: {} + # Hazelcast properties hazelcast: # enabled is a flag to enable Hazelcast application From adfffc342e88b794c233a34b012e2bc56a0238b5 Mon Sep 17 00:00:00 2001 From: semihbkgr Date: Tue, 19 Sep 2023 10:25:15 +0300 Subject: [PATCH 3/6] bump chart versions --- stable/hazelcast-enterprise/Chart.yaml | 2 +- stable/hazelcast/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/hazelcast-enterprise/Chart.yaml b/stable/hazelcast-enterprise/Chart.yaml index 1ae3456b..df2b1a97 100644 --- a/stable/hazelcast-enterprise/Chart.yaml +++ b/stable/hazelcast-enterprise/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: hazelcast-enterprise -version: 5.10.5 +version: 5.10.6 appVersion: "5.3.2" kubeVersion: ">=1.19.0-0" description: Hazelcast is a streaming and memory-first application platform for fast, stateful, data-intensive workloads on-premises, at the edge or as a fully managed cloud service. diff --git a/stable/hazelcast/Chart.yaml b/stable/hazelcast/Chart.yaml index c96e0a39..89609f18 100644 --- a/stable/hazelcast/Chart.yaml +++ b/stable/hazelcast/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: hazelcast -version: 5.8.6 +version: 5.8.7 appVersion: "5.3.2" kubeVersion: ">=1.19.0-0" description: Hazelcast is a streaming and memory-first application platform for fast, stateful, data-intensive workloads on-premises, at the edge or as a fully managed cloud service. From 10e45d14a753dd17eb11ed0ef7790ee277b74ee2 Mon Sep 17 00:00:00 2001 From: semihbkgr Date: Tue, 19 Sep 2023 11:46:19 +0300 Subject: [PATCH 4/6] set merge destination map to nil --- stable/hazelcast-enterprise/templates/mancenter-ingress.yaml | 2 +- stable/hazelcast-enterprise/templates/mancenter-service.yaml | 2 +- .../hazelcast-enterprise/templates/mancenter-statefulset.yaml | 2 +- stable/hazelcast-enterprise/templates/metrics-service.yaml | 2 +- stable/hazelcast-enterprise/templates/prometheusrule.yaml | 2 +- stable/hazelcast-enterprise/templates/service-external.yaml | 4 ++-- stable/hazelcast-enterprise/templates/service.yaml | 2 +- stable/hazelcast-enterprise/templates/servicemonitor.yaml | 2 +- stable/hazelcast-enterprise/templates/statefulset.yaml | 4 ++-- stable/hazelcast/templates/mancenter-ingress.yaml | 2 +- stable/hazelcast/templates/mancenter-service.yaml | 2 +- stable/hazelcast/templates/mancenter-statefulset.yaml | 2 +- stable/hazelcast/templates/metrics-service.yaml | 2 +- stable/hazelcast/templates/prometheusrule.yaml | 2 +- stable/hazelcast/templates/service-external.yaml | 4 ++-- stable/hazelcast/templates/service.yaml | 2 +- stable/hazelcast/templates/servicemonitor.yaml | 2 +- stable/hazelcast/templates/statefulset.yaml | 4 ++-- 18 files changed, 22 insertions(+), 22 deletions(-) diff --git a/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml b/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml index c0aeefc6..0068e42f 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-ingress.yaml @@ -13,7 +13,7 @@ metadata: {{- end }} {{- if or .Values.mancenter.ingress.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.mancenter.ingress.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.mancenter.ingress.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast-enterprise/templates/mancenter-service.yaml b/stable/hazelcast-enterprise/templates/mancenter-service.yaml index 2a493f0c..de504381 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-service.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-service.yaml @@ -12,7 +12,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.mancenter.service.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.mancenter.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml b/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml index 0b5253e9..a87f9f08 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml @@ -8,7 +8,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.mancenter.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.mancenter.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast-enterprise/templates/metrics-service.yaml b/stable/hazelcast-enterprise/templates/metrics-service.yaml index 4ebf1bde..0dabad40 100644 --- a/stable/hazelcast-enterprise/templates/metrics-service.yaml +++ b/stable/hazelcast-enterprise/templates/metrics-service.yaml @@ -15,7 +15,7 @@ metadata: {{- end }} {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.metrics.service.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.metrics.service.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast-enterprise/templates/prometheusrule.yaml b/stable/hazelcast-enterprise/templates/prometheusrule.yaml index ae6a9b2c..8319e161 100644 --- a/stable/hazelcast-enterprise/templates/prometheusrule.yaml +++ b/stable/hazelcast-enterprise/templates/prometheusrule.yaml @@ -9,7 +9,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := (merge .Values.metrics.prometheusRule.labels .Values.commonLabels) }} + {{- range $key, $val := (merge nil .Values.metrics.prometheusRule.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast-enterprise/templates/service-external.yaml b/stable/hazelcast-enterprise/templates/service-external.yaml index 48a9a76e..56a4bc16 100644 --- a/stable/hazelcast-enterprise/templates/service-external.yaml +++ b/stable/hazelcast-enterprise/templates/service-external.yaml @@ -12,12 +12,12 @@ metadata: app.kubernetes.io/instance: "{{ $.Release.Name }}" app.kubernetes.io/managed-by: "{{ $.Release.Service }}" pod: {{ $targetPod }} - {{- range $key, $value := (merge .Values.externalAccess.service.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.externalAccess.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if or .Values.externalAccess.service.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.externalAccess.service.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.externalAccess.service.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast-enterprise/templates/service.yaml b/stable/hazelcast-enterprise/templates/service.yaml index db6ca463..71ea8f7f 100644 --- a/stable/hazelcast-enterprise/templates/service.yaml +++ b/stable/hazelcast-enterprise/templates/service.yaml @@ -12,7 +12,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.service.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast-enterprise/templates/servicemonitor.yaml b/stable/hazelcast-enterprise/templates/servicemonitor.yaml index 7b6bc8fe..ac1677c3 100644 --- a/stable/hazelcast-enterprise/templates/servicemonitor.yaml +++ b/stable/hazelcast-enterprise/templates/servicemonitor.yaml @@ -9,7 +9,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := (merge .Values.metrics.serviceMonitor.labels .Values.commonLabels) }} + {{- range $key, $val := (merge nil .Values.metrics.serviceMonitor.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast-enterprise/templates/statefulset.yaml b/stable/hazelcast-enterprise/templates/statefulset.yaml index 68248b29..ac24a4fd 100644 --- a/stable/hazelcast-enterprise/templates/statefulset.yaml +++ b/stable/hazelcast-enterprise/templates/statefulset.yaml @@ -8,12 +8,12 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if or .Values.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast/templates/mancenter-ingress.yaml b/stable/hazelcast/templates/mancenter-ingress.yaml index c0aeefc6..0068e42f 100644 --- a/stable/hazelcast/templates/mancenter-ingress.yaml +++ b/stable/hazelcast/templates/mancenter-ingress.yaml @@ -13,7 +13,7 @@ metadata: {{- end }} {{- if or .Values.mancenter.ingress.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.mancenter.ingress.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.mancenter.ingress.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast/templates/mancenter-service.yaml b/stable/hazelcast/templates/mancenter-service.yaml index 2a493f0c..de504381 100644 --- a/stable/hazelcast/templates/mancenter-service.yaml +++ b/stable/hazelcast/templates/mancenter-service.yaml @@ -12,7 +12,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.mancenter.service.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.mancenter.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast/templates/mancenter-statefulset.yaml b/stable/hazelcast/templates/mancenter-statefulset.yaml index 903bc556..883e445a 100644 --- a/stable/hazelcast/templates/mancenter-statefulset.yaml +++ b/stable/hazelcast/templates/mancenter-statefulset.yaml @@ -8,7 +8,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.mancenter.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.mancenter.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast/templates/metrics-service.yaml b/stable/hazelcast/templates/metrics-service.yaml index 4ebf1bde..0dabad40 100644 --- a/stable/hazelcast/templates/metrics-service.yaml +++ b/stable/hazelcast/templates/metrics-service.yaml @@ -15,7 +15,7 @@ metadata: {{- end }} {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.metrics.service.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.metrics.service.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast/templates/prometheusrule.yaml b/stable/hazelcast/templates/prometheusrule.yaml index ae6a9b2c..8319e161 100644 --- a/stable/hazelcast/templates/prometheusrule.yaml +++ b/stable/hazelcast/templates/prometheusrule.yaml @@ -9,7 +9,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := (merge .Values.metrics.prometheusRule.labels .Values.commonLabels) }} + {{- range $key, $val := (merge nil .Values.metrics.prometheusRule.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast/templates/service-external.yaml b/stable/hazelcast/templates/service-external.yaml index 48a9a76e..56a4bc16 100644 --- a/stable/hazelcast/templates/service-external.yaml +++ b/stable/hazelcast/templates/service-external.yaml @@ -12,12 +12,12 @@ metadata: app.kubernetes.io/instance: "{{ $.Release.Name }}" app.kubernetes.io/managed-by: "{{ $.Release.Service }}" pod: {{ $targetPod }} - {{- range $key, $value := (merge .Values.externalAccess.service.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.externalAccess.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if or .Values.externalAccess.service.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.externalAccess.service.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.externalAccess.service.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} diff --git a/stable/hazelcast/templates/service.yaml b/stable/hazelcast/templates/service.yaml index db6ca463..71ea8f7f 100644 --- a/stable/hazelcast/templates/service.yaml +++ b/stable/hazelcast/templates/service.yaml @@ -12,7 +12,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.service.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.service.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast/templates/servicemonitor.yaml b/stable/hazelcast/templates/servicemonitor.yaml index 7b6bc8fe..ac1677c3 100644 --- a/stable/hazelcast/templates/servicemonitor.yaml +++ b/stable/hazelcast/templates/servicemonitor.yaml @@ -9,7 +9,7 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $val := (merge .Values.metrics.serviceMonitor.labels .Values.commonLabels) }} + {{- range $key, $val := (merge nil .Values.metrics.serviceMonitor.labels .Values.commonLabels) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- if .Values.commonAnnotations }} diff --git a/stable/hazelcast/templates/statefulset.yaml b/stable/hazelcast/templates/statefulset.yaml index 8dcaaed8..160bbec5 100644 --- a/stable/hazelcast/templates/statefulset.yaml +++ b/stable/hazelcast/templates/statefulset.yaml @@ -8,12 +8,12 @@ metadata: helm.sh/chart: {{ template "hazelcast.chart" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" - {{- range $key, $value := (merge .Values.labels .Values.commonLabels) }} + {{- range $key, $value := (merge nil .Values.labels .Values.commonLabels) }} {{ $key }}: {{ $value | quote }} {{- end }} {{- if or .Values.annotations .Values.commonAnnotations }} annotations: - {{- range $key, $val := (merge .Values.annotations .Values.commonAnnotations) }} + {{- range $key, $val := (merge nil .Values.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} {{- end }} From 24026eb267d04484a25a734c5d4974f05274f73e Mon Sep 17 00:00:00 2001 From: semihbkgr Date: Tue, 19 Sep 2023 13:19:05 +0300 Subject: [PATCH 5/6] common labels and annotations under template definitions --- .../templates/mancenter-statefulset.yaml | 21 +++++++++++++++---- .../templates/statefulset.yaml | 19 +++++++++++++---- .../templates/mancenter-statefulset.yaml | 21 +++++++++++++++---- stable/hazelcast/templates/statefulset.yaml | 8 ++++--- 4 files changed, 54 insertions(+), 15 deletions(-) diff --git a/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml b/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml index a87f9f08..ff8b1f8f 100644 --- a/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml +++ b/stable/hazelcast-enterprise/templates/mancenter-statefulset.yaml @@ -33,12 +33,16 @@ spec: app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" role: mancenter - {{- if .Values.mancenter.podLabels }} -{{ toYaml .Values.mancenter.podLabels | indent 8 }} + {{- if or .Values.mancenter.podLabels .Values.commonLabels }} + {{- range $key, $val := (merge nil .Values.mancenter.podLabels .Values.commonLabels) }} + {{ $key }}: {{ $val | quote }} {{- end }} - {{- if .Values.mancenter.annotations }} + {{- end }} + {{- if or .Values.mancenter.annotations .Values.commonAnnotations }} annotations: -{{ toYaml .Values.mancenter.annotations | indent 8 }} + {{- range $key, $val := (merge nil .Values.mancenter.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} {{- end }} spec: {{- if .Values.mancenter.image.pullSecrets }} @@ -235,6 +239,15 @@ spec: app.kubernetes.io/name: {{ template "mancenter.name" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: accessModes: {{- range .Values.mancenter.persistence.accessModes }} diff --git a/stable/hazelcast-enterprise/templates/statefulset.yaml b/stable/hazelcast-enterprise/templates/statefulset.yaml index ac24a4fd..499be450 100644 --- a/stable/hazelcast-enterprise/templates/statefulset.yaml +++ b/stable/hazelcast-enterprise/templates/statefulset.yaml @@ -33,12 +33,14 @@ spec: app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" role: hazelcast - {{- if .Values.podLabels }} -{{ toYaml .Values.podLabels | indent 8 }} - {{- end }} + {{- if or .Values.podLabels .Values.commonLabels }} + {{- range $key, $val := (merge nil .Values.podLabels .Values.commonLabels) }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} annotations: checksum/hazelcast-config: {{ toYaml .Values.hazelcast.yaml | sha256sum }} - {{- range $key, $val := .Values.annotations }} + {{- range $key, $val := (merge nil .Values.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} spec: @@ -241,6 +243,15 @@ spec: app.kubernetes.io/name: {{ template "hazelcast.name" . }} app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: accessModes: {{- range .Values.persistence.accessModes }} diff --git a/stable/hazelcast/templates/mancenter-statefulset.yaml b/stable/hazelcast/templates/mancenter-statefulset.yaml index 883e445a..775eca35 100644 --- a/stable/hazelcast/templates/mancenter-statefulset.yaml +++ b/stable/hazelcast/templates/mancenter-statefulset.yaml @@ -33,12 +33,16 @@ spec: app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" role: mancenter - {{- if .Values.mancenter.podLabels }} -{{ toYaml .Values.mancenter.podLabels | indent 8 }} + {{- if or .Values.mancenter.podLabels .Values.commonLabels }} + {{- range $key, $val := (merge nil .Values.mancenter.podLabels .Values.commonLabels) }} + {{ $key }}: {{ $val | quote }} {{- end }} - {{- if .Values.mancenter.annotations }} + {{- end }} + {{- if or .Values.mancenter.annotations .Values.commonAnnotations }} annotations: -{{ toYaml .Values.mancenter.annotations | indent 8 }} + {{- range $key, $val := (merge nil .Values.mancenter.annotations .Values.commonAnnotations) }} + {{ $key }}: {{ $val | quote }} + {{- end }} {{- end }} spec: {{- if .Values.mancenter.image.pullSecrets }} @@ -226,6 +230,15 @@ spec: helm.sh/chart: "{{ .Chart.Name }}" app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" + {{- range $key, $value := .Values.commonLabels }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- if .Values.commonAnnotations }} + annotations: + {{- range $key, $val := .Values.commonAnnotations }} + {{ $key }}: {{ $val | quote }} + {{- end }} + {{- end }} spec: accessModes: {{- range .Values.mancenter.persistence.accessModes }} diff --git a/stable/hazelcast/templates/statefulset.yaml b/stable/hazelcast/templates/statefulset.yaml index 160bbec5..f800490a 100644 --- a/stable/hazelcast/templates/statefulset.yaml +++ b/stable/hazelcast/templates/statefulset.yaml @@ -33,12 +33,14 @@ spec: app.kubernetes.io/instance: "{{ .Release.Name }}" app.kubernetes.io/managed-by: "{{ .Release.Service }}" role: hazelcast - {{- if .Values.podLabels }} -{{ toYaml .Values.podLabels | indent 8 }} + {{- if or .Values.podLabels .Values.commonLabels }} + {{- range $key, $val := (merge nil .Values.podLabels .Values.commonLabels) }} + {{ $key }}: {{ $val | quote }} + {{- end }} {{- end }} annotations: checksum/hazelcast-config: {{ toYaml .Values.hazelcast.yaml | sha256sum }} - {{- range $key, $val := .Values.annotations }} + {{- range $key, $val := (merge nil .Values.annotations .Values.commonAnnotations) }} {{ $key }}: {{ $val | quote }} {{- end }} spec: From 86f07c203b656680652a428e79e5c3078e91849c Mon Sep 17 00:00:00 2001 From: semihbkgr Date: Tue, 17 Oct 2023 16:20:08 +0300 Subject: [PATCH 6/6] bump chart versions --- stable/hazelcast-enterprise/Chart.yaml | 2 +- stable/hazelcast/Chart.yaml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stable/hazelcast-enterprise/Chart.yaml b/stable/hazelcast-enterprise/Chart.yaml index df2b1a97..a359b230 100644 --- a/stable/hazelcast-enterprise/Chart.yaml +++ b/stable/hazelcast-enterprise/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: hazelcast-enterprise -version: 5.10.6 +version: 5.10.7 appVersion: "5.3.2" kubeVersion: ">=1.19.0-0" description: Hazelcast is a streaming and memory-first application platform for fast, stateful, data-intensive workloads on-premises, at the edge or as a fully managed cloud service. diff --git a/stable/hazelcast/Chart.yaml b/stable/hazelcast/Chart.yaml index 89609f18..720d5fa0 100644 --- a/stable/hazelcast/Chart.yaml +++ b/stable/hazelcast/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: hazelcast -version: 5.8.7 +version: 5.8.8 appVersion: "5.3.2" kubeVersion: ">=1.19.0-0" description: Hazelcast is a streaming and memory-first application platform for fast, stateful, data-intensive workloads on-premises, at the edge or as a fully managed cloud service.