Skip to content

Commit c21ff8e

Browse files
committed
add custom labels and annotations for crds
1 parent 3c56d04 commit c21ff8e

File tree

3 files changed

+84
-0
lines changed

3 files changed

+84
-0
lines changed

charts/cloudnative-pg/templates/crds/crds.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,13 @@ metadata:
55
annotations:
66
controller-gen.kubebuilder.io/version: v0.20.0
77
helm.sh/resource-policy: keep
8+
{{- with .Values.crds.annotations }}
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
{{- with .Values.crds.labels }}
12+
labels:
13+
{{- toYaml . | nindent 4 }}
14+
{{- end }}
815
name: backups.postgresql.cnpg.io
916
spec:
1017
group: postgresql.cnpg.io
@@ -468,6 +475,13 @@ metadata:
468475
annotations:
469476
controller-gen.kubebuilder.io/version: v0.20.0
470477
helm.sh/resource-policy: keep
478+
{{- with .Values.crds.annotations }}
479+
{{- toYaml . | nindent 4 }}
480+
{{- end }}
481+
{{- with .Values.crds.labels }}
482+
labels:
483+
{{- toYaml . | nindent 4 }}
484+
{{- end }}
471485
name: clusterimagecatalogs.postgresql.cnpg.io
472486
spec:
473487
group: postgresql.cnpg.io
@@ -550,6 +564,13 @@ metadata:
550564
annotations:
551565
controller-gen.kubebuilder.io/version: v0.20.0
552566
helm.sh/resource-policy: keep
567+
{{- with .Values.crds.annotations }}
568+
{{- toYaml . | nindent 4 }}
569+
{{- end }}
570+
{{- with .Values.crds.labels }}
571+
labels:
572+
{{- toYaml . | nindent 4 }}
573+
{{- end }}
553574
name: clusters.postgresql.cnpg.io
554575
spec:
555576
group: postgresql.cnpg.io
@@ -7789,6 +7810,13 @@ metadata:
77897810
annotations:
77907811
controller-gen.kubebuilder.io/version: v0.20.0
77917812
helm.sh/resource-policy: keep
7813+
{{- with .Values.crds.annotations }}
7814+
{{- toYaml . | nindent 4 }}
7815+
{{- end }}
7816+
{{- with .Values.crds.labels }}
7817+
labels:
7818+
{{- toYaml . | nindent 4 }}
7819+
{{- end }}
77927820
name: databases.postgresql.cnpg.io
77937821
spec:
77947822
group: postgresql.cnpg.io
@@ -8384,6 +8412,13 @@ metadata:
83848412
annotations:
83858413
controller-gen.kubebuilder.io/version: v0.20.0
83868414
helm.sh/resource-policy: keep
8415+
{{- with .Values.crds.annotations }}
8416+
{{- toYaml . | nindent 4 }}
8417+
{{- end }}
8418+
{{- with .Values.crds.labels }}
8419+
labels:
8420+
{{- toYaml . | nindent 4 }}
8421+
{{- end }}
83878422
name: failoverquorums.postgresql.cnpg.io
83888423
spec:
83898424
group: postgresql.cnpg.io
@@ -8462,6 +8497,13 @@ metadata:
84628497
annotations:
84638498
controller-gen.kubebuilder.io/version: v0.20.0
84648499
helm.sh/resource-policy: keep
8500+
{{- with .Values.crds.annotations }}
8501+
{{- toYaml . | nindent 4 }}
8502+
{{- end }}
8503+
{{- with .Values.crds.labels }}
8504+
labels:
8505+
{{- toYaml . | nindent 4 }}
8506+
{{- end }}
84658507
name: imagecatalogs.postgresql.cnpg.io
84668508
spec:
84678509
group: postgresql.cnpg.io
@@ -8543,6 +8585,13 @@ metadata:
85438585
annotations:
85448586
controller-gen.kubebuilder.io/version: v0.20.0
85458587
helm.sh/resource-policy: keep
8588+
{{- with .Values.crds.annotations }}
8589+
{{- toYaml . | nindent 4 }}
8590+
{{- end }}
8591+
{{- with .Values.crds.labels }}
8592+
labels:
8593+
{{- toYaml . | nindent 4 }}
8594+
{{- end }}
85468595
name: poolers.postgresql.cnpg.io
85478596
spec:
85488597
group: postgresql.cnpg.io
@@ -17912,6 +17961,13 @@ metadata:
1791217961
annotations:
1791317962
controller-gen.kubebuilder.io/version: v0.20.0
1791417963
helm.sh/resource-policy: keep
17964+
{{- with .Values.crds.annotations }}
17965+
{{- toYaml . | nindent 4 }}
17966+
{{- end }}
17967+
{{- with .Values.crds.labels }}
17968+
labels:
17969+
{{- toYaml . | nindent 4 }}
17970+
{{- end }}
1791517971
name: publications.postgresql.cnpg.io
1791617972
spec:
1791717973
group: postgresql.cnpg.io
@@ -18108,6 +18164,13 @@ metadata:
1810818164
annotations:
1810918165
controller-gen.kubebuilder.io/version: v0.20.0
1811018166
helm.sh/resource-policy: keep
18167+
{{- with .Values.crds.annotations }}
18168+
{{- toYaml . | nindent 4 }}
18169+
{{- end }}
18170+
{{- with .Values.crds.labels }}
18171+
labels:
18172+
{{- toYaml . | nindent 4 }}
18173+
{{- end }}
1811118174
name: scheduledbackups.postgresql.cnpg.io
1811218175
spec:
1811318176
group: postgresql.cnpg.io
@@ -18300,6 +18363,13 @@ metadata:
1830018363
annotations:
1830118364
controller-gen.kubebuilder.io/version: v0.20.0
1830218365
helm.sh/resource-policy: keep
18366+
{{- with .Values.crds.annotations }}
18367+
{{- toYaml . | nindent 4 }}
18368+
{{- end }}
18369+
{{- with .Values.crds.labels }}
18370+
labels:
18371+
{{- toYaml . | nindent 4 }}
18372+
{{- end }}
1830318373
name: subscriptions.postgresql.cnpg.io
1830418374
spec:
1830518375
group: postgresql.cnpg.io

charts/cloudnative-pg/values.schema.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@
7878
"properties": {
7979
"create": {
8080
"type": "boolean"
81+
},
82+
"labels": {
83+
"type": "object"
84+
},
85+
"annotations": {
86+
"type": "object"
8187
}
8288
}
8389
},

charts/cloudnative-pg/values.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,12 @@ updateStrategy: {}
4848
crds:
4949
# -- Specifies whether the CRDs should be created when installing the chart.
5050
create: true
51+
# -- Labels to be added to the CRDs.
52+
labels: {}
53+
# -- Annotations to be added to the CRDs.
54+
# Useful for ArgoCD to enable server-side apply for CRDs managed by ArgoCD.
55+
annotations: {}
56+
# argocd.argoproj.io/sync-options: ServerSideApply=true
5157

5258
# -- The webhook configuration.
5359
webhook:
@@ -200,7 +206,9 @@ monitoring:
200206
# -- Labels that ConfigMaps should have to get configured in Grafana.
201207
labels: {}
202208
# -- Annotations that ConfigMaps can have to get configured in Grafana.
209+
# Useful for ArgoCD server-side apply
203210
annotations: {}
211+
# argocd.argoproj.io/sync-options: ServerSideApply=true
204212

205213
# Default monitoring queries
206214
monitoringQueriesConfigMap:

0 commit comments

Comments
 (0)