feat: move podmonitor to template in advance of depreciation
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: postgres-cluster
|
||||
version: 7.12.1
|
||||
version: 7.13.0
|
||||
description: Cloudnative-pg Cluster
|
||||
keywords:
|
||||
- database
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# postgres-cluster
|
||||
|
||||
 
|
||||
 
|
||||
|
||||
Cloudnative-pg Cluster
|
||||
|
||||
@@ -42,6 +42,7 @@ Cloudnative-pg Cluster
|
||||
| cluster.monitoring.podMonitor.enabled | bool | `true` | Whether to enable the PodMonitor |
|
||||
| cluster.monitoring.podMonitor.metricRelabelings | list | `[]` | The list of metric relabelings for the PodMonitor. Applied to samples before ingestion. |
|
||||
| cluster.monitoring.podMonitor.relabelings | list | `[]` | The list of relabelings for the PodMonitor. Applied to samples before scraping. |
|
||||
| cluster.monitoring.prometheusRule | object | `{"enabled":true,"excludeRules":["CNPGClusterLastFailedArchiveTimeWarning"]}` | Prometheus rule |
|
||||
| cluster.monitoring.prometheusRule.enabled | bool | `true` | Whether to enable the PrometheusRule automated alerts |
|
||||
| cluster.monitoring.prometheusRule.excludeRules | list | `["CNPGClusterLastFailedArchiveTimeWarning"]` | Exclude specified rules |
|
||||
| cluster.postgresUID | int | `-1` | The UID and GID of the postgres user inside the image, defaults to 26 |
|
||||
|
||||
@@ -35,7 +35,7 @@ spec:
|
||||
{{- with .Values.cluster.resources }}
|
||||
resources:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
{{- with .Values.cluster.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
@@ -43,7 +43,6 @@ spec:
|
||||
{{- if .Values.cluster.priorityClassName }}
|
||||
priorityClassName: {{ .Values.cluster.priorityClassName }}
|
||||
{{- end }}
|
||||
|
||||
primaryUpdateMethod: {{ .Values.cluster.primaryUpdateMethod }}
|
||||
primaryUpdateStrategy: {{ .Values.cluster.primaryUpdateStrategy }}
|
||||
logLevel: {{ .Values.cluster.logLevel }}
|
||||
@@ -57,7 +56,6 @@ spec:
|
||||
name: {{ . }}
|
||||
{{ end }}
|
||||
enablePDB: {{ .Values.cluster.enablePDB }}
|
||||
|
||||
postgresql:
|
||||
{{- if .Values.cluster.postgresql.shared_preload_libraries }}
|
||||
shared_preload_libraries:
|
||||
@@ -85,7 +83,6 @@ spec:
|
||||
parameters:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
|
||||
{{- if not (and (empty .Values.cluster.roles) (empty .Values.cluster.services)) }}
|
||||
managed:
|
||||
{{- with .Values.cluster.services }}
|
||||
@@ -97,14 +94,12 @@ spec:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{- with .Values.cluster.serviceAccountTemplate }}
|
||||
serviceAccountTemplate:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
|
||||
monitoring:
|
||||
enablePodMonitor: {{ and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled }}
|
||||
enablePodMonitor: false
|
||||
disableDefaultQueries: {{ .Values.cluster.monitoring.disableDefaultQueries }}
|
||||
{{- if not (empty .Values.cluster.monitoring.customQueries) }}
|
||||
customQueriesConfigMap:
|
||||
@@ -127,9 +122,9 @@ spec:
|
||||
{{- with .Values.cluster.monitoring.podMonitor.metricRelabelings }}
|
||||
podMonitorMetricRelabelings:
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
|
||||
{{- end }}
|
||||
{{- if not (empty .Values.backup.objectStore) -}}
|
||||
plugins:
|
||||
{{- range $objectStore := .Values.backup.objectStore }}
|
||||
- name: barman-cloud.cloudnative-pg.io
|
||||
@@ -146,7 +141,7 @@ spec:
|
||||
{{- else }}
|
||||
serverName: "{{ include "cluster.name" $ }}-backup-{{ $objectStore.index }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{ include "cluster.bootstrap" . | nindent 2 }}
|
||||
{{ include "cluster.externalClusters" . | nindent 2 }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- include "cluster.bootstrap" . | nindent 2 -}}
|
||||
{{- include "cluster.externalClusters" . | nindent 2 -}}
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{{- if and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.podMonitor.enabled -}}
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PodMonitor
|
||||
metadata:
|
||||
name: {{ include "cluster.name" $ }}
|
||||
namespace: {{ include "cluster.namespace" $ }}
|
||||
labels:
|
||||
app.kubernetes.io/name: {{ include "cluster.name" $ }}
|
||||
{{- include "cluster.labels" $ | nindent 4 }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels:
|
||||
cnpg.io/cluster: {{ include "cluster.name" $ }}
|
||||
cnpg.io/podRole: instance
|
||||
podMetricsEndpoints:
|
||||
- port: metrics
|
||||
{{- end -}}
|
||||
@@ -1,4 +1,5 @@
|
||||
{{- if and .Values.cluster.monitoring.enabled .Values.cluster.monitoring.prometheusRule.enabled -}}
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
|
||||
@@ -127,6 +127,7 @@ cluster:
|
||||
# Applied to samples before ingestion.
|
||||
metricRelabelings: []
|
||||
|
||||
# -- Prometheus rule
|
||||
prometheusRule:
|
||||
|
||||
# -- Whether to enable the PrometheusRule automated alerts
|
||||
|
||||
Reference in New Issue
Block a user