-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs explaining how to connect to PSQL in various ways (#81)
* docs explaining how to connect to PSQL in various ways * fixing docs * Update docs/modules/ROOT/pages/vshn-managed/postgresql/connect.adoc Co-authored-by: lieneluksika <[email protected]> * Update docs/modules/ROOT/pages/vshn-managed/postgresql/connect.adoc Co-authored-by: lieneluksika <[email protected]> --------- Co-authored-by: [email protected] <[email protected]> Co-authored-by: lieneluksika <[email protected]>
- Loading branch information
1 parent
9d77f2a
commit d66c652
Showing
2 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
docs/modules/ROOT/pages/vshn-managed/postgresql/connect.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
== How to connect to Your instance == | ||
|
||
=== Problem | ||
|
||
You want to either connect to your PostgreSQL cluster from outside of the cluster or need to port-forward so that you can use your favorite database management tool. | ||
|
||
|
||
=== LoadBalancer | ||
|
||
WARNING: While using LoadBalancer additional charges may apply for additional IPv4 address. https://products.vshn.ch/appuio/cloud/pricing.html#_service_type_loadbalancer[Check pricing] | ||
|
||
LoadBalncer service type is supported on LPG-2 Appuio Cluster and You can use it by setting: | ||
``` | ||
apiVersion: vshn.appcat.vshn.io/v1 | ||
kind: VSHNPostgreSQL | ||
metadata: | ||
name: my-postgresql | ||
namespace: app1-dev | ||
spec: | ||
parameters: | ||
network: | ||
serviceType: LoadBalancer | ||
backup: | ||
deletionProtection: false | ||
writeConnectionSecretToRef: | ||
name: my-postgresql-dev-connection | ||
``` | ||
|
||
This YAML snippet would create a PostgreSQL cluster and Service of type LoadBalancer. The Service would be accessible from outside of the cluster. You can get IP address of the service using either: | ||
``` | ||
kubectl -n $instanceNamespace get service primary-service | ||
``` | ||
link:../how-tos/logging.adoc[Check how to find instanceNamespace] | ||
|
||
or access it directly from connection secret | ||
|
||
``` | ||
kubectl -n app1-dev get secrets my-postgresql-dev-connection -o yaml | yq .data.LOADBALANCER_IP | base64 -d | ||
``` | ||
|
||
=== Port-forward | ||
|
||
TIP: This is the default serviceType | ||
|
||
You can port-forward to your PostgreSQL cluster using kubectl port-forward command. This command works always, no matter what is set as serviceType. | ||
|
||
``` | ||
kubectl -n $instanceNamespace port-forward services/primary-service 5432 | ||
``` | ||
link:../how-tos/logging.adoc[Check how to find instanceNamespace] |