cluster-percona

by startxfr

Helm chartv21.3.412App 3.1.0GPL-3.0-or-laterVerified publisher

Helm chart used to configure highly available PostgreSQL clusters using the Percona Operator for PostgreSQL (certified operator), with pgBackRest S3 backups, restore, PMM monitoring and network policies

About this chart

Cluster Chart : Percona

This helm chart is used to deploy PostgreSQL clusters managed by the Percona Operator for PostgreSQL (version 3, built on the Crunchy PGO engine, API pgv2.percona.com). Each entry of cluster.list is a PerconaPGCluster, from a single instance for development up to a highly available cluster for production: several instances with synchronous replication on distinct nodes, pgBackRest backups to an S3 bucket with point in time restore, pgBouncer, PMM monitoring, NetworkPolicy. The chart is used alone, or as the percona sub-chart of cluster-quay, which derives the database connection strings of the registry from the clusters listed here.

This chart is part of the cluster-xxx startx helm chart series that doesn't necessarily deploy pods but rather represent a cluster configuration state orchestrated by gitops tools like ArgoCD.

Requirements and guidelines

Read the startx helm-repository homepage for more information on how to use these resources.

RequirementDetail
OpenShift 4.19+ (Kubernetes 1.30+)kubeVersion of the chart; the operator 3.1.0 is certified for OpenShift 4.19 to 4.22
Percona Operator for PostgreSQL 3.1certified-operators catalog, package percona-postgresql-operator-certified, channel stable, installed by the operator sub-chart in the namespace of the clusters (OwnNamespace; every install mode is supported). Apache 2.0, free of charge; the support contract is optional
ImagesThe certified operator sets no default image: the chart passes the images of images (Percona Distribution for PostgreSQL 14 to 18, pgBackRest, pgBouncer, PMM client, Fluent Bit) to every cluster; mirror them in a disconnected environment
backup.type: s3An S3 compatible bucket reachable from the database pods, described in s3.list
monitoring.enabledA PMM 3 server reachable from the database pods and a service account token
SecretsPasswords, S3 credentials and PMM tokens are expected as Argo CD Vault Plugin placeholders (<path:kv/data/...#key>) or supplied by a values file kept out of Git; the chart never generates them

Deploy this helm chart on openshift

1. Connect to your Openshift cluster

oc login -t <token> <cluster-url>

2. Install the repository

helm repo add startx https://helm-repository.readthedocs.io/en/latest/repos/stable/

3. Get information about this chart

helm show chart startx/cluster-percona

4. Install this chart

helm install cluster-percona startx/cluster-percona

Step by step deployment with ArgoCD

1. Create the project

cat <<EOF | oc apply -f -
kind: Application
apiVersion: argoproj.io/v1alpha1
metadata:
name: percona-project
namespace: "openshift-gitops"
spec:
  destination:
    namespace: "default-percona"
    server: 'https://kubernetes.default.svc'
project: default
source:
    path: charts/cluster-percona/
    repoURL: 'https://gitlab.com/startx1/helm.git'
    targetRevision: 21.3.412
    helm:
    valueFiles:
    - values-demo.yaml
    parameters:
    - name: project.enabled
      value: "true"
EOF

2. Deploy the operator

cat <<EOF | oc apply -f -
kind: Application
apiVersion: argoproj.io/v1alpha1
metadata:
name: percona-operator
namespace: "openshift-gitops"
spec:
  destination:
    namespace: "default-percona"
    server: 'https://kubernetes.default.svc'
project: default
source:
    path: charts/cluster-percona/
    repoURL: 'https://gitlab.com/startx1/helm.git'
    targetRevision: 21.3.412
    helm:
    valueFiles:
    - values-demo.yaml
    parameters:
    - name: operator.enabled
      value: "true"
EOF

3. Deploy a percona instance

cat <<EOF | oc apply -f -
kind: Application
apiVersion: argoproj.io/v1alpha1
metadata:
name: percona-instance
namespace: "openshift-gitops"
spec:
  destination:
    namespace: "default-percona"
    server: 'https://kubernetes.default.svc'
project: default
source:
    path: charts/cluster-percona/
    repoURL: 'https://gitlab.com/startx1/helm.git'
    targetRevision: 21.3.412
    helm:
    valueFiles:
    - values-demo.yaml
    parameters:
    - name: cluster.enabled
      value: "true"
    - name: loader.enabled
      value: "true"
EOF

Default values

Complete deployment of a project with the following characteristics :

  • 1 namespace: named default-percona without constraints
  • 1 operator: named percona-postgresql-operator-certified configured with
    • The stable channel of the certified catalog
    • The v3.1.0 version
    • Deployed under the default-percona project
  • 1 cluster: named default-db configured with
    • PostgreSQL 18 (Percona Distribution image), one instance, a 2Gi data volume
    • a volume based pgBackRest repository with a full backup on Sunday and a differential backup the other days, 14 days of retention
    • one pgBouncer pod (Service default-db-pgbouncer), SCRAM authentication and TLS (operator defaults)
    • no monitoring, no log collector, no network policy
# Create the project
helm install cluster-percona-project startx/cluster-percona --set project.enabled=true,operator.enabled=false,cluster.enabled=false
# Deploy the percona operator
helm install cluster-percona-operator startx/cluster-percona --set project.enabled=false,operator.enabled=true,cluster.enabled=false && sleep 10
# Configure default percona resources
helm install cluster-percona-instance startx/cluster-percona --set project.enabled=false,operator.enabled=false,cluster.enabled=true

Values files

  • startx : Percona operator and a demo cluster (see values-startx.yaml)
  • startx-ha : one highly available cluster, two instances, synchronous replication, S3 backups, network policy (see values-startx-ha.yaml)
  • startx-quay : the two databases of a highly available Quay registry, used by the percona sub-chart of cluster-quay (see values-startx-quay.yaml)
  • demo : demo cluster (see values-demo.yaml)
  • values-startx_noinfra*.yaml : the same without the infra node placement of the operator
helm install cluster-percona startx/cluster-percona -f https://raw.githubusercontent.com/startxfr/helm-repository/master/charts/cluster-percona/values-startx.yaml

Values

Chart level

KeyDefaultDescription
crVersion""spec.crVersion of every cluster (empty: the appVersion of the chart). Keep it equal to the installed operator version: the operator enables the features of that version, and writes its own version into an object that has none, which Argo CD reports as a drift
images.postgres.<major>Percona Distribution for PostgreSQL 14 to 18PostgreSQL image of the clusters whose entry sets no image
images.pgbackrest, images.pgbouncer, images.pmm, images.logcollectorPercona images of the operator 3.1.0Images of the components, unless the entry sets its own

Cluster entries (cluster.list[])

Every key below the first entry of values.yaml is optional.

KeyDefaultDescription
name, enabled, namespacedefault-db, true, project nameName of the PerconaPGCluster, switch, namespace
postgresVersion, image18, ""Major version; the image is images.postgres.<postgresVersion> unless image is set
storageClassName, storageInstanceSize, storageBackupSize"", 2Gi, 2GiData volume (empty class: default StorageClass of the cluster), volume of the volume based repository
username, databasedefault-user, cluster nameOwner role and its database (users[0] of the cluster)
password""Owner password (secret). Empty: generated by the operator in the Secret <name>-pguser-<username>. Set: the chart renders that Secret and the operator computes the SCRAM verifier
extensions[]Extensions created in the database at initialization; ignored when initScript is set
initScript""Full databaseInitSQL script (ConfigMap <name>-initdb), takes precedence over extensions
replicas1Instances of the instance set instance1; 2 or more enables the Patroni failover
synchronousfalsePatroni synchronous_mode: no committed transaction lost at failover
avoidInfraNodesfalseRequired anti-affinity between the instances (one per node) and no scheduling on infra nodes, pgBouncer and backup jobs included
resources, parameters{}, {}Resources of each instance, postgresql.conf parameters (patroni.dynamicConfiguration)
pgHbaTrustfalsePassword-less connections from any address. false: operator defaults (SCRAM, TLS)
autoCreateUserSchemafalsePercona option creating a schema named after the owner in its database
pgbouncer.enabled, pgbouncer.replicas, pgbouncer.imagetrue, 1, ""pgBouncer pooler (Service <name>-pgbouncer)
builtinExtensions{}spec.extensions of the cluster as is: switches of the Percona built-in extensions (pg_stat_monitor, pg_stat_statements, pg_audit, pgvector, pg_repack, pg_cron, set_user, pg_tde) and custom extensions
istioSidecarEnabledfalseIstio sidecar annotations on the instances and the backup jobs
backup.enabled, backup.typetrue, volumepgBackRest repository: a volume (storageBackupSize) or an entry of s3.list (backup.s3). enabled: false removes pgBackRest from the cluster
backup.pathPrefix, backup.retentionDays, backup.schedulesnamespace, 14, Sunday 1:00 / other days 1:00S3 repository path /<prefix>/<name>/repo1, retention of the full backups in days, cron of the full and differential backups (differential: "" disables it)
backup.image""pgBackRest image (empty: images.pgbackrest)
restore.enabled, restore.s3, restore.source, restore.targetfalseBootstrap the cluster from the repository source (a repo1-path) of the endpoint s3 (empty: backup.s3), at target (empty: end of the archive). Read at cluster creation only
inPlaceRestore.enabled, inPlaceRestore.restoreName, inPlaceRestore.targetfalse, "", ""Restore in place of the running cluster: renders the PerconaPGRestore <name>-restore-<restoreName> (see Procedures)
monitoring.enabled, serverHost, token, existingSecret, querySource, imagefalse, monitoring-service, "", "", pgstatmonitor, ""PMM client sidecar on every instance: address of the PMM 3 server, service account token (secret, rendered in the Secret <name>-pmm-secret) or an existing Secret holding PMM_SERVER_TOKEN, query analytics source
logCollector.enabled, logCollector.imagefalse, ""Fluent Bit sidecar persisting the PostgreSQL and pgBackRest logs
networkPolicy.enabled, allowedNamespaces, operatorNamespacesfalseIngress policy on the database pods: same namespace, allowedNamespaces on 5432, operatorNamespaces on every port

S3 endpoints (s3.list[])

KeyDescription
name, namespaceName referenced by backup.s3 and restore.s3; namespace of the Secret <name>-pgbackrest-s3 (the namespace of the clusters)
endpoint, port, region, bucket, uriStyleEndpoint without scheme, port (empty: 443), signature region (required), bucket, path or host addressing
accessKey, secretKey, caCertCredentials (secret) and PEM of a private CA signing the endpoint certificate

Sub-charts

project (namespace) and operator (OLM subscription and OperatorGroup of the Percona operator) are the STARTX basic charts; see their documentation. The chart objects use Argo CD sync waves: Secrets and ConfigMaps (1), PerconaPGCluster and NetworkPolicy (15), PerconaPGRestore (30), loaders (35).

Differences with cluster-crunchy, which drives the same engine: the images are mandatory (images), monitoring goes through PMM instead of a PodMonitor and Prometheus alerts, on demand backups and in place restores are objects (PerconaPGBackup, PerconaPGRestore) instead of annotations, no pgAdmin, SCRAM and TLS by default, built-in extensions of the Percona distribution.

Procedures

Backups

# status of the cluster and of its backups
oc get pg startx-db -n default-percona
oc get pg-backup -n default-percona
# on demand full backup
cat <<EOF | oc apply -f -
apiVersion: pgv2.percona.com/v2
kind: PerconaPGBackup
metadata:
  name: startx-db-$(date +%Y%m%d%H%M)
  namespace: default-percona
spec:
  pgCluster: startx-db
  repoName: repo1
  options:
    - --type=full
EOF

Restore to a point in time, in place

Set inPlaceRestore.enabled: true, inPlaceRestore.restoreName: r1 and inPlaceRestore.target: "2026-10-15 14:00:00+00" on the cluster entry, apply (commit

Deploy cluster-percona with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has cluster-percona 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 chartcluster-percona is pinned at v21.3.412 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