cnpg-cluster

by ENIX

Helm chartv2.0.1App 14.5-6Verified publisher

A Helm chart to create cloudnative-pg.io clusters

About this chart

cnpg-cluster

A Helm chart to create cloudnative-pg.io clusters

TL;DR;

$ helm repo add enix https://charts.enix.io/
$ helm install my-release enix/cnpg-cluster

Installing the Chart

To install the chart with the release name my-release:

$ helm install my-release enix/cnpg-cluster

The command deploys a CNPG cluster on the Kubernetes cluster in the default configuration. The Chart Values section lists the parameters that can be configured during installation.

Tip: List all releases using helm list

Uninstalling the Chart

To uninstall/delete the my-release deployment:

$ helm delete my-release

The command removes all the Kubernetes components associated with the chart and deletes the release.

Values

KeyTypeDefaultDescription
backup.azureCredentialsobjectnilThe credentials to use to upload data to Azure Blob Storage See: https://cloudnative-pg.io/documentation/1.17/api_reference/#AzureCredentials
backup.dataobject{}Configuration of the backup of the data directory See: https://cloudnative-pg.io/documentation/1.17/api_reference/#DataBackupConfiguration
backup.destinationPathstring""The path where to store the backup (i.e. s3://bucket/path/to/folder) this path, with different destination folders, will be used for WALs and for data --
backup.enabledboolfalseEnable backups
backup.endpointCAstringnilEndpointCA store the CA bundle of the barman endpoint. Useful when using self-signed certificates to avoid errors with certificate issuer and barman-cloud-wal-archive
backup.endpointURLstringnilEndpoint to be used to upload data to the cloud, overriding the automatic endpoint discovery
backup.googleCredentialsobjectnilThe credentials to use to upload data to Google Cloud Storage See: https://cloudnative-pg.io/documentation/1.17/api_reference/#GoogleCredentials
backup.historyTagsobject{}
backup.retentionPolicystring"30d"RetentionPolicy is the retention policy to be used for backups and WALs (i.e. '60d'). The retention policy is expressed in the form of XXu where XX is a positive integer and u is in [dwm] - days, weeks, months.
backup.s3CredentialsobjectnilThe credentials to use to upload data to S3 See: https://cloudnative-pg.io/documentation/1.17/api_reference/#S3Credentials
backup.secretNamestringnilOverride secret name for the backup credentials
backup.serverNamestringnilThe server name on S3, the cluster name is used if this parameter is omitted
backup.tagsobject{}
backup.volumeSnapshotobject{}The configuration for the execution of volume snapshot backups. See: https://cloudnative-pg.io/documentation/1.22/cloudnative-pg.v1/#postgresql-cnpg-io-v1-VolumeSnapshotConfiguration
backup.walobject{}Configuration of the backup of the WAL stream See: https://cloudnative-pg.io/documentation/1.17/api_reference/#walbackupconfiguration
clusterExtraSpecobject{}Extra configuration for Cluster resource. See: https://cloudnative-pg.io/documentation/1.17/api_reference/#clusterspec
customServicesobject{"any":{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"},"r":{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"},"ro":{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"},"rw":{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"}}Custom services to create
customServices.anyobject{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"}Custom services for any member
customServices.robject{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"}Custom services for readable members
customServices.roobject{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"}Custom services for read-only (replicas) members
customServices.rwobject{"annotations":{},"enabled":false,"externalIPs":[],"type":"ClusterIP"}Custom services for read-write (primary) member
extraAffinityobject{}Extra configuration for Cluster's affinity resource, see: https://cloudnative-pg.io/documentation/1.17/api_reference/#AffinityConfiguration
fullnameOverridestring""String to fully override cnpg-cluster.fullname template with a string
image.pullPolicystring"IfNotPresent"Postgres image pull policy
image.repositorystring"ghcr.io/cloudnative-pg/postgresql"Postgres image repository. Keep empty to use operator's default image. See: https://cloudnative-pg.io/documentation/1.17/operator_capability_levels/#override-of-operand-images-through-the-crd
image.tagstring""Override the Postgres image tag
imagePullSecretslist[]Docker-registry secret names as an array
nameOverridestring""String to partially override cnpg-cluster.fullname template with a string (will prepend the release name)
nodeSelectorobject{}Postgres instances labels for pod assignment
persistence.pvcTemplateobject{}Template to be used to generate the Persistent Volume Claim
persistence.resizeInUseVolumesstringnilResize existent PVCs, defaults to true
persistence.sizestring"1Gi"Size of each instance storage volume
persistence.storageClassstring""StorageClass to use for database data, Applied after evaluating the PVC template, if available. If not specified, generated PVCs will be satisfied by the default storage class
poolersobject{}Poller resources to create for this Cluster resource See: https://cloudnative-pg.io/documentation/1.17/api_reference/#PoolerSpec
registryCredentialsstringnilCreate a docker-registry secret and use it as imagePullSecrets
replicaCountint1Number of Postgres instances in the cluster
resourcesobject{}CPU/Memory resource requests/limits
scheduledBackupsobject{}ScheduledBackup resources to create for this Cluster resource See: https://cloudnative-pg.io/documentation/1.17/api_reference/#ScheduledBackupSpec
tolerationslist[]Postgres instances labels for tolerations pod assignment

Upgrading

To 2.0.0

This major bump changes the following backup settings:

  • fix a discrepancy between doc and template, the parameter secretName previously a root value is now under backup: backup.secretName.
  • remove backup.createSecret parameter, secret is created by default unless backup.secretName is provided.

License

Copyright (c) 2022 ENIX

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Deploy cnpg-cluster with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cnpg-cluster on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartcnpg-cluster is pinned at v2.0.1 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below
opentenant validate opentenant.yaml
terraform init && terraform apply