Managing EDB Postgres Distributed (PGD) databases v1
As described in the architecture document, EDB Postgres Distributed for Kubernetes is an operator created to deploy PGD databases. By leveraging the Kubernetes ecosystem, it can offer self-healing and declarative control. The operator is also responsible of the backup and restore operations. See Backup.
However, many of the operations and control of PGD clusters aren't managed by the operator. The pods created by EDB Postgres Distributed for Kubernetes come with the PGD CLI installed. You can use this tool, for example, to execute a switchover.
PGD CLI
Warning
Don't use the PGD CLI to create and delete resources. For example,
avoid the create-proxy
and delete-proxy
commands.
Provisioning of resources is under the control of the operator, and manual
creation and deletion isn't supported.
As an example, execute a switchover command.
We recommend that you use the PGD CLI from proxy pods. To find them, get a pod listing for your cluster:
The proxy nodes have proxy
in the name. Choose one, and get a command
prompt in it:
You now have a bash session open with the proxy pod. The pgd
command
is available:
You can easily move your way through getting the information needed for the switchover:
Accessing the database
In Use cases is a discussion on using the database within the Kubernetes cluster versus from outside. In Connectivity, you can find a discussion on services, which is relevant for accessing the database from applications.
However you implement your system, your applications must use the proxy service to connect to reap the benefits of PGD and of the increased self-healing capabilities added by the EDB Postgres Distributed for Kubernetes operator.
Important
As per the EDB Postgres for Kubernetes defaults, data nodes are
created with a database called app
and owned by a user named app
, in
contrast to the bdrdb
database described in the EDB Postgres
Distributed documentation. You can configure these values
in the cnp
section of the manifest.
For reference, see Bootstrap in the EDB Postgres for Kubernetes
documentation.
You might, however, want access to your PGD data nodes for administrative tasks, using the psql CLI.
You can get a pod listing
for your PGD cluster and kubectl exec
into a data node:
In the familiar territory of psql, remember that the default
created database is named app
(see previous warning).
For your applications, use the non-privileged role (app
by default).
You need the user credentials, which are stored in a Kubernetes secret:
This secret contains the username and password needed for the Postgres DSN, encoded in base64:
- On this page
- PGD CLI
- Accessing the database