Charmed PostgreSQL K8s
- Canonical
- Databases
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 20 | 20 Sep 2022 | |
14/stable | 445 | 12 Nov 2024 | |
14/stable | 444 | 12 Nov 2024 | |
14/candidate | 463 | 19 Nov 2024 | |
14/candidate | 462 | 19 Nov 2024 | |
14/beta | 463 | 19 Nov 2024 | |
14/beta | 462 | 19 Nov 2024 | |
14/edge | 465 | 20 Nov 2024 | |
14/edge | 464 | 20 Nov 2024 |
juju deploy postgresql-k8s --channel 14/stable
Deploy Kubernetes operators easily with Juju, the Universal Operator Lifecycle Manager. Need a Kubernetes cluster? Install MicroK8s to create a full CNCF-certified Kubernetes system in under 60 seconds.
Platform:
Integrate with a client application
This guide will show you how to integrate a client application with a cross-regional async setup using an example PostgreSQL K8s deployment with two servers: one in Rome and one in Lisbon.
Prerequisites
- Juju
v.3.4.2+
- Make sure your machine(s) fulfill the system requirements
- See supported target/source model relationships.
- A cross-regional async replication setup
Summary
Configure database endpoints
To make your database available to a client application, you must first offer and consume database endpoints.
Offer database endpoints
Offer the database
endpoint on each of the postgresql
applications.
juju switch rome
juju offer db1:database db1database
juju switch lisbon
juju offer db2:database db2database
Consume endpoints on client app
It is good practice to use a separate model for the client application rather than using one of the database host models.
juju add-model app
juju switch app
juju consume rome.db1database
juju consume lisbon.db2database
Internal client
If the client application is another charm, deploy them and connect them with juju integrate
.
juju switch app
juju deploy postgresql-test-app
juju deploy pgbouncer-k8s --trust --channel 1/stable
juju relate postgresql-test-app:first-database pgbouncer-k8s
juju relate pgbouncer-k8s db1database
External client
If the client application is external, they must be integrated via the data-integrator
charm.
juju switch app
juju deploy data-integrator --config database-name=mydatabase
juju deploy pgbouncer-k8s pgbouncer-external --trust --channel 1/stable
juju relate data-integrator pgbouncer-external
juju relate pgbouncer-external db1database
juju run data-integrator/leader get-credentials