Files
charts/bitnami/postgresql-ha/templates/postgresql/servicemonitor.yaml
Francisco de Paz Galán 55f65fa863 [bitnami/postgresql-ha] Chart standardised and bump to PSQL@14 (#9777)
* [bitnami/postgresql-ha] Chart standarization

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Update resources names

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Remove obsolete comments

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Quote namespaces and fix port typo in serviceMonitor

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Bump PSQL major

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Regenerate README

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Revert updateStrategy changes

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Add upgrade notes

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Modify nodePort params and fix typo

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* Apply suggested changes

Signed-off-by: FraPazGal <fdepaz@vmware.com>

* [bitnami/postgresql-ha] Update components versions

Signed-off-by: Bitnami Containers <containers@bitnami.com>

Co-authored-by: Bitnami Containers <containers@bitnami.com>
2022-04-20 13:21:49 +02:00

53 lines
2.6 KiB
YAML

{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ include "postgresql-ha.postgresql" . }}
namespace: {{ coalesce .Values.metrics.serviceMonitor.namespace (include "common.names.namespace" .) | quote }}
labels: {{- include "common.labels.standard" . | nindent 4 }}
app.kubernetes.io/component: postgresql
{{- if .Values.commonLabels }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.labels }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.labels "context" $) | nindent 4 }}
{{- end }}
annotations:
{{- if .Values.commonAnnotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.annotations }}
{{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.annotations "context" $ ) | nindent 4 }}
{{- end }}
spec:
{{- if .Values.metrics.serviceMonitor.jobLabel }}
jobLabel: {{ .Values.metrics.serviceMonitor.jobLabel }}
{{- end }}
selector:
matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }}
{{- if .Values.metrics.serviceMonitor.selector }}
{{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }}
{{- end }}
app.kubernetes.io/component: postgresql
endpoints:
- port: metrics
{{- if .Values.metrics.serviceMonitor.interval }}
interval: {{ .Values.metrics.serviceMonitor.interval }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.honorLabels }}
honorLabels: {{ .Values.metrics.serviceMonitor.honorLabels }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.metricRelabelings }}
metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.metricRelabelings "context" $) | nindent 8 }}
{{- end }}
{{- if .Values.metrics.serviceMonitor.relabelings }}
relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.serviceMonitor.relabelings "context" $) | nindent 8 }}
{{- end }}
namespaceSelector:
matchNames:
- {{ include "common.names.namespace" . | quote }}
{{- end }}