Examples
The examples show configuration files for setting up your PostgreSQL cluster.
Important
These examples are for demonstration and experimentation purposes. You can execute them on a personal Kubernetes cluster with Minikube or Kind, as described in Quick start.
Reference
For a list of available options, see API reference.
Basics
- Basic cluster
cluster-example.yamlA basic example of a cluster.- Custom cluster
cluster-example-custom.yamlA basic cluster that uses the default storage class and custom parameters for thepostgresql.confandpg_hba.conffiles.- Customized storage class
cluster-storage-class.yaml: A basic cluster that uses a specified storage class ofstandard.- Customized storage class and backups
- Prerequisites: bucket storage should be available. The sample config is for AWS, please change to suit your setup
cluster-storage-class-with-backup.yamla cluster with backups configured- Backup
- Prerequisites:
cluster-storage-class-with-backup.yamlapplied and Healthy backup-example.yaml: An example of a backup that runs against the previous sample.- Cluster with PVC (Persistent Volume Claim) configured
cluster-pvc-template.yaml: a basic cluster that with an explicit persistent volume claim template.- Full example
cluster-example-full.yaml: a cluster that sets most of the available options.- PostGIS example
postgis-example.yaml: an example of "PostGIS cluster" (see the PostGIS section for details.)- Replica cluster via streaming
- Prerequisites:
cluster-example.yamlapplied and Healthy cluster-example-replica-streaming.yaml: a replica cluster followingcluster-examplewith streaming replication.- Simple cluster with backup configured
- Prerequisites: The configuration assumes
miniois running and working. Please updatebackup.barmanObjectStorewith yourminioparameters or your cloud solution cluster-example-with-backup.yamlA basic cluster with backups configured.- Replica cluster via backup
- Prerequisites:
cluster-storage-class-with-backup.yamlapplied and Healthy. And a backupcluster-example-trigger-backup.yamlapplied and completed. cluster-example-replica-from-backup-simple.yaml: A replica cluster following a cluster with backup configured.- Bootstrap cluster with SQL files
cluster-example-initdb-sql-refs.yaml: a cluster example that will execute a set of queries defined in a Secret and a ConfigMap right after the database is created.- Sample cluster with customized
pg_hbaconfiguration cluster-example-pg-hba.yaml: a basic cluster that enables userappto authenticate using certificates.- Sample cluster with Secret and Configmap mounted using projected volume template
cluster-example-projected-volume.yamla basic cluster with existing Secret and Configmap mounted into Postgres pod using projected volume mount.- Cluster with declarative role management
cluster-example-with-roles.yaml: Declares a role with themanagedstanza. Includes password management with Kubernetes secrets.
For a list of available options, see API reference.