Setting up PostgreSQL in OpenShift
You can connect to an external PostgreSQL database.
- Create a service, for example:
kind: "Service" apiVersion: "v1" metadata: name: "external-postgres-service" spec: ports: - name: "external-postgres-service" protocol: "TCP" port: 5432 targetPort: 5432 nodePort: 0 selector: {}
- Create endpoint, for example:
kind: "Endpoints" apiVersion: "v1" metadata: name: "external-postgres-service" subsets: - addresses: - ip: "10.97.90.56" ports: - port: 5432 name: "external-postgres-service"
- In the
pscconfigmap
, change the value of theMQ_PSC_DB_HOST
property toexternal-postgres-service
or add the IP address of external PostgreSQL database.