1 {{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled }}
2 apiVersion: monitoring.coreos.com/v1
5 name: {{ template "postgresql.fullname" . }}
6 {{- with .Values.metrics.prometheusRule.namespace }}
10 app: {{ template "postgresql.name" . }}
11 chart: {{ template "postgresql.chart" . }}
12 release: {{ .Release.Name | quote }}
13 heritage: {{ .Release.Service | quote }}
14 {{- with .Values.metrics.prometheusRule.additionalLabels }}
15 {{ toYaml . | indent 4 }}
18 {{- with .Values.metrics.prometheusRule.rules }}
20 - name: {{ template "postgresql.name" $ }}
21 rules: {{ tpl (toYaml .) $ | nindent 8 }}