Install highly available PostgreSQL¶
Install the Zalando Postgres Operator:
helm install postgres-operator postgres-operator --repo https://opensource.zalando.com/postgres-operator/charts/postgres-operator --set configGeneral.docker_image=registry.mirantis.com/msr/spilo:17-4.0-p3-20251117010013
Note
Alternatively, you can configure the deployment to use the default image provided in the upstream Zalando Postgres Operator community release:
helm install postgres-operator postgres-operator --repo https://opensource.zalando.com/postgres-operator/charts/postgres-operator
Create and configure the
msr-postgres-manifest.yamlfile:OpenShift deployments only
While the default PostgreSQL Operator settings allow the operator to run in a general Kubernetes environment, they are not sufficient for OpenShift. To ensure proper functionality, enable the
kubernetes_use_configmapsparameter. For details, refer to the Zalando Postgres Operator quickstart guide.Note
Adjust
numberOfInstancesto match your desired cluster size.apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: name: msr-postgres spec: teamId: "msr" volume: size: 1Gi numberOfInstances: 3 users: msr: # database owner - superuser - createdb databases: registry: msr # dbname: owner postgresql: version: "17"
If you are running RHEL 9.4 or later, exclude the
bg_monmodule from the PostgreSQL configuration as shown below. Refer to the Known issues for more details.apiVersion: "acid.zalan.do/v1" kind: postgresql metadata: name: msr-postgres spec: teamId: "msr" volume: size: 1Gi numberOfInstances: 3 users: msr: # database owner - superuser - createdb databases: registry: msr # dbname: owner postgresql: version: "17" parameters: shared_preload_libraries: "pg_stat_statements,pgextwlist,pg_auth_mon,set_user,timescaledb,pg_cron,pg_stat_kcache"
Deploy the Postgres instance:
kubectl create -f msr-postgres-manifest.yaml
Retrieve connection details for the Postgres service:
Get the service’s IP address:
kubectl get svc \ -l application=spilo,cluster-name=msr-postgres,spilo-role=master \ -o jsonpath={.items..spec.clusterIP}
Get the service’s port number:
kubectl get svc \ -l application=spilo,cluster-name=msr-postgres,spilo-role=master \ -o jsonpath={.items..spec.ports..port}
Upgrade highly available PostgreSQL¶
Verify the Zalando Postgres Operator image:
kubectl get operatorconfiguration.acid.zalan.do -o=jsonpath='{.items[0].configuration.docker_image}'
Perform the upgrade:
helm upgrade postgres-operator postgres-operator --repo https://opensource.zalando.com/postgres-operator/charts/postgres-operator --set configGeneral.docker_image=registry.mirantis.com/msr/spilo:17-4.0-p3-20251117010013