Setting up PostgreSQL in OpenShift

You can connect to an external PostgreSQL database.

  1. 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: {} 		
  2. 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"
  3. In the pscconfigmap, change the value of the MQ_PSC_DB_HOST property to external-postgres-service or add the IP address of external PostgreSQL database.