diff --git a/charts/cluster/prometheus_rules/cluster-logical_replication_stopped-critical.yaml b/charts/cluster/prometheus_rules/cluster-logical_replication_stopped-critical.yaml index 0e2dd72418..4826b6aef8 100644 --- a/charts/cluster/prometheus_rules/cluster-logical_replication_stopped-critical.yaml +++ b/charts/cluster/prometheus_rules/cluster-logical_replication_stopped-critical.yaml @@ -18,7 +18,7 @@ expr: | ) or ( # Subscription is enabled but stuck (no worker process with significant lag) label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_enabled), "cluster", "$1", "job", ".+/(.+)") == 1 - and label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_pid), "cluster", "$1", "job", ".+/(.+)") == "" + and label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_pid), "cluster", "$1", "job", ".+/(.+)") <= 0 and label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_buffered_lag_bytes), "cluster", "$1", "job", ".+/(.+)") / 1024^3 > 0.1 ) for: 15m diff --git a/charts/cluster/prometheus_rules/cluster-logical_replication_stopped.yaml b/charts/cluster/prometheus_rules/cluster-logical_replication_stopped.yaml index 8865ae05de..497543afba 100644 --- a/charts/cluster/prometheus_rules/cluster-logical_replication_stopped.yaml +++ b/charts/cluster/prometheus_rules/cluster-logical_replication_stopped.yaml @@ -17,7 +17,7 @@ expr: | ) or ( # Subscription is enabled but stuck (no worker process with significant lag) label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_enabled), "cluster", "$1", "job", ".+/(.+)") == 1 - and label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_pid), "cluster", "$1", "job", ".+/(.+)") == "" + and label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_pid), "cluster", "$1", "job", ".+/(.+)") <= 0 and label_replace(max by (namespace, job, subname) (cnpg_pg_stat_subscription_buffered_lag_bytes), "cluster", "$1", "job", ".+/(.+)") / 1024^3 > 0.1 ) for: 5m diff --git a/charts/cluster/templates/_barman_object_store.tpl b/charts/cluster/templates/_barman_object_store.tpl index b7b8981f30..4fdb368698 100644 --- a/charts/cluster/templates/_barman_object_store.tpl +++ b/charts/cluster/templates/_barman_object_store.tpl @@ -5,9 +5,11 @@ {{- end }} {{- if or (.scope.endpointCA.create) (.scope.endpointCA.name) }} + {{- $endpointCAName := coalesce .scope.endpointCA.name (printf "%s-ca-bundle" .chartFullname) }} + {{- $endpointCAKey := default "ca-bundle.crt" .scope.endpointCA.key }} endpointCA: - name: {{ .scope.endpointCA.name }} - key: {{ .scope.endpointCA.key }} + name: {{ $endpointCAName }} + key: {{ $endpointCAKey }} {{- end }} {{- if .scope.destinationPath }} diff --git a/charts/cluster/templates/databases.yaml b/charts/cluster/templates/databases.yaml index d701b7bed7..b65f2069b3 100644 --- a/charts/cluster/templates/databases.yaml +++ b/charts/cluster/templates/databases.yaml @@ -1,4 +1,5 @@ {{- range .Values.databases }} +{{- $dbOwner := default .name .owner }} --- apiVersion: postgresql.cnpg.io/v1 kind: Database @@ -19,18 +20,18 @@ spec: cluster: name: {{ include "cluster.fullname" $ }} ensure: {{ .ensure | default "present" }} - owner: {{ .owner }} + owner: {{ $dbOwner }} template: {{ .template | default "template1" }} encoding: {{ .encoding | default "UTF8" }} databaseReclaimPolicy: {{ .databaseReclaimPolicy | default "retain" }} - {{- with .isTemplate }} - isTemplate: {{ . }} + {{- if hasKey . "isTemplate" }} + isTemplate: {{ .isTemplate }} {{- end }} - {{- with .allowConnections }} - allowConnections: {{ . }} + {{- if hasKey . "allowConnections" }} + allowConnections: {{ .allowConnections }} {{- end }} - {{- with .connectionLimit }} - connectionLimit: {{ . }} + {{- if hasKey . "connectionLimit" }} + connectionLimit: {{ .connectionLimit }} {{- end }} {{- with .tablespace }} tablespace: {{ . }} @@ -63,7 +64,7 @@ spec: schemas: {{- range . }} - name: {{ .name }} - owner: {{ .owner }} + owner: {{ default $dbOwner .owner }} ensure: {{ .ensure | default "present" }} {{- end }} {{- end }}