Skip to content

Commit 703d84e

Browse files
committed
Add support for ImageVolume extensions
The Cluster resource defines the .spec.postgresql.extensions list of objects to import an extension as an image volume. https://cloudnative-pg.io/docs/1.29/imagevolume_extensions However the chart doesn't recognise this setting and throws an error if set. Add support for the setting, which can be used for example as: ```yaml cluster: postgresql: extensions: - name: pg-oidc-validator image: reference: registry.codicelieve.com/pg-oidc-validator:v0.2-pg18-trixie pullPolicy: IfNotPresent ``` Signed-off-by: Daniele Varrazzo <daniele.varrazzo@gmail.com>
1 parent 6d23ac5 commit 703d84e

5 files changed

Lines changed: 11 additions & 1 deletion

File tree

charts/cluster/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ refer to the [CloudNativePG Documentation](https://cloudnative-pg.io/documentati
179179
| cluster.podSecurityContext | object | `{}` | Configure the Pod Security Context. See: https://cloudnative-pg.io/documentation/preview/security/ |
180180
| cluster.postgresGID | int | `-1` | The GID of the postgres user inside the image, defaults to 26 |
181181
| cluster.postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 |
182+
| cluster.postgresql.extensions | list | `[]` | List of [image volume extensions](https://cloudnative-pg.io/docs/1.29/imagevolume_extensions/) to load in the cluster pod |
182183
| cluster.postgresql.ldap | object | `{}` | PostgreSQL LDAP configuration (see https://cloudnative-pg.io/documentation/current/postgresql_conf/#ldap-configuration) |
183184
| cluster.postgresql.parameters | object | `{}` | PostgreSQL configuration options (postgresql.conf) |
184185
| cluster.postgresql.pg_hba | list | `[]` | PostgreSQL Host Based Authentication rules (lines to be appended to the pg_hba.conf file) |

charts/cluster/templates/NOTES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{{ fail ".Values.pooler has been deprecated. Use .Values.poolers instead." }}
33
{{- end -}}
44

5-
{{- if gt (omit .Values.cluster.postgresql "parameters" "synchronous" "pg_hba" "pg_ident" "syncReplicaElectionConstraint" "shared_preload_libraries" "ldap" "promotionTimeout" "enableAlterSystem" | keys | len) 0 -}}
5+
{{- if gt (omit .Values.cluster.postgresql "parameters" "synchronous" "pg_hba" "pg_ident" "syncReplicaElectionConstraint" "shared_preload_libraries" "ldap" "promotionTimeout" "enableAlterSystem" "extensions" | keys | len) 0 -}}
66
{{ fail ".Values.cluster.postgresql has been deprecated. Use .Values.cluster.postgresql.parameters instead." }}
77
{{- end -}}
88

charts/cluster/templates/cluster.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,10 @@ spec:
9797
parameters:
9898
{{- toYaml . | nindent 6 }}
9999
{{- end }}
100+
{{- with .Values.cluster.postgresql.extensions }}
101+
extensions:
102+
{{- toYaml . | nindent 6 }}
103+
{{ end }}
100104

101105
{{- if not (and (empty .Values.cluster.roles) (empty .Values.cluster.services)) }}
102106
managed:

charts/cluster/values.schema.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,9 @@
293293
"postgresql": {
294294
"type": "object",
295295
"properties": {
296+
"extensions": {
297+
"type": "array"
298+
},
296299
"ldap": {
297300
"type": "object"
298301
},

charts/cluster/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,8 @@ cluster:
367367
# -- Lists of shared preload libraries to add to the default ones
368368
shared_preload_libraries: []
369369
# - pgaudit
370+
# -- List of [image volume extensions](https://cloudnative-pg.io/docs/1.29/imagevolume_extensions/) to load in the cluster pod
371+
extensions: []
370372
# -- PostgreSQL LDAP configuration (see https://cloudnative-pg.io/documentation/current/postgresql_conf/#ldap-configuration)
371373
ldap: {}
372374
# https://cloudnative-pg.io/documentation/current/postgresql_conf/#ldap-configuration

0 commit comments

Comments
 (0)