From 229851a7dddb3c8c279866bc3e630305caa837f0 Mon Sep 17 00:00:00 2001 From: Alex Lebens Date: Sun, 15 Mar 2026 12:46:29 -0500 Subject: [PATCH] feat: change all name labels to template --- charts/postgres-cluster/Chart.yaml | 2 +- charts/postgres-cluster/README.md | 2 +- charts/postgres-cluster/templates/_helpers.tpl | 1 - charts/postgres-cluster/templates/cluster.yaml | 1 + charts/postgres-cluster/templates/config-map.yaml | 1 + charts/postgres-cluster/templates/databases.yaml | 1 + charts/postgres-cluster/templates/external-secret.yaml | 2 +- charts/postgres-cluster/templates/object-store.yaml | 2 +- charts/postgres-cluster/templates/poolers.yaml | 1 + charts/postgres-cluster/templates/prometheus-rule.yaml | 1 + charts/postgres-cluster/templates/scheduled-backup.yaml | 2 +- 11 files changed, 10 insertions(+), 6 deletions(-) diff --git a/charts/postgres-cluster/Chart.yaml b/charts/postgres-cluster/Chart.yaml index 97bd2c4..bbfafc2 100644 --- a/charts/postgres-cluster/Chart.yaml +++ b/charts/postgres-cluster/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v2 name: postgres-cluster -version: 7.9.1 +version: 7.10.0 description: Cloudnative-pg Cluster keywords: - database diff --git a/charts/postgres-cluster/README.md b/charts/postgres-cluster/README.md index af4b8d4..45874aa 100644 --- a/charts/postgres-cluster/README.md +++ b/charts/postgres-cluster/README.md @@ -1,6 +1,6 @@ # postgres-cluster -![Version: 7.9.1](https://img.shields.io/badge/Version-7.9.1-informational?style=flat-square) ![AppVersion: v1.28.1](https://img.shields.io/badge/AppVersion-v1.28.1-informational?style=flat-square) +![Version: 7.10.0](https://img.shields.io/badge/Version-7.10.0-informational?style=flat-square) ![AppVersion: v1.28.1](https://img.shields.io/badge/AppVersion-v1.28.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 8289718..1429ab1 100644 --- a/charts/postgres-cluster/templates/_helpers.tpl +++ b/charts/postgres-cluster/templates/_helpers.tpl @@ -35,7 +35,6 @@ app.kubernetes.io/managed-by: {{ .Release.Service }} Selector labels */}} {{- define "cluster.selectorLabels" -}} -app.kubernetes.io/name: {{ include "cluster.name" $ }} app.kubernetes.io/instance: {{ .Release.Name }} app.kubernetes.io/part-of: {{ .Release.Name }} {{- end }} diff --git a/charts/postgres-cluster/templates/cluster.yaml b/charts/postgres-cluster/templates/cluster.yaml index fcd9889..f6a40b7 100644 --- a/charts/postgres-cluster/templates/cluster.yaml +++ b/charts/postgres-cluster/templates/cluster.yaml @@ -8,6 +8,7 @@ metadata: {{- toYaml . | nindent 4 }} {{- end }} labels: + app.kubernetes.io/name: {{ include "cluster.name" . }}-cluster {{- include "cluster.labels" . | nindent 4 }} spec: instances: {{ .Values.cluster.instances }} diff --git a/charts/postgres-cluster/templates/config-map.yaml b/charts/postgres-cluster/templates/config-map.yaml index d9baef7..9b7d466 100644 --- a/charts/postgres-cluster/templates/config-map.yaml +++ b/charts/postgres-cluster/templates/config-map.yaml @@ -5,6 +5,7 @@ metadata: name: {{ include "cluster.name" $ }}-monitoring namespace: {{ include "cluster.namespace" $ }} labels: + app.kubernetes.io/name: {{ include "cluster.name" $ }}-monitoring cnpg.io/reload: "" {{- include "cluster.labels" $ | nindent 4 }} data: diff --git a/charts/postgres-cluster/templates/databases.yaml b/charts/postgres-cluster/templates/databases.yaml index 6ec8c28..6300d79 100644 --- a/charts/postgres-cluster/templates/databases.yaml +++ b/charts/postgres-cluster/templates/databases.yaml @@ -6,6 +6,7 @@ metadata: name: {{ include "cluster.name" $ }}-database-{{ .name | replace "_" "-" }} namespace: {{ include "cluster.namespace" $ }} labels: + app.kubernetes.io/name: {{ include "cluster.name" $ }}-database-{{ .name | replace "_" "-" }} {{- include "cluster.labels" $ | nindent 4 }} spec: name: {{ .name }} diff --git a/charts/postgres-cluster/templates/external-secret.yaml b/charts/postgres-cluster/templates/external-secret.yaml index f11b55c..f9cc1e4 100644 --- a/charts/postgres-cluster/templates/external-secret.yaml +++ b/charts/postgres-cluster/templates/external-secret.yaml @@ -8,8 +8,8 @@ metadata: name: {{ include "cluster.backupSecretName" (dict "instance" . "global" $context) }} namespace: {{ include "cluster.namespace" $context }} labels: - {{- include "cluster.labels" $context | nindent 4 }} app.kubernetes.io/name: {{ include "cluster.backupSecretName" (dict "instance" . "global" $context) }} + {{- include "cluster.labels" $context | nindent 4 }} {{- with $context.Values.cluster.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/postgres-cluster/templates/object-store.yaml b/charts/postgres-cluster/templates/object-store.yaml index 98b9b3d..271a948 100644 --- a/charts/postgres-cluster/templates/object-store.yaml +++ b/charts/postgres-cluster/templates/object-store.yaml @@ -8,8 +8,8 @@ metadata: name: {{ include "cluster.name" $context }}-backup-{{ .name }} namespace: {{ include "cluster.namespace" $context }} labels: - {{- include "cluster.labels" $context | nindent 4 }} app.kubernetes.io/name: {{ include "cluster.name" $context }}-backup-{{ .name }} + {{- include "cluster.labels" $context | nindent 4 }} {{- with $context.Values.cluster.additionalLabels }} {{- toYaml . | nindent 4 }} {{- end }} diff --git a/charts/postgres-cluster/templates/poolers.yaml b/charts/postgres-cluster/templates/poolers.yaml index 3941dd2..560f6bd 100644 --- a/charts/postgres-cluster/templates/poolers.yaml +++ b/charts/postgres-cluster/templates/poolers.yaml @@ -6,6 +6,7 @@ metadata: name: {{ include "cluster.name" $ }}-pooler-{{ .name }} namespace: {{ include "cluster.namespace" $ }} labels: + app.kubernetes.io/name: {{ include "cluster.name" $ }}-pooler-{{ .name }} {{- include "cluster.labels" $ | nindent 4 }} spec: cluster: diff --git a/charts/postgres-cluster/templates/prometheus-rule.yaml b/charts/postgres-cluster/templates/prometheus-rule.yaml index f2df959..46c477c 100644 --- a/charts/postgres-cluster/templates/prometheus-rule.yaml +++ b/charts/postgres-cluster/templates/prometheus-rule.yaml @@ -5,6 +5,7 @@ metadata: name: {{ include "cluster.name" $ }}-alert-rules namespace: {{ include "cluster.namespace" $ }} labels: + app.kubernetes.io/name: {{ include "cluster.name" $ }}-alert-rules {{- include "cluster.labels" $ | nindent 4 }} spec: groups: diff --git a/charts/postgres-cluster/templates/scheduled-backup.yaml b/charts/postgres-cluster/templates/scheduled-backup.yaml index 4c3d688..3ab9987 100644 --- a/charts/postgres-cluster/templates/scheduled-backup.yaml +++ b/charts/postgres-cluster/templates/scheduled-backup.yaml @@ -7,8 +7,8 @@ metadata: name: "{{ include "cluster.name" $context }}-scheduled-backup-{{ .name }}" namespace: {{ include "cluster.namespace" $context }} labels: - {{- include "cluster.labels" $context | nindent 4 }} app.kubernetes.io/name: "{{ include "cluster.name" $context }}-scheduled-backup-{{ .name }}" + {{- include "cluster.labels" $context | nindent 4 }} spec: immediate: {{ .immediate | default false }} suspend: {{ .suspend | default false }}