YAML layout to install the EnterpriseDB operator distribution and a small sample Cluster.
On Red Hat OpenShift, prefer Operator Lifecycle Manager (OLM) via db-deploy/olm-openshift/ (OperatorHub subscription flow). Use the manifest bundle under db-deploy/operator/ for a pinned YAML install without OperatorHub when you need non-OLM deployment.
| Path | Purpose |
|---|---|
olm-openshift/ |
Preferred on OpenShift: OLM Subscription (cluster-wide) and an example OperatorGroup + Subscription for scoped installs — EDB OpenShift / oc CLI. See olm-openshift/README.md. |
operator/kustomization.yaml |
Non-OLM manifest install: pinned operator manifest from get.enterprisedb.io (creates postgresql-operator-system and CRDs). |
sample-cluster/ |
Example namespace, app credentials secret, and Cluster CR (edb-postgres / postgresql). |
cross-cluster/ |
Passive replica (streaming) across two clusters: Route on primary + replica Cluster + script — see cross-cluster/README.md. |
kubectl/occonfigured for the target cluster (cluster-admin or equivalent to install operators and CRDs).- OpenShift (OLM): EDB pull secret in
openshift-operatorsand subscription steps — olm-openshift/README.md. - OpenShift (manifest install from
operator/only): if the controller pod fails on SCC, grant a suitable SCC topostgresql-operator-managerinpostgresql-operator-systemand restart the deployment — docs/openshift-edb-operator-smoke-test.md.
oc apply -k db-deploy/olm-openshiftVerify and complete pull-secret / CSV approval steps in olm-openshift/README.md. For multi-namespace or single-namespace operator placement, use olm-openshift/operatorgroup-multinamespace.example.yaml instead of the kustomize overlay.
Use server-side apply so large CRDs apply cleanly:
kubectl apply --server-side --force-conflicts -k db-deploy/operator
kubectl rollout status deployment/postgresql-operator-controller-manager \
-n postgresql-operator-system --timeout=300s- Set a strong password in
sample-cluster/base/app-db-credentials.secret.yaml. - Set
spec.storage.storageClassinsample-cluster/base/cluster.yamlif your cluster has no defaultStorageClass.
For EDB registry images, create edb-pull-secret (or your name) and either edit base/cluster.yaml to match base/cluster-edb-registry.yaml, or swap the filename in sample-cluster/base/kustomization.yaml resources.
Apply after the operator install is healthy (Cluster CRD available). The sample postgresql cluster uses spec.instances: 2 (primary + one hot standby in the same OpenShift cluster).
Base (omit storageClass and rely on the cluster default StorageClass):
kubectl apply -k db-deploy/sample-cluster
kubectl get cluster,pods -n edb-postgres -wOverlays (set spec.storage.storageClass for clusters without a suitable default). Kustomize’s default load restrictor blocks kubectl apply -k on these paths because they reference ../../base. Build with LoadRestrictionsNone, then apply:
kubectl kustomize --load-restrictor LoadRestrictionsNone db-deploy/sample-cluster/overlays/overlay-lvms-vg1 | kubectl apply -f -
# or CRC-style default SC:
kubectl kustomize --load-restrictor LoadRestrictionsNone db-deploy/sample-cluster/overlays/overlay-topolvm-provisioner | kubectl apply -f -OpenShift’s oc kustomize supports the same flag, for example:
oc kustomize --load-restrictor LoadRestrictionsNone db-deploy/sample-cluster/overlays/overlay-lvms-vg1 | oc apply -f -.
| Path | StorageClass |
|---|---|
db-deploy/sample-cluster/overlays/overlay-lvms-vg1 |
lvms-vg1 |
db-deploy/sample-cluster/overlays/overlay-topolvm-provisioner |
topolvm-provisioner |
Repeat OLM install + sample overlay on each OpenShift if you want two independent two-node Postgres clusters — use explicit --kubeconfig / --context per cluster. See olm-openshift/README.md.
Use cross-cluster/README.md for prerequisites, anonymity notes, and the full flow. Short version:
- Install the operator on both clusters; create a healthy primary
Cluster(e.g.db-deploy/sample-cluster/overlays). - Export
PRIMARY_CONTEXTandREPLICA_CONTEXT(and optional split kubeconfigs). - Run
db-deploy/cross-cluster/scripts/sync-passive-replica.sh.
Official reference: EDB — Replica clusters and EDB Postgres on OpenShift (operator docs).