diff --git a/charts/cloudnative-pg/README.md b/charts/cloudnative-pg/README.md index 9f6dde8959..538a6135a0 100644 --- a/charts/cloudnative-pg/README.md +++ b/charts/cloudnative-pg/README.md @@ -128,6 +128,7 @@ Kubernetes: `>=1.29.0-0` | containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":10001,"runAsUser":10001,"seccompProfile":{"type":"RuntimeDefault"}}` | Container Security Context. | | crds.create | bool | `true` | Specifies whether the CRDs should be created when installing the chart. | | dnsPolicy | string | `""` | | +| extraObjects | list | `[]` | Extra Kubernetes manifests to deploy alongside this chart. Each entry is passed through `tpl`, so Helm templating is supported. | | fullnameOverride | string | `""` | | | hostNetwork | bool | `false` | | | image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/charts/cloudnative-pg/templates/extra-manifests.yaml b/charts/cloudnative-pg/templates/extra-manifests.yaml new file mode 100644 index 0000000000..87b019f0b1 --- /dev/null +++ b/charts/cloudnative-pg/templates/extra-manifests.yaml @@ -0,0 +1,15 @@ +{{- /* Normalize extraObjects to a list, easier to loop over */ -}} +{{- $extraObjects := .Values.extraObjects | default (list) -}} + +{{- if kindIs "map" $extraObjects -}} + {{- $extraObjects = values $extraObjects -}} +{{- end -}} + +{{- range $extraObjects }} +--- + {{- if kindIs "map" . }} + {{- tpl (toYaml .) $ | nindent 0 }} + {{- else if kindIs "string" . }} + {{- tpl . $ | nindent 0 }} + {{- end }} +{{- end }} diff --git a/charts/cloudnative-pg/values.schema.json b/charts/cloudnative-pg/values.schema.json index efdd012e85..07bf8ce902 100644 --- a/charts/cloudnative-pg/values.schema.json +++ b/charts/cloudnative-pg/values.schema.json @@ -127,6 +127,13 @@ "default": "", "type": "string" }, + "extraObjects": { + "description": "Extra Kubernetes manifests to deploy alongside the cloudnative-pg operator.\nEach entry is passed through `tpl`, so Helm templating is supported.", + "items": { + "required": [] + }, + "type": "array" + }, "fullnameOverride": { "default": "", "type": "string" diff --git a/charts/cloudnative-pg/values.yaml b/charts/cloudnative-pg/values.yaml index 2fcfd0e999..0dc0b4c313 100644 --- a/charts/cloudnative-pg/values.yaml +++ b/charts/cloudnative-pg/values.yaml @@ -694,3 +694,23 @@ monitoringQueriesConfigMap: description: "An update is available" target_databases: - '*' + +# -- Extra Kubernetes manifests to deploy alongside this chart. Each entry is passed through `tpl`, so Helm templating is supported. +extraObjects: [] +# - apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: "{{ include \"cloudnative-pg.fullname\" . }}-grafana-dashboard" +# labels: +# grafana_dashboard: "1" +# data: +# cnpg-dashboard.json: |- +# { ... } +# - | +# apiVersion: v1 +# kind: Secret +# type: Opaque +# metadata: +# name: cnpg-secret +# data: +# { ... } diff --git a/charts/cluster/README.md b/charts/cluster/README.md index 203f8c146d..7641ae6283 100644 --- a/charts/cluster/README.md +++ b/charts/cluster/README.md @@ -207,6 +207,7 @@ Kubernetes: `>=1.29.0-0` | cluster.walStorage.size | string | `"1Gi"` | | | cluster.walStorage.storageClass | string | `""` | | | databases | list | `[]` | Database management configuration. | +| extraObjects | list | `[]` | Extra Kubernetes manifests to deploy alongside this chart. Each entry is passed through `tpl`, so Helm templating is supported. | | fullnameOverride | string | `""` | Override the full name of the chart | | imageCatalog.create | bool | `true` | Whether to provision an image catalog. If imageCatalog.images is empty this option will be ignored. | | imageCatalog.images | list | `[]` | List of images to be provisioned in an image catalog. | diff --git a/charts/cluster/templates/extra-manifests.yaml b/charts/cluster/templates/extra-manifests.yaml new file mode 100644 index 0000000000..87b019f0b1 --- /dev/null +++ b/charts/cluster/templates/extra-manifests.yaml @@ -0,0 +1,15 @@ +{{- /* Normalize extraObjects to a list, easier to loop over */ -}} +{{- $extraObjects := .Values.extraObjects | default (list) -}} + +{{- if kindIs "map" $extraObjects -}} + {{- $extraObjects = values $extraObjects -}} +{{- end -}} + +{{- range $extraObjects }} +--- + {{- if kindIs "map" . }} + {{- tpl (toYaml .) $ | nindent 0 }} + {{- else if kindIs "string" . }} + {{- tpl . $ | nindent 0 }} + {{- end }} +{{- end }} diff --git a/charts/cluster/values.schema.json b/charts/cluster/values.schema.json index 9d4e44357b..1179389e85 100644 --- a/charts/cluster/values.schema.json +++ b/charts/cluster/values.schema.json @@ -594,6 +594,13 @@ }, "type": "array" }, + "extraObjects": { + "description": "Extra Kubernetes manifests to deploy alongside the cluster.\nEach entry is passed through `tpl`, so Helm templating is supported.", + "items": { + "required": [] + }, + "type": "array" + }, "fullnameOverride": { "default": "", "description": "Override the full name of the chart", diff --git a/charts/cluster/values.yaml b/charts/cluster/values.yaml index 52c7cf8045..cd2386ca1e 100644 --- a/charts/cluster/values.yaml +++ b/charts/cluster/values.yaml @@ -707,3 +707,23 @@ poolers: [] # # -- Custom PgBouncer deployment template. # # Use to override image, specify resources, etc. # template: {} + +# -- Extra Kubernetes manifests to deploy alongside this chart. Each entry is passed through `tpl`, so Helm templating is supported. +extraObjects: [] +# - apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: "{{ include \"cluster.fullname\" . }}-grafana-dashboard" +# labels: +# grafana_dashboard: "1" +# data: +# cluster-dashboard.json: |- +# { ... } +# - | +# apiVersion: v1 +# kind: Secret +# type: Opaque +# metadata: +# name: cnpg-cluster-secret +# data: +# { ... } diff --git a/charts/plugin-barman-cloud/README.md b/charts/plugin-barman-cloud/README.md index ebd78e5def..37b6a26f79 100644 --- a/charts/plugin-barman-cloud/README.md +++ b/charts/plugin-barman-cloud/README.md @@ -95,6 +95,7 @@ Kubernetes: `>=1.29.0-0` | containerSecurityContext | object | `{"allowPrivilegeEscalation":false,"capabilities":{"drop":["ALL"]},"readOnlyRootFilesystem":true,"runAsGroup":10001,"runAsUser":10001,"seccompProfile":{"type":"RuntimeDefault"}}` | Container Security Context. | | crds.create | bool | `true` | Specifies whether the CRDs should be created when installing the chart. | | dnsPolicy | string | `""` | | +| extraObjects | list | `[]` | Extra Kubernetes manifests to deploy alongside this chart. Each entry is passed through `tpl`, so Helm templating is supported. | | fullnameOverride | string | `""` | | | hostNetwork | bool | `false` | | | image.pullPolicy | string | `"IfNotPresent"` | | diff --git a/charts/plugin-barman-cloud/templates/extra-manifests.yaml b/charts/plugin-barman-cloud/templates/extra-manifests.yaml new file mode 100644 index 0000000000..87b019f0b1 --- /dev/null +++ b/charts/plugin-barman-cloud/templates/extra-manifests.yaml @@ -0,0 +1,15 @@ +{{- /* Normalize extraObjects to a list, easier to loop over */ -}} +{{- $extraObjects := .Values.extraObjects | default (list) -}} + +{{- if kindIs "map" $extraObjects -}} + {{- $extraObjects = values $extraObjects -}} +{{- end -}} + +{{- range $extraObjects }} +--- + {{- if kindIs "map" . }} + {{- tpl (toYaml .) $ | nindent 0 }} + {{- else if kindIs "string" . }} + {{- tpl . $ | nindent 0 }} + {{- end }} +{{- end }} diff --git a/charts/plugin-barman-cloud/values.schema.json b/charts/plugin-barman-cloud/values.schema.json index dd85a69a9b..b5b77c5804 100644 --- a/charts/plugin-barman-cloud/values.schema.json +++ b/charts/plugin-barman-cloud/values.schema.json @@ -123,6 +123,13 @@ "default": "", "type": "string" }, + "extraObjects": { + "description": "Extra Kubernetes manifests to deploy alongside the barman cloud plugin.\nEach entry is passed through `tpl`, so Helm templating is supported.", + "items": { + "required": [] + }, + "type": "array" + }, "fullnameOverride": { "default": "", "type": "string" diff --git a/charts/plugin-barman-cloud/values.yaml b/charts/plugin-barman-cloud/values.yaml index f71c5a078f..20ff5018a6 100644 --- a/charts/plugin-barman-cloud/values.yaml +++ b/charts/plugin-barman-cloud/values.yaml @@ -195,3 +195,23 @@ certificate: duration: 2160h # -- The renew before time for the certificates. renewBefore: 360h + +# -- Extra Kubernetes manifests to deploy alongside this chart. Each entry is passed through `tpl`, so Helm templating is supported. +extraObjects: [] +# - apiVersion: v1 +# kind: ConfigMap +# metadata: +# name: "{{ include \"plugin-barman-cloud.fullname\" . }}-grafana-dashboard" +# labels: +# grafana_dashboard: "1" +# data: +# plugin-barman-cloud-dashboard.json: |- +# { ... } +# - | +# apiVersion: v1 +# kind: Secret +# type: Opaque +# metadata: +# name: plugin-barman-cloud-secret +# data: +# { ... }