diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index bcffc30..20e8e90 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 5.0.3 +version: 5.0.4 description: Cloudnative-pg Cluster keywords: - database diff --git a/charts/postgres-cluster/README.md b/charts/postgres-cluster/README.md index c088781..9d468ed 100644 --- a/charts/postgres-cluster/README.md +++ b/charts/postgres-cluster/README.md @@ -1,6 +1,6 @@ # postgres-cluster -![Version: 5.0.3](https://img.shields.io/badge/Version-5.0.3-informational?style=flat-square) ![AppVersion: v1.25.1](https://img.shields.io/badge/AppVersion-v1.25.1-informational?style=flat-square) +![Version: 5.0.4](https://img.shields.io/badge/Version-5.0.4-informational?style=flat-square) ![AppVersion: v1.25.1](https://img.shields.io/badge/AppVersion-v1.25.1-informational?style=flat-square) Cloudnative-pg Cluster diff --git a/charts/postgres-cluster/templates/_helpers.tpl b/charts/postgres-cluster/templates/_helpers.tpl index 6c66d54..62b7520 100644 --- a/charts/postgres-cluster/templates/_helpers.tpl +++ b/charts/postgres-cluster/templates/_helpers.tpl @@ -26,6 +26,9 @@ helm.sh/chart: {{ include "cluster.chart" $ }} app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} {{- end }} app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- with .Values.cluster.additionalLabels }} +{{ toYaml . }} +{{- end }} {{- end }} {{/* diff --git a/charts/postgres-cluster/templates/cluster.yaml b/charts/postgres-cluster/templates/cluster.yaml index 139f373..6634515 100644 --- a/charts/postgres-cluster/templates/cluster.yaml +++ b/charts/postgres-cluster/templates/cluster.yaml @@ -9,15 +9,12 @@ metadata: {{- end }} labels: {{- include "cluster.labels" . | nindent 4 }} - {{- with .Values.cluster.additionalLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} spec: instances: {{ .Values.cluster.instances }} {{- include "cluster.image" . | nindent 2 }} imageName: "{{ .Values.cluster.image.repository }}:{{ .Values.cluster.image.tag }}" - imagePullPolicy: {{ .Values.cluster.image.imagePullPolicy }} - {{- with .Values.cluster.image.imagePullSecrets }} + imagePullPolicy: {{ .Values.cluster.imagePullPolicy }} + {{- with .Values.cluster.imagePullSecrets }} imagePullSecrets: {{- . | toYaml | nindent 4 }} {{- end }} diff --git a/charts/postgres-cluster/templates/config-map.yaml b/charts/postgres-cluster/templates/config-map.yaml index 9933fc5..d9baef7 100644 --- a/charts/postgres-cluster/templates/config-map.yaml +++ b/charts/postgres-cluster/templates/config-map.yaml @@ -2,14 +2,11 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "cluster.name" . }}-monitoring - namespace: {{ include "cluster.namespace" . }} + name: {{ include "cluster.name" $ }}-monitoring + namespace: {{ include "cluster.namespace" $ }} labels: cnpg.io/reload: "" - {{- include "cluster.labels" . | nindent 4 }} - {{- with .Values.cluster.additionalLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} + {{- include "cluster.labels" $ | nindent 4 }} data: custom-queries: | {{- range .Values.cluster.monitoring.customQueries }} diff --git a/charts/postgres-cluster/templates/image-catalog.yaml b/charts/postgres-cluster/templates/image-catalog.yaml index 38fddcd..606c1e2 100644 --- a/charts/postgres-cluster/templates/image-catalog.yaml +++ b/charts/postgres-cluster/templates/image-catalog.yaml @@ -2,13 +2,10 @@ apiVersion: postgresql.cnpg.io/v1 kind: ImageCatalog metadata: - name: {{ include "cluster.name" . }}-image-catalog - namespace: {{ include "cluster.namespace" . }} + name: {{ include "cluster.name" $ }}-image-catalog + namespace: {{ include "cluster.namespace" $ }} labels: - {{- include "cluster.labels" . | nindent 4 }} - {{- with .Values.cluster.additionalLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} + {{- include "cluster.labels" $ | nindent 4 }} spec: images: {{- range $image := .Values.imageCatalog.images }} diff --git a/charts/postgres-cluster/templates/poolers.yaml b/charts/postgres-cluster/templates/poolers.yaml index 0d60855..10623f3 100644 --- a/charts/postgres-cluster/templates/poolers.yaml +++ b/charts/postgres-cluster/templates/poolers.yaml @@ -6,10 +6,7 @@ metadata: name: {{ include "cluster.name" $ }}-pooler-{{ .name }} namespace: {{ include "cluster.namespace" $ }} labels: - {{- include "cluster.labels" . | nindent 4 }} - {{- with .Values.cluster.additionalLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} + {{- include "cluster.labels" $ | nindent 4 }} spec: cluster: name: {{ include "cluster.name" $ }} diff --git a/charts/postgres-cluster/templates/prometheus-rule.yaml b/charts/postgres-cluster/templates/prometheus-rule.yaml index 3a5fc2e..f2df959 100644 --- a/charts/postgres-cluster/templates/prometheus-rule.yaml +++ b/charts/postgres-cluster/templates/prometheus-rule.yaml @@ -6,9 +6,6 @@ metadata: namespace: {{ include "cluster.namespace" $ }} labels: {{- include "cluster.labels" $ | nindent 4 }} - {{- with .Values.cluster.additionalLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} spec: groups: - name: cloudnative-pg/{{ include "cluster.name" . }} diff --git a/charts/postgres-cluster/templates/scheduled-backup.yaml b/charts/postgres-cluster/templates/scheduled-backup.yaml index 46409dc..b9da473 100644 --- a/charts/postgres-cluster/templates/scheduled-backup.yaml +++ b/charts/postgres-cluster/templates/scheduled-backup.yaml @@ -6,12 +6,9 @@ apiVersion: postgresql.cnpg.io/v1 kind: ScheduledBackup metadata: name: {{ include "cluster.name" $context }}-{{ .name }}-scheduled-backup - namespace: {{ include "cluster.namespace" $ }} + namespace: {{ include "cluster.namespace" $context }} labels: - {{- include "cluster.labels" $ | nindent 4 }} - {{- with .Values.cluster.additionalLabels }} - {{ toYaml . | nindent 4 }} - {{- end }} + {{- include "cluster.labels" $context | nindent 4 }} spec: immediate: true schedule: {{ .schedule | quote }}