generated from bcgov/quickstart-openshift
-
Notifications
You must be signed in to change notification settings - Fork 1
Connect Openshift database from local pgAdmin
MCatherine edited this page May 16, 2024
·
1 revision
- From local terminal, login to Openshift using
oc
command
- To install the
oc
command line tool, you can download it from Openshift namespace
- To login, you can copy the login command from Openshift namespace
- Run the following command in the terminal
# switch to the namespace
oc project [namespace]
# port forward the pod
oc port-forward [postgres-db-pod] 4200:5432
- Open the PgAdmin on the local
- Right click on servers -> register -> server
- In the popup window, you can give any name you like. Under the connection tab:
- hostname: you can find this from the terminal when you do port forwarding
- port: 4200
- username: the database username we used to login to FOM db
- password: the database password, we can find from Openshift secrets
- Fill in the information and click save, the database should be added in pgAdmin
- Install PostGIS
- Right click the new db you added -> select “Query Tool” and run:
CREATE EXTENSION postgis;