diff --git a/README.md b/README.md index ac756f1..e5c66b1 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,15 @@ Alternatively, you can set `existingSecret` to the name of a Secret that you cre > [!CAUTION] > Make sure you have provided the correct credentials in the secret, along with `dbUser` and `dbName`, BEFORE you create the cluster. Changing these values, and doing a `helm upgrade` after the cluster has been created, will NOT update those values in the existing Postgres database! +## Postgres Image Version + +It is possible to specify a postgres version to deploy with cnpg. To do so, set `image.enabled` to `true`, and add/select your desired postgres to `image.postgresImageSpec`. Please see below for an example: + +```yaml +image: + enabled: true + postgresImageSpec: ghcr.io/cloudnative-pg/postgresql:18 +``` ## Scheduled Backup diff --git a/templates/pg_cluster.yaml b/templates/pg_cluster.yaml index eecd5fc..47d597c 100644 --- a/templates/pg_cluster.yaml +++ b/templates/pg_cluster.yaml @@ -11,6 +11,9 @@ metadata: name: {{ .Release.Name }}-cnpg namespace: {{ .Release.Namespace }} spec: + {{- if .Values.image.enabled }} + imageName: {{ .Values.image.postgresImageSpec }} + {{- end }} instances: {{ .Values.instances | default 3 }} {{- if .Values.init.enabled }} bootstrap: diff --git a/values.yaml b/values.yaml index 7cf4828..1c33b9b 100644 --- a/values.yaml +++ b/values.yaml @@ -11,6 +11,19 @@ ## $ helm install oci:////ghcr.io/dataoneorg/charts/cnpg --version \ ## -f +## @section Postgres Image Parameters +## Use this section to specify which postgres image the cnpg cluster should be deploying + +image: + ## @param postgresImageOverrideEnabled Set to true to override cnpg default postgres image + ## + enabled: false + ## @param postgresImageSpec Adjust this value to your desired postgres version + ## To see available versions, see: https://github.com/cloudnative-pg/postgres-containers/pkgs/container/postgresql + ## Example: ghcr.io/cloudnative-pg/postgresql:18 + ## + postgresImageSpec: "" + ## @section Cluster Configuration Parameters ## @param instances Number of PostgreSQL instances required in the PG cluster.