Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion charts/cloudnative-pg-cluster/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
9 changes: 7 additions & 2 deletions charts/cloudnative-pg-cluster/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -29,18 +29,23 @@ 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 | `{}` | |
| scheduledBackup | object | `{}` | schduled backups section, please see values.yaml for example |
| 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)
33 changes: 33 additions & 0 deletions charts/cloudnative-pg-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -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 -}}
9 changes: 9 additions & 0 deletions charts/cloudnative-pg-cluster/templates/cnpg_cluster.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
20 changes: 20 additions & 0 deletions charts/cloudnative-pg-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,27 @@ 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)
# supervised: requires manual supervision to perform
# 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
Expand Down Expand Up @@ -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
Expand Down
Loading