Skip to content

Commit 2143112

Browse files
author
Jonathan S. Katz
committed
Add documentation about pgAdmin 4 integration
This provides general documentation for how the pgAdmin 4 integration works. This also fixes a reference in the installation docs.
1 parent 995c60b commit 2143112

File tree

5 files changed

+124
-1
lines changed

5 files changed

+124
-1
lines changed
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
---
2+
title: "pgAdmin 4"
3+
date:
4+
draft: false
5+
weight: 900
6+
---
7+
8+
![pgAdmin 4 Query](/images/pgadmin4-query.png)
9+
10+
[pgAdmin 4](https://www.pgadmin.org/) is a popular graphical user interface that
11+
makes it easy to work with PostgreSQL databases from both a desktop or web-based
12+
client. With its ability to manage and orchestrate changes for PostgreSQL users,
13+
the PostgreSQL Operator is a natural partner to keep a pgAdmin 4 environment
14+
synchronized with a PostgreSQL environment.
15+
16+
The PostgreSQL Operator lets you deploy a pgAdmin 4 environment alongside a
17+
PostgreSQL cluster and keeps users' database credentials synchronized. You can
18+
simply log into pgAdmin 4 with your PostgreSQL username and password and
19+
immediately have access to your databases.
20+
21+
## Deploying pgAdmin 4
22+
23+
For example, let's use a PostgreSQL cluster called hippo `hippo` that has a user
24+
named `hippo` with password `datalake`:
25+
26+
```
27+
pgo create cluster hippo --username=hippo --password=datalake
28+
```
29+
30+
After the PostgreSQL cluster becomes ready, you can create a pgAdmin 4
31+
deployment with the [`pgo create pgadmin`]({{< relref "/pgo-client/reference/pgo_create_pgadmin.md" >}})
32+
command:
33+
34+
```
35+
pgo create pgadmin hippo
36+
```
37+
38+
This creates a pgAdmin 4 deployment unique to this PostgreSQL cluster and
39+
synchronizes the PostgreSQL user information into it. To access pgAdmin 4, you
40+
can set up a port-forward to the Service, which follows the pattern `<clusterName>-pgadmin`, to port `5050`:
41+
42+
```
43+
kubectl port-forward svc/hippo-pgadmin 5050:5050
44+
```
45+
46+
Point your browser at `http://localhost:5050` and use your database
47+
username (e.g. `hippo`) and password (e.g. `datalake`) to log in. Though the
48+
prompt says "email address", using your PostgreSQL username will work.
49+
50+
![pgAdmin 4 Login Page](/images/pgadmin4-login.png)
51+
52+
(**Note**: if your password does not appear to work, you can retry setting up
53+
the user with the [`pgo update user`]({{< relref "/pgo-client/reference/pgo_update_user.md" >}})
54+
command: `pgo update user hippo --password=datalake`)
55+
56+
## User Synchronization
57+
58+
The [`pgo create user`]({{< relref "/pgo-client/reference/pgo_create_user.md" >}}),
59+
[`pgo update user`]({{< relref "/pgo-client/reference/pgo_update_user.md" >}}),
60+
and [`pgo delete user`]({{< relref "/pgo-client/reference/pgo_delete_user.md" >}})
61+
commands are synchronized with the pgAdmin 4 deployment. Note that if you use
62+
`pgo create user` without the `--managed` flag prior to deploying pgAdmin 4,
63+
then the user's credentials will not be synchronized to the pgAdmin 4
64+
deployment. However, a subsequent run of `pgo update user --password` will
65+
synchronize the credentials with pgAdmin 4.
66+
67+
## Deleting pgAdmin 4
68+
69+
You can remove the pgAdmin 4 deployment with the
70+
[`pgo delete pgadmin`]({{< relref "/pgo-client/reference/pgo_delete_pgadmin.md" >}})
71+
command.

docs/content/installation/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ weight: 40
88
There are several different ways to install and deploy the [PostgreSQL Operator](https://www.crunchydata.com/developers/download-postgres/containers/postgres-operator)
99
based upon your use case.
1010

11-
For the vast majority of use cases, we recommend using the [PostgreSQL Operator Installer]({{< relref "/installation/postgres-operator-installer/_index.md" >}}),
11+
For the vast majority of use cases, we recommend using the [PostgreSQL Operator Installer]({{< relref "/installation/postgres-operator/_index.md" >}}),
1212
which uses the `pgo-deployer` container to set up all of the objects required to
1313
run the PostgreSQL Operator.
1414

docs/content/pgo-client/common-tasks.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1039,6 +1039,58 @@ to how to do it from here. To find out more about how to
10391039
please refer to the [Custom PostgreSQL Configuration]({{< relref "/advanced/custom-configuration.md" >}})
10401040
section of the documentation.
10411041

1042+
## pgAdmin 4: PostgreSQL Administration
1043+
1044+
[pgAdmin 4](https://www.pgadmin.org/) is a popular graphical user interface that
1045+
lets you work with PostgreSQL databases from both a desktop or web-based client.
1046+
In the case of the PostgreSQL Operator, the pgAdmin 4 web client can be deployed
1047+
and synchronized with PostgreSQL clusters so that users can administrate their
1048+
databases with their PostgreSQL username and password.
1049+
1050+
For example, let's work with a PostgreSQL cluster called `hippo` that has a user named `hippo` with password `datalake`, e.g.:
1051+
1052+
```
1053+
pgo create cluster hippo --username=hippo --password=datalake
1054+
```
1055+
1056+
Once the `hippo` PostgreSQL cluster is ready, create the pgAdmin 4 deployment
1057+
with the [`pgo create pgadmin`]({{< relref "/pgo-client/reference/pgo_create_pgadmin.md" >}})
1058+
command:
1059+
1060+
```
1061+
pgo create pgadmin hippo
1062+
```
1063+
1064+
This creates a pgAdmin 4 deployment unique to this PostgreSQL cluster and
1065+
synchronizes the PostgreSQL user information into it. To access pgAdmin 4, you
1066+
can set up a port-forward to the Service, which follows the
1067+
pattern `<clusterName>-pgadmin`, to port `5050`:
1068+
1069+
```
1070+
kubectl port-forward svc/hippo-pgadmin 5050:5050
1071+
```
1072+
1073+
Point your browser at `http://localhost:5050` and use your database username
1074+
(e.g. `hippo`) and password (e.g. `datalake`) to log in.
1075+
1076+
![pgAdmin 4 Login Page](/images/pgadmin4-login.png)
1077+
1078+
(Note: if your password does not appear to work, you can retry setting up the
1079+
user with the [`pgo update user`]({{< relref "/pgo-client/reference/pgo_update_user.md" >}})
1080+
command: `pgo update user hippo --password=datalake`)
1081+
1082+
The `pgo create user`, `pgo update user`, and `pgo delete user` commands are
1083+
synchronized with the pgAdmin 4 deployment. Any user with credentials to this
1084+
PostgreSQL cluster will be able to log in and use pgAdmin 4:
1085+
1086+
![pgAdmin 4 Query](/images/pgadmin4-query.png)
1087+
1088+
You can remove the pgAdmin 4 deployment with the [`pgo delete pgadmin`]({{< relref "/pgo-client/reference/pgo_delete_pgadmin.md" >}})
1089+
command.
1090+
1091+
For more information, please read the [pgAdmin 4 Architecture]({{< relref "/architecture/pgadmin4.md" >}})
1092+
section of the documentation.
1093+
10421094
## Standby Clusters: Multi-Cluster Kubernetes Deployments
10431095

10441096
A [standby PostgreSQL cluster]({{< relref "/architecture/high-availability/multi-cluster-kubernetes.md" >}})
100 KB
Loading
86.6 KB
Loading

0 commit comments

Comments
 (0)