PostgreSQL K8s
- By Canonical Data Platform
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 20 | 20 Sep 2022 | |
latest/edge | 59 | 24 Mar 2023 |
juju deploy postgresql-k8s
You will need Juju 2.9 to be able to run this command. Learn how to upgrade to Juju 2.9.
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:
PostgreSQL Operator
Description
Charm for Juju to deploy and manage PostgreSQL in a Kubernetes environment. Multiple units will provision a single master and remaining units as hot standby servers. Automatic failover will occur if a database goes down and there are enough remaining units for form a quorum, managed by repmgrd.
Usage
Provision a Juju environment and a k8s model on Juju 2.9-rc12 or later, per Juju documentation. Then to deploy 3 units (pods) using the default image, simply:
juju deploy -n3 postgresql-k8s
Client charms needing to connect with PostgreSQL should use the ops-lib-pgsql library to manage the relation.
Scale Out Usage
To horizontally scale, adding more read-only standbys:
juju add-unit postgresql-k8s
Note that this charm provides standard PostgreSQL, with a single read/write master node. Adding more nodes can only provide extra read-only capacity, and only to clients making use of the hot standby connection details (which will be load balanced over all available hot standby databases).
Testing
Just run make test
.
For more details, see here.