pg-db

by Percona

Helm chartv3.1.0App 3.1.0

A Helm chart to deploy the PostgreSQL database with the Percona Operator for PostgreSQL

About this chart

Percona Distribution for PostgreSQL

This chart deploys Percona Distribution for PostgreSQL on Kubernetes controlled by Percona Operator.

Useful links:

Pre-requisites

Installation

This chart will deploy a PostgreSQL cluster in Kubernetes. It will create a Custom Resource, and the Operator will trigger the creation of corresponding Kubernetes primitives: Deployments, Pods, Secrets, etc. NOTE:

The PG Operator v2 is not directly compatible with old v1 so it is advised to always specify `--version`
when installing pg-operator or pg-db charts to not accidentally cause upgrade to v2 if you were using v1
previously.

Installing the Chart

To install the chart with the pg release name using a dedicated namespace (recommended):

helm repo add percona https://percona.github.io/percona-helm-charts/
helm install my-db percona/pg-db --version 3.1.0 --namespace my-namespace

The chart can be customized using the following configurable parameters:

ParameterDescriptionDefault
annotationsThe Kubernetes annotations for PerconaPGCluster``
finalizersFinalizers list[]
crVersionCR Cluster Manifest version3.1.0
metadata.annotationsThe Kubernetes annotations metadata to be set at a global level for all resources created by the Operator``
metadata.labelsThe Kubernetes labels metadata to be set at a global level for all resources created by the Operator``
repositoryPostgreSQL container image repositorydocker.io/percona/percona-distribution-postgresql
imagePostgres imagedocker.io/percona/percona-distribution-postgresql:18.6.1-1
imagePullPolicyimage Pull PolicyAlways
imagePullSecretsImage Pull Secrets[]
portPostgreSQL port5432
postgresVersionPostgreSQL container version tag18
pauseStop PostgreSQL Database safelyfalse
clusterServiceDNSSuffixThe (non-standard) cluster domain to be used as a suffix of the Service safely""
unmanagedStart cluster and don't manage it (cross cluster replication)false
standby.enabledSwitch/start PostgreSQL Database in standby modefalse
standby.hostHost address of the primary cluster this standby cluster connects to``
standby.portPort number used by a standby copy to connect to the primary cluster``
standby.repoNameName of the pgBackRest repository in the primary cluster this standby cluster connects to``
standby.maxAcceptableLagMaximum WAL lag allowed for the standby cluster, measured in bytes of WAL data``
customRootCATLSSecret.nameName of the secret with the custom root CA certificate and key for secure connections to the PostgreSQL server``
customRootCATLSSecret.itemsKey-value pairs of the key (a key from the secrets.customRootCATLSSecret.name secret) and the path (name on the file system) for the custom root certificate and key``
customTLSSecret.nameA secret with TLS certificate generated for external communications""
customReplicationTLSSecret.nameA secret with TLS certificate generated for internal communications""
tlsOnlySet to true to force all HBA records to use the hostssl record type.false
tls.caValidityDurationValidity duration for the generated Certificate Authority certificate (e.g. 87600h for 10 years)``
tls.certManagementPolicyCertificate management policy. auto - the operator creates and maintains TLS secrets. userProvidedOnly - the operator never generates or modifies TLS secretsauto
tls.certValidityDurationValidity duration for the generated leaf TLS certificates (e.g. 2160h for 90 days)``
tls.pgBackRestCertValidityDurationValidity duration for the generated pgBackRest TLS certificates (e.g. 2160h for 90 days)``
tls.issuerConf.nameName of the cert-manager Issuer or ClusterIssuer to use for issuing TLS certificates``
tls.issuerConf.kindKind of the issuer referenced in tls.issuerConf.name: Issuer or ClusterIssuerIssuer
tls.issuerConf.groupAPI group of the issuer referenced in tls.issuerConf.namecert-manager.io
openshiftSet to true if the cluster is being deployed on OpenShift, set to false otherwise, or unset it for autodetectionfalse
autoCreateUserSchemaWhether or not the cluster has schemas automatically created for the user defined in spec.users for all of the databases listed for that user.false
users.nameThe name of the PostgreSQL user""
users.databasesDatabases accessible by a specific PostgreSQL user with rights to create objects in them (the option is ignored for postgres user; also, modifying it can’t be used to revoke the already given access)[]
users.grantPublicSchemaAccessThis grants the user permission to create tables and update in the public schema of every database they own.false
users.optionsThe ALTER ROLE options other than password (the option is ignored for postgres user)""
users.password.typeThe set of characters used for password generation: can be either ASCII (default) or AlphaNumericASCII
users.secretNameUser secret name

Deploy pg-db with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has pg-db 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 chartpg-db is pinned at v3.1.0 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