airflow-postgresql-ha
by SVTECH-NMAA
This PostgreSQL cluster solution includes the PostgreSQL replication manager, an open-source tool for managing replication and failover on PostgreSQL clusters.
About this chart
PostgreSQL HA packaged by Bitnami
This PostgreSQL cluster solution includes the PostgreSQL replication manager, an open-source tool for managing replication and failover on PostgreSQL clusters.
Trademarks: This software listing is packaged by Bitnami. The respective trademarks mentioned in the offering are owned by the respective companies, and use of them does not imply any affiliation or endorsement.
TL;DR
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/postgresql-ha
Introduction
This Helm chart installs PostgreSQL with HA architecture in a Kubernetes cluster. Welcome to contribute to Helm Chart for PostgreSQL HA.
This Helm chart has been developed based on bitnami/postgresql chart but including some changes to guarantee high availability such as:
- A new deployment, service have been added to deploy Pgpool-II to act as proxy for PostgreSQL backend. It helps to reduce connection overhead, acts as a load balancer for PostgreSQL, and ensures database node failover.
- Replacing
bitnami/postgresqlwithbitnamilegacy/postgresql-repmgrwhich includes and configures repmgr. Repmgr ensures standby nodes assume the primary role when the primary node is unhealthy.
Bitnami charts can be used with Kubeapps for deployment and management of Helm Charts in clusters.
Prerequisites
- Kubernetes 1.19+
- Helm 3.2.0+
Installing the Chart
Install the PostgreSQL HA helm chart with a release name my-release:
$ helm repo add bitnami https://charts.bitnami.com/bitnami
$ helm install my-release bitnami/postgresql-ha
Uninstalling the Chart
To uninstall/delete the my-release deployment:
$ helm delete --purge my-release
Additionally, if persistence.resourcePolicy is set to keep, you should manually delete the PVCs.
Parameters
Global parameters
| Name | Description | Value |
|---|---|---|
global.imageRegistry | Global Docker image registry | "" |
global.imagePullSecrets | Global Docker registry secret names as an array | [] |
global.storageClass | Global StorageClass for Persistent Volume(s) | "" |
global.postgresql.username | PostgreSQL username (overrides postgresql.username) | "" |
global.postgresql.password | PostgreSQL password (overrides postgresql.password) | "" |
global.postgresql.database | PostgreSQL database (overrides postgresql.database) | "" |
global.postgresql.repmgrUsername | PostgreSQL repmgr username (overrides postgresql.repmgrUsername) | "" |
global.postgresql.repmgrPassword | PostgreSQL repmgr password (overrides postgresql.repmgrpassword) | "" |
global.postgresql.repmgrDatabase | PostgreSQL repmgr database (overrides postgresql.repmgrDatabase) | "" |
global.postgresql.existingSecret | Name of existing secret to use for PostgreSQL passwords (overrides postgresql.existingSecret) | "" |
global.ldap.bindpw | LDAP bind password (overrides ldap.bindpw) | "" |
global.ldap.existingSecret | Name of existing secret to use for LDAP passwords (overrides ldap.existingSecret) | "" |
global.pgpool.adminUsername | Pgpool Admin username (overrides pgpool.adminUsername) | "" |
global.pgpool.adminPassword | Pgpool Admin password (overrides pgpool.adminPassword) | "" |
global.pgpool.existingSecret | Pgpool existing secret | "" |
Common parameters
| Name | Description | Value |
|---|---|---|
kubeVersion | Override Kubernetes version | "" |
nameOverride | String to partially override common.names.fullname template (will maintain the release name) | "" |
fullnameOverride | String to fully override common.names.fullname template | "" |
namespaceOverride | String to fully override common.names.namespace | "" |
commonLabels | Common labels to add to all resources (sub-charts are not considered). Evaluated as a template | {} |
commonAnnotations | Common annotations to add to all resources (sub-charts are not considered). Evaluated as a template | {} |
clusterDomain | Kubernetes Cluster Domain | cluster.local |
extraDeploy | Array of extra objects to deploy with the release (evaluated as a template) | [] |
diagnosticMode.enabled | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | false |
diagnosticMode.command | Command to override all containers in the deployment | [] |
diagnosticMode.args | Args to override all containers in the deployment | [] |
PostgreSQL with Repmgr parameters
| Name | Description | Value |
|---|---|---|
postgresql.image.registry | PostgreSQL with Repmgr image registry | docker.io |
postgresql.image.repository | PostgreSQL with Repmgr image repository | bitnamilegacy/postgresql-repmgr |
postgresql.image.tag | PostgreSQL with Repmgr image tag | 14.5.0-debian-11-r6 |
postgresql.image.digest | PostgreSQL image digest in the way sha256:aa.... Please note this parameter, if set, will override the tag | "" |
postgresql.image.pullPolicy | PostgreSQL with Repmgr image pull policy | IfNotPresent |
postgresql.image.pullSecrets | Specify docker-registry secret names as an array | [] |
postgresql.image.debug | Specify if debug logs should be enabled | false |
postgresql.labels | Labels to add to the StatefulSet. Evaluated as template | {} |
postgresql.podLabels | Labels to add to the StatefulSet pods. Evaluated as template | {} |
postgresql.replicaCount | Number of replicas to deploy. Use an odd number. Having 3 replicas is the minimum to get quorum when promoting a new primary. | 3 |
postgresql.updateStrategy.type | Postgresql statefulset strategy type | RollingUpdate |
postgresql.containerPorts.postgresql | PostgreSQL port | 5432 |
postgresql.hostAliases | Deployment pod host aliases | [] |
postgresql.hostNetwork | Specify if host network should be enabled for PostgreSQL pod | false |
postgresql.hostIPC | Specify if host IPC should be enabled for PostgreSQL pod | false |
postgresql.podAnnotations | Additional pod annotations | {} |
postgresql.podAffinityPreset | PostgreSQL pod affinity preset. Ignored if postgresql.affinity is set. Allowed values: soft or hard | "" |
postgresql.podAntiAffinityPreset | PostgreSQL pod anti-affinity preset. Ignored if postgresql.affinity is set. Allowed values: soft or hard | soft |
postgresql.nodeAffinityPreset.type | PostgreSQL node affinity preset type. Ignored if postgresql.affinity is set. Allowed values: soft or hard | "" |
postgresql.nodeAffinityPreset.key | PostgreSQL node label key to match Ignored if postgresql.affinity is set. | "" |
postgresql.nodeAffinityPreset.values | PostgreSQL node label values to match. Ignored if postgresql.affinity is set. | [] |
postgresql.affinity | Affinity for PostgreSQL pods assignment |
Deploy airflow-postgresql-ha with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has airflow-postgresql-ha 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.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartairflow-postgresql-ha is pinned at v9.10.7 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- 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