zalando-postgres-cluster

by funkypenguin

Helm chartv3.4.2App 1.0.0Verified publisher

Creates a postgres cluster using the Zalando Postgres operator and local storage

About this chart

zalando-postgres-cluster

Creates a postgres cluster using the Zalando Postgres operator and local storage

This chart is not maintained by the upstream project and any issues with the chart should be raised here

Source Code

Requirements

Dependencies

RepositoryNameVersion
https://library-charts.k8s-at-home.comcommon4.5.2

TL;DR

helm repo add k8s-at-home https://k8s-at-home.com/charts/
helm repo update
helm install zalando-postgres-cluster k8s-at-home/zalando-postgres-cluster

Installing the Chart

To install the chart with the release name zalando-postgres-cluster

helm install zalando-postgres-cluster k8s-at-home/zalando-postgres-cluster

Uninstalling the Chart

To uninstall the zalando-postgres-cluster deployment

helm uninstall zalando-postgres-cluster

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

Configuration

Read through the values.yaml file. It has several commented out suggested values. Other values may be used from the values.yaml from the common library.

Specify each parameter using the --set key=value[,key=value] argument to helm install.

helm install zalando-postgres-cluster \
  --set env.TZ="America/New York" \
    k8s-at-home/zalando-postgres-cluster

Alternatively, a YAML file that specifies the values for the above parameters can be provided while installing the chart.

helm install zalando-postgres-cluster k8s-at-home/zalando-postgres-cluster -f values.yaml

Custom configuration

This chart is a wrapper for the Zalando postgres operator to create a high available Postgres cluster using nodes local storage.

IMPORTANT: You have to install the Zalando postgres operator before you you install this chart. This chart does not do it as you typically will deploy multiple instances of it (on per postgres cluster) while the operator is installed only once.

Features added by this wrapper:

  • creates an storage class using local storage in the nodes specified in persistentVolumes.replicaNodes. These replicas survive a tear-down and tear-up of the cluster.
  • (optional) does sql dumps to an existing PVC with K8S cronjobs. The Operator only supports backups to cloud, not NFS PVC for example.
  • Define the password for the DB so that it can be used accross tear-down and tear-up of the cluster.

Values

Important: When deploying an application Helm chart you can add more values from our common library chart here

KeyTypeDefaultDescription
dumpBackup.enabledboolfalseEnable backups to a PVC
dumpBackup.existingClaimstringnilexisting claim
dumpBackup.image.pullPolicystring"IfNotPresent"image pull policy
dumpBackup.image.repositorystring"postgres"image used for the backups
dumpBackup.image.tagstring"latest"image pull tag
dumpBackup.resources.requests.cpustring"5m"requested cpu for backup
dumpBackup.resources.requests.memorystring"10Mi"requested memory for backup
dumpBackup.schedulestring"@daily"Backup schedule for postgres dumps
dumpBackup.subpathstringnilPersistent volume claim subpath for the backups @default: <subpathPrefix/
dumpBackup.subpathPrefixstring"backup/db"Persistent volume claim subpath prefix for the backups
dumpBackup.typestringnilSets the persistence type. Valid options are pvc, emptyDir, hostPath or custom. See common chart persistence doc
persistentVolumes.accessModes[0]string"ReadWriteOnce"
persistentVolumes.annotationsobject{}
persistentVolumes.hostPathstringnilLocal path for the persistent volumes @default: <hostPathPrefix/
persistentVolumes.hostPathPrefixstring"/run/db"Local prefix for persistent volumes NOTE: The default is in tempfs - you should change to a persistent place for production!!!
persistentVolumes.labelsobject{}
persistentVolumes.reclaimPolicystring"Retain"persistentVolumeReclaimPolicy for the persistent volumes Recicle will delete content once DB is deleted while Retain (default) will keep it.
persistentVolumes.replicaNodeslist["node1.example.com","node2.example.com"]Replica nodes Must set with at least 2 nodes for the cluster to be highly available
postgresql.databasesobject{"postgres":"postgres"}databases to create and their user
postgresql.numberOfInstancesstringnilNumber of replicas It will be automatically set with the number of replicaNodes so any values set here are ignored.
postgresql.postgresql.versionstring"13"Postgres version to deploy - see which versions are supported by the operator
postgresql.teamIdstringnilteam Id for the DB cluster
postgresql.usersobject{"postgres":["superuser","createdb"]}DB users to create (see operator)
postgresql.volume.sizestring"1Gi"Size of the persistance volume to allocate
postgresql.volume.storageClassstringchart fullnameName of the storage class
superuser.passwordstringrandomly generated on first install of the chartSuperuser password
superuser.secretstring..credentials.postgresql.acid.zalan.doSuperuser k8s secret name. It must match the patter used by the operator
superuser.userstringfirst user in postgresql.usersSuperuser user used for cronjobs

Changelog

Version 3.4.2

Added

N/A

Changed

  • Upgraded common chart dependency to version 4.5.2

Fixed

N/A

Older versions

A historical overview of changes can be found on ArtifactHUB

Support


Autogenerated from chart metadata using helm-docs v0.1.1

Deploy zalando-postgres-cluster with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has zalando-postgres-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 chartzalando-postgres-cluster is pinned at v3.4.2 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