Charmed PostgreSQL K8s
- By Canonical Data Platform
Channel | Revision | Published | Runs on |
---|---|---|---|
latest/stable | 20 | 20 Sep 2022 | |
14/stable | 73 | 18 Apr 2023 | |
14/candidate | 73 | 18 Apr 2023 | |
14/beta | 73 | 18 Apr 2023 | |
14/edge | 92 | Yesterday |
juju deploy postgresql-k8s --channel 14/stable
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:
Charm types “legacy” vs “modern”
There are two types of charms stored under the same charm name postgresql(-k8s)
:
-
Reactive charm in the channel
latest/stable
(calledlegacy
) -
Ops-based charm in the channel
14/stable
(calledmodern
)
The legacy charm provided endpoints db
and db-admin
(for the interface pgsql
). The modern charm provides old endpoints as well + new endpoint database
(for the interface postgresql_client
). Read more detail about the available endpoints/interfaces for VM and K8s charms.
Note: Please choose one endpoint to use. No need to relate all of them simultaneously!
The default track “latest” vs “14”
The default track has been switched from the latest
to 14
for both VM and K8s PostgreSQL charms. It is to ensure all new deployments use a modern codebase. We strongly advise against using the latest track due to its implicit nature. In doing so, a future charm upgrade may result in a PostgreSQL version incompatible with an integrated application. Track 14 guarantees PostgreSQL 14 deployment only. The track latest
will be closed after all applications migrated from Reactive to Ops-based charm.
How to migrate from “legacy” to “modern” charm
The “modern” charm provides temporary support for the legacy interfaces:
-
quick try: relate the current application with new charm using endpoint
db
(set the channel to14/stable
). No extra changes necessary:
postgresql:
charm: postgresql
channel: 14/stable
-
proper migration: migrate the application to the new interface “postgresql_client”. The application will connect PostgreSQL using “data_interfaces” library from “data-platform-libs” via endpoint
database
.
Warning: NO in-place upgrades possible! Reactive charm cannot be upgraded to Operator-framework-based one. To move DB data, the second/modern DB application must be launched nearby and data should be copied from “legacy” application to the “modern” one. Canonical Data Platform team is preparing copy&paste guide right now. Please contact us if you need migration instructions.
How to deploy old “legacy” postgresql charm
Deploy the charm using the channel latest/stable
:
postgresql:
charm: postgresql
channel: latest/stable
Note: remove Charm store prefix cs:
from the bundle. Otherwise the modern charm will be chosen by Juju (due to the default track pointing to 14/stable
and not latest/stable
). The common error message is: cannot deploy application "postgresql": unknown option "..."
.
Config options and Extensions support by modern charm
The modern charm does NOT support PostgreSQL config options and Extensions right now. Please contact us with a list of required config options and extensions (and/or legacy charm config options).
Supported PostgreSQL versions by modern charm
At the moment, both K8s and VM modern charms support PostgreSQL 14 (based on Jammy/22.04 series) only. Please contact us if you need different versions/series.
Help us improve this documentation
Most of this documentation can be collaboratively discussed and changed on the respective topic in the doc category of the Charmhub forum. See the documentation guidelines if you’d like to contribute.