Home > Storage > PowerFlex > White Papers > Replication using Container Storage Module with Dell PowerFlex > Deploying PostgreSQL
For demonstration purposes, the PostgreSQL database is installed on an OpenShift cluster. The pgbench tool, which is specially designed for PostgreSQL databases, is used for running workloads. The tool runs predefined patterns of database transactions and queries. The pgbench tool creates a workload that mimics the behavior of intensive real-world applications.
# helm repo add bitnami https://charts.bitnami.com/bitnami
# helm install my-release oci://registry-1.docker.io/bitnamicharts/postgresql --set global.storageClass=vxflexos-replication --set global.postgresql.auth.postgresPassword=password --set primary.persistentVolumeClaimRetentionPolicy.enabled=true --set primary.persistence.size=500Gi
A stateful-set application for the PostgreSQL database is installed.
# kubectl run my-release-postgresql-client --rm --tty -i --restart='Never' --namespace default --image docker.io/bitnami/postgresql:16.0.0-debian-11-r3 --env="PGPASSWORD=$POSTGRES_PASSWORD" --command -- psql --host my-release-postgresql -U postgres -d postgres -p 5432
# kubectl port-forward --namespace default svc/my-release-postgresql 5432:5432 & PGPASSWORD="$POSTGRES_PASSWORD" psql --host 127.0.0.1 -U postgres -d postgres -p 5432
# psql -h localhost -U postgres -d postgres -p 5432
# kubectl get rg -o yaml
# kubectl get pods
NAME READY STATUS RESTARTS AGE
my-release-postgresql-0 1/1 Running 0 7d18h
# ./repctl get pv
[2023-11-16 05:32:39] INFO listing persistent volumes
[2023-11-16 05:32:39] INFO []
[2023-11-16 05:32:39] INFO Cluster: primaryocp
+---------------------------------+
| PersistentVolume |
+---------------------------------+
Name RG SC PVC PVCNamespace rPVC rPVCNamespace
k8s-9c6fc11ef6 rg-cd6e544f-cf88-4486-899c-9c3b763b0113 vxflexos-replication data-my-release-postgresql-0 default N/A
[2023-11-16 05:32:39] INFO
[2023-11-16 05:32:39] INFO Cluster: secondaryocp
+---------------------------------+
| PersistentVolume |
+---------------------------------+
Name RG SC PVC PVCNamespace rPVC rPVCNamespace
k8s-9c6fc11ef6 rg-cd6e544f-cf88-4486-899c-9c3b763b0113 vxflexos-replication data-my-release-postgresql-0 default data-my-release-postgresql-0 default
[2023-11-16 05:32:39] INFO
# ./repctl get rg
[2023-11-16 05:32:42] INFO listing replication groups
[2023-11-16 05:32:42] INFO Cluster: primaryocp
+-----+
| RG |
+-----+
Name State rClusterID Driver RemoteRG IsSource LinkState
rg-cd6e544f-cf88-4486-899c-9c3b763b0113 Ready secondaryocp csi-vxflexos.dellemc.com rg-cd6e544f-cf88-4486-899c-9c3b763b0113 true FAILEDOVER
[2023-11-16 05:32:42] INFO
[2023-11-16 05:32:42] INFO Cluster: secondaryocp
+-----+
| RG |
+-----+
Name State rClusterID Driver RemoteRG IsSource LinkState
rg-cd6e544f-cf88-4486-899c-9c3b763b0113 Ready primaryocp csi-vxflexos.dellemc.com rg-cd6e544f-cf88-4486-899c-9c3b763b0113 false FAILEDOVER
[2023-11-16 05:32:42] INFO