diff --git a/helm/templates/prometheusrules.yaml b/helm/templates/prometheusrules.yaml index 6f49016..fc665dc 100644 --- a/helm/templates/prometheusrules.yaml +++ b/helm/templates/prometheusrules.yaml @@ -1,4 +1,5 @@ -{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.prometheusrule.enabled ) }} +{{- if .Values.prometheusrule.enabled }} +{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }} apiVersion: monitoring.coreos.com/v1 kind: PrometheusRule metadata: @@ -115,3 +116,4 @@ spec: summary: "All zookeeper containers in the Zookeeper pods down or in CrashLookBackOff status" message: "All zookeeper containers in the Zookeeper pods have been down or in CrashLookBackOff status for 3 minutes" {{- end }} +{{- end }} diff --git a/helm/templates/servicemonitor.yaml b/helm/templates/servicemonitor.yaml index 2c82cb4..bbfbff3 100644 --- a/helm/templates/servicemonitor.yaml +++ b/helm/templates/servicemonitor.yaml @@ -1,4 +1,6 @@ -{{- if and ( .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" ) ( .Values.servicemonitor.enabled ) ( .Values.prometheus.jmx.enabled ) }} +{{- if .Values.servicemonitor.enabled }} +{{- if .Values.prometheus.jmx.enabled }} +{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1" }} --- apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -33,3 +35,5 @@ spec: matchNames: - {{ .Release.Namespace }} {{- end }} +{{- end }} +{{- end }} diff --git a/helm/templates/statefulset.yaml b/helm/templates/statefulset.yaml index 7d80f00..d053d00 100644 --- a/helm/templates/statefulset.yaml +++ b/helm/templates/statefulset.yaml @@ -21,12 +21,12 @@ spec: labels: app: {{ include "zookeeper.name" . }} release: {{ .Release.Name }} - {{- with .Values.podLabels }} + {{- with merge .Values.podLabels .Values.commonPodLabels }} {{- toYaml . | nindent 8 }} {{- end }} - {{- if .Values.podAnnotations }} + {{- with merge .Values.podAnnotations .Values.commonPodAnnotations }} annotations: - {{- toYaml .Values.podAnnotations | nindent 8 }} + {{- toYaml . | nindent 8 }} {{- end }} spec: serviceAccountName: {{ template "zookeeper.serviceAccountName" . }} diff --git a/helm/values.yaml b/helm/values.yaml index 9bbb7d0..10a2b68 100644 --- a/helm/values.yaml +++ b/helm/values.yaml @@ -23,6 +23,10 @@ podLabels: {} podAnnotations: {} +commonPodLabels: {} + +commonPodAnnotations: {} + serviceAccount: create: true name: ""