Enabling external access to the internal PostgreSQL database
If you plan to install DevOps Plan using the internal PostgreSQL database and need to access it through the DevOps Plan Designer or other supported
PostgreSQL tools, such as pgAdmin 4, you must enable external PostgreSQL access and configure
the exposed port during installation or upgrade. in the helm install or
helm upgrade command.
Procedure
-
Enable PostgreSQL access in the
helm installorhelm upgradecommand.--set postgresql.enableExternalAccess=true --set postgresql.service.exposePort=30106 --set control.postgresql.port=30106
On Azure Kubernetes Service (AKS) and Alazon Elastic Kubernetes Service (EKS), the external IP address is not the same as the Kubernetes node IP. You must explicitly provide the node's internal IP address when runninghelm installorhelm upgrade.- Retrieve the node internal IP
address.
NODE_IP=$(kubectl get nodes -o jsonpath='{.items[0].status.addresses[?(@.type=="InternalIP")].address}') - Pass the node IP to Helm by using the following option in your
helm installorhelm upgradecommand .--set postgresql.service.ipAddress=${NODE_IP}
On Google Kubernetes Engine (GKS), PostgreSQL must be exposed by using a LoadBalancer Service to obtain a public IP address. The external IP is assigned asynchronously after the service is created.- Include the following option in your
helm installorhelm upgradecommand.--set postgresql.service.cloudType=GKE - Wait for the PostgreSQL service to get an
EXTERNAL-IP.
kubectl get svc devopsplan-postgresql -n devopsplan - When you see an IP address under EXTERNAL-IP, capture
it.
PG_IP=$(kubectl get svc devopsplan-postgresql -n devopsplan \ -o jsonpath='{.status.loadBalancer.ingress[0].ip}') - Upgrade the Helm release and inject the external
IP.
helm upgrade hcl-devopsplan . \ --namespace devopsplan \ ... ... --set postgresql.service.ipAddress=${PG_IP}
- Retrieve the node internal IP
address.
-
After enabling external access, run the follwing command to view the PostgreSQL
connection details that are required to connect to the database.
helm status <release-name>This output includes the host, port, and other configuration variables needed to connect to the internal PostgreSQL instance.
- Host
- Use global.domain if using an Emissary-ingress Load Balancer.
- Port
- Use the value of postgresql.service.exposePort. The default value is 30106.
- Database
- postgres
- Username
- postgres
- Password
- To retrieve the password, run the following command, ensuring that the namespace
is set to
devopsplan.kubectl get secret --namespace devopsplan devopsplan-postgresql -o jsonpath="{.data.tenant-datastore-password}" | base64 -d; echo
-
To retrieve connection details from the DevOps Plan user interface, perform the
following steps.
- Open the Tenant Management page.
- Select the desired tenant.
- From the TeamSpace panel, select Details.
- Click Show connection properties.
- View the PostgreSQL connection details for the selected Tenant TeamSpace.