diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index 715cf0094..4d15355c5 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -45,6 +45,9 @@ spec: {{- if .Values.cluster.priorityClassName }} priorityClassName: {{ .Values.cluster.priorityClassName }} {{- end }} + inheritedMetadata: + {{- toYaml . | nindent 4 }} + {{ end }} primaryUpdateMethod: {{ .Values.cluster.primaryUpdateMethod }} primaryUpdateStrategy: {{ .Values.cluster.primaryUpdateStrategy }} diff --git a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml index b8ff318d5..abcffcfdf 100644 --- a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml +++ b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster-assert.yaml @@ -12,6 +12,9 @@ spec: postgresUID: 1001 postgresGID: 1002 instances: 2 + inheritedMetadata: + labels: + azure.workload.identity/use: "true" postgresql: parameters: max_connections: "42" diff --git a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml index 68ccba903..c5c643cce 100644 --- a/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml +++ b/charts/cluster/test/postgresql-cluster-configuration/01-non_default_configuration_cluster.yaml @@ -80,6 +80,11 @@ cluster: foo: bar annotations: foo: bar + inheritedMetadata: + annotations: + super.annotation: "super-annotation" + labels: + azure.workload.identity/use: "true" serviceAccountTemplate: metadata: annotations: diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index cb181a737..eb2bd2a73 100644 Binary files a/charts/cluster/values.schema.json and b/charts/cluster/values.schema.json differ diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index ed16dacb4..6ab806b98 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -298,7 +298,15 @@ cluster: additionalLabels: {} annotations: {} - + # -- Metadata to be inherited by all resources related to a Cluster, annotations and labels defined here will be added to all cluster resources + # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-EmbeddedObjectMetadata + inheritedMetadata: {} + # annotations: + # my.custom: annotation + # another.custom: annotation + # labels: + # my.custom: label + # another.custom: label backups: # -- You need to configure backups manually, so backups are disabled by default.