postgresql-k8s

Charmed PostgreSQL K8s

Channel Revision Published Runs on
latest/stable 20 20 Sep 2022
Ubuntu 20.04
14/stable 495 18 Feb 2025
Ubuntu 22.04
14/stable 494 18 Feb 2025
Ubuntu 22.04
14/candidate 495 11 Feb 2025
Ubuntu 22.04
14/candidate 494 11 Feb 2025
Ubuntu 22.04
14/beta 495 06 Feb 2025
Ubuntu 22.04
14/beta 494 06 Feb 2025
Ubuntu 22.04
14/edge 549 28 Mar 2025
Ubuntu 22.04
14/edge 548 28 Mar 2025
Ubuntu 22.04
16/beta 525 19 Mar 2025
Ubuntu 24.04
16/beta 524 19 Mar 2025
Ubuntu 24.04
16/edge 551 Yesterday
Ubuntu 24.04
16/edge 550 Yesterday
Ubuntu 24.04
juju deploy postgresql-k8s --channel 14/stable
Show information

Platform:

Relations flowcharts

This reference documentation details the implementation of the database-peers peer relation. This is the peer relation for PostgreSQL, used to share user and config information from the leader unit to the follower units. The file implementing these relations can be found here: src/relations/charm.py (it should be moved to a file called src/relations/peers.py in the future).

Expected Interface

These are the expected contents of the databags in this relation (all values are examples, generated in a running test instance):

Hook Handler Flowcharts

These flowcharts detail the control flow of the hooks in this program. Unless otherwise stated, a hook deferral is always followed by a return.

Peer Relation Changed Hook

Click to navigate the mermaid diagram on GitHub.

Mermaid Diagram

no

yes

no

yes

yes

no

no

yes

no

yes

no

yes

peer-relation-changed Hook

Has cluster\n initialised?

defer

Is current\nunit leader?

Is current unit \n part of the cluster?

Are all the units \n part of the cluster?

Are all cluster \n members ready?

defer

Add unit to cluster

Patch pod labels of the new cluster member

return

Update Patroni and \n PostgreSQL config \n

Restart PostgreSQL \n if TLS is turned on/off

Have Patroni and \n PostgreSQL started in \n the current unit?

defer

Update the read-only endpoint \n in the database relation

Set Active\n Status

return

Peer Relation Departed Hook

Click to navigate the mermaid diagram on GitHub.

Mermaid Diagram

no

yes

no

yes

peer-relation-changed Hook

Is leader and \n is not departing?

return

Has cluster\n initialised?

defer

Update the read-only endpoint \n in the database relation

Remove departing units \n from the cluster

Turn on/off PostgreSQL \n synchronous_commit configuration

return


Help improve this document in the forum (guidelines). Last updated 1 year, 10 months ago.