Skip to content

Commit

Permalink
feat(cluster): Add support for passing inheritedMetadata to Cluster spec
Browse files Browse the repository at this point in the history
Signed-off-by: Sebastian Pohl <[email protected]>
  • Loading branch information
Sebastian-Materna committed Jan 20, 2025
1 parent dc3137e commit 705d682
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
3 changes: 3 additions & 0 deletions charts/cluster/templates/cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ spec:
postgresUID: 1001
postgresGID: 1002
instances: 2
inheritedMetadata:
labels:
azure.workload.identity/use: "true"
postgresql:
parameters:
max_connections: "42"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Binary file modified charts/cluster/values.schema.json
Binary file not shown.
10 changes: 9 additions & 1 deletion charts/cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 705d682

Please sign in to comment.