diff --git a/charts/cluster/templates/cluster.yaml b/charts/cluster/templates/cluster.yaml index c1879cfef..0fad0502b 100644 --- a/charts/cluster/templates/cluster.yaml +++ b/charts/cluster/templates/cluster.yaml @@ -83,3 +83,7 @@ spec: {{- end }} {{ include "cluster.bootstrap" . | nindent 2 }} {{ include "cluster.backup" . | nindent 2 }} + {{- with .Values.cluster.inheritedMetadata }} + inheritedMetadata: + {{- toYaml . | nindent 4 }} + {{ end }} diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 9e35d7a90..57e0a3198 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -199,6 +199,23 @@ "imagePullSecrets": { "type": "array" }, + "inheritedMetadata": { + "type": "object", + "properties": { + "annotations": { + "type": "object", + "additionalProperties": { + "type": "string" + } + }, + "labels": { + "type": "object", + "additionalProperties": { + "type": "string" + } + } + } + }, "initdb": { "type": "object" }, diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 8398c74d1..b5d89318f 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -267,6 +267,17 @@ 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 if they match the operator's INHERITED_ANNOTATIONS or INHERITED_LABELS + # See: https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-EmbeddedObjectMetadata + # See: https://cloudnative-pg.io/documentation/current/operator_conf/#defining-an-operator-config-map + inheritedMetadata: {} + # annotations: + # my.custom: annotation + # another.custom: annotation + # labels: + # my.custom: label + # another.custom: label backups: