diff --git a/charts/cloudnative-pg-cluster/Chart.yaml b/charts/cloudnative-pg-cluster/Chart.yaml index e6c6bad..a5dea8a 100644 --- a/charts/cloudnative-pg-cluster/Chart.yaml +++ b/charts/cloudnative-pg-cluster/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: cnpg-cluster description: Create postgres tenant clusters managed by the CNPG Operator type: application -version: 0.4.0 +version: 0.5.0 maintainers: - name: "cloudymax" diff --git a/charts/cloudnative-pg-cluster/README.md b/charts/cloudnative-pg-cluster/README.md index d0522ce..62fa877 100644 --- a/charts/cloudnative-pg-cluster/README.md +++ b/charts/cloudnative-pg-cluster/README.md @@ -1,6 +1,6 @@ # cnpg-cluster -![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) +![Version: 0.5.0](https://img.shields.io/badge/Version-0.5.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) Create postgres tenant clusters managed by the CNPG Operator @@ -29,11 +29,15 @@ Create postgres tenant clusters managed by the CNPG Operator | certificates.user.username | list | `["app"]` | List of names of users to create a cert for, eg: the DbOwner specified earlier. This data populated into the commonName field of the certificate. | | enableSuperuserAccess | bool | `false` | CNPG disables the postgres superuser by default must be explicitly enabled | | externalClusters | list | `[]` | | +| 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. | | imageName | string | `"ghcr.io/cloudnative-pg/postgresql:16.0"` | image to use for all tenant pods | | instances | int | `3` | number of postgres replicas minimum 1 required | | managed | object | `{"roles":[]}` | See https://cloudnative-pg.io/documentation/current/cloudnative-pg.v1/#postgresql-cnpg-io-v1-RoleConfiguration for explanation of all options | | monitoring.enablePodMonitor | bool | `false` | enable monitoring via Prometheus | | name | string | `"cnpg"` | | +| postgresGID | int | `-1` | The GID of the postgres user inside the image, defaults to 26 | +| postgresUID | int | `-1` | The UID of the postgres user inside the image, defaults to 26 | | postgresql.pg_hba | list | `["hostnossl all all 0.0.0.0/0 reject","hostssl all all 0.0.0.0/0 cert clientcert=verify-full"]` | records for the pg_hba.conf file. ref: https://www.postgresql.org/docs/current/auth-pg-hba-conf.html | | primaryUpdateStrategy | string | `"unsupervised"` | | | resources | object | `{}` | | @@ -41,6 +45,7 @@ Create postgres tenant clusters managed by the CNPG Operator | storage.size | string | `"1Gi"` | how much storage to allocate to the postgresql cluster | | superuserSecret | string | `""` | name of existing secret to use as superuser redentials will be randomly generated if not specified. | | testApp.enabled | bool | `false` | | +| type | string | `"postgresql"` | Type of the CNPG database. Available types: * `postgresql` * `postgis` * `timescaledb` | ---------------------------------------------- -Autogenerated from chart metadata using [helm-docs v1.13.1](https://github.com/norwoodj/helm-docs/releases/v1.13.1) +Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2) diff --git a/charts/cloudnative-pg-cluster/templates/_helpers.tpl b/charts/cloudnative-pg-cluster/templates/_helpers.tpl index fe8be18..0755398 100644 --- a/charts/cloudnative-pg-cluster/templates/_helpers.tpl +++ b/charts/cloudnative-pg-cluster/templates/_helpers.tpl @@ -60,3 +60,36 @@ Create the name of the service account to use {{- default "default" .Values.serviceAccount.name }} {{- end }} {{- end }} + +{{/* +Whether we need to use TimescaleDB defaults +*/}} +{{- define "cluster.useTimescaleDBDefaults" -}} +{{ and (eq .Values.type "timescaledb") .Values.imageCatalog.create (empty .Values.imageCatalog.images) }} +{{- end -}} + +{{/* +Postgres UID +*/}} +{{- define "cluster.postgresUID" -}} + {{- if ge (int .Values.postgresUID) 0 -}} + {{- .Values.postgresUID }} + {{- else if and (eq (include "cluster.useTimescaleDBDefaults" .) "true") (eq .Values.type "timescaledb") -}} + {{- 1000 -}} + {{- else -}} + {{- 26 -}} + {{- end -}} +{{- end -}} + +{{/* +Postgres GID +*/}} +{{- define "cluster.postgresGID" -}} + {{- if ge (int .Values.postgresGID) 0 -}} + {{- .Values.postgresGID }} + {{- else if and (eq (include "cluster.useTimescaleDBDefaults" .) "true") (eq .Values.type "timescaledb") -}} + {{- 1000 -}} + {{- else -}} + {{- 26 -}} + {{- end -}} +{{- end -}} diff --git a/charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml b/charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml index 584a4de..d2d9c42 100644 --- a/charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml +++ b/charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml @@ -4,6 +4,15 @@ kind: Cluster metadata: name: {{ .Values.name }} spec: + # this solves an issue with an old boto version + env: + - name: AWS_REQUEST_CHECKSUM_CALCULATION + value: when_required + - name: AWS_RESPONSE_CHECKSUM_VALIDATION + value: when_required + + postgresUID: {{ include "cluster.postgresUID" . }} + postgresGID: {{ include "cluster.postgresGID" . }} instances: {{ .Values.instances }} imageName: {{ .Values.imageName }} enableSuperuserAccess: {{ .Values.enableSuperuserAccess }} diff --git a/charts/cloudnative-pg-cluster/values.yaml b/charts/cloudnative-pg-cluster/values.yaml index 0fa5fb1..4a9b55e 100644 --- a/charts/cloudnative-pg-cluster/values.yaml +++ b/charts/cloudnative-pg-cluster/values.yaml @@ -15,6 +15,14 @@ enableSuperuserAccess: false # will be randomly generated if not specified. superuserSecret: "" +imageCatalog: + # -- Whether to provision an image catalog. If imageCatalog.images is empty this option will be ignored. + create: true + # -- List of images to be provisioned in an image catalog. + images: [] + # - image: ghcr.io/your_repo/your_image:your_tag + # major: 16 + # Examples of rolling update strategy: # unsupervised: automated update of the primary once all # replicas have been upgraded (default) @@ -22,6 +30,12 @@ superuserSecret: "" # the switchover of the primary primaryUpdateStrategy: unsupervised +# -- Type of the CNPG database. Available types: +# * `postgresql` +# * `postgis` +# * `timescaledb` +type: postgresql + # -- boostrap method. see: https://cloudnative-pg.io/documentation/1.23/bootstrap/ bootstrap: {} # -- for initializing a fresh cluster @@ -135,6 +149,12 @@ certificates: username: - "app" +# -- The UID of the postgres user inside the image, defaults to 26 +postgresUID: -1 + +# -- The GID of the postgres user inside the image, defaults to 26 +postgresGID: -1 + monitoring: # -- enable monitoring via Prometheus enablePodMonitor: false