diff --git a/charts/pgcat/Chart.yaml b/charts/pgcat/Chart.yaml index 6bbd041..4e4ee20 100644 --- a/charts/pgcat/Chart.yaml +++ b/charts/pgcat/Chart.yaml @@ -5,5 +5,11 @@ description: A Helm chart for PgCat a PostgreSQL pooler and proxy (like PgBounce maintainers: - email: team@postgresml.org name: PostgresML +dependencies: + - name: common + repository: oci://registry-1.docker.io/bitnamicharts + tags: + - bitnami-common + version: 2.x.x name: pgcat -version: 0.2.6 +version: 0.2.7 diff --git a/charts/pgcat/templates/servicemonitor.yaml b/charts/pgcat/templates/servicemonitor.yaml index 21a3eff..e3cdb69 100644 --- a/charts/pgcat/templates/servicemonitor.yaml +++ b/charts/pgcat/templates/servicemonitor.yaml @@ -1,3 +1,4 @@ +{{- if .Values.serviceMonitor.enabled }} {{- if and .Values.configuration.general.enable_prometheus_exporter .Values.configuration.general.prometheus_exporter_port }} apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor @@ -10,15 +11,34 @@ metadata: {{- end }} labels: {{- include "pgcat.labels" . | nindent 4 }} + {{- if .Values.serviceMonitor.additionalLabels }} + {{- toYaml .Values.serviceMonitor.additionalLabels | nindent 4 }} + {{- end }} spec: {{- if .Values.serviceMonitor.jobLabel }} jobLabel: {{ .Values.serviceMonitor.jobLabel }} {{- end }} selector: matchLabels: - app.kubernetes.io/component: apollo-portal + {{- include "pgcat.labels" . | nindent 6 }} endpoints: - - port: http + - port: metrics path: {{ .Values.serviceMonitor.metricPath | default "/metrics" }} - + interval: {{ .Values.serviceMonitor.interval | default 30 }} + {{- if .Values.serviceMonitor.scrapeTimeout }} + scrapeTimeout: {{ .Values.serviceMonitor.scrapeTimeout }} + {{- end }} + {{- if .Values.serviceMonitor.relabelings }} + relabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.serviceMonitor.relabelings "context" $) | nindent 6 }} + {{- end }} + {{- if .Values.serviceMonitor.metricRelabelings }} + metricRelabelings: {{- include "common.tplvalues.render" ( dict "value" .Values.serviceMonitor.metricRelabelings "context" $) | nindent 6 }} + {{- end }} + {{- if .Values.serviceMonitor.honorLabels }} + honorLabels: {{ .Values.serviceMonitor.honorLabels }} + {{- end }} + namespaceSelector: + matchNames: + - {{ .Release.Namespace }} +{{- end }} {{- end }} diff --git a/charts/pgcat/values.yaml b/charts/pgcat/values.yaml index 589af32..ab8affd 100644 --- a/charts/pgcat/values.yaml +++ b/charts/pgcat/values.yaml @@ -161,7 +161,7 @@ configuration: port: 6432 ## @param configuration.general.enable_prometheus_exporter Whether to enable prometheus exporter or not. - enable_prometheus_exporter: true + enable_prometheus_exporter: false ## @param configuration.general.prometheus_exporter_port Port at which prometheus exporter listens on. prometheus_exporter_port: 9930 @@ -249,9 +249,7 @@ configuration: pool_mode: "transaction", users: [ - { - username: "user", password: "pass", pool_size: 5, statement_timeout: 0 - } + {username: "user", password: "pass", pool_size: 5, statement_timeout: 0} ], shards: [