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:

Backup flowcharts

This document contains backups management flowchart, including all major hooks. This sources can be found at src/backups.py.

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.

On S3 Credentials Changed Hook

Click to navigate the mermaid diagram on GitHub.

Mermaid Diagram

no

yes

no

yes

no

yes

yes

no

no

yes

no

yes

yes

no

yes

no

s3-credentials-changed Hook

Has cluster\n initialised?

defer

return

Are all required\nS3 settings provided?

Update backup settings

Is current\nunit leader?

Is unit in\nblocked state?

Could initialise\npgBackRest Stanza?

Set Blocked\nstatus

Is WAL archiving\nto S3 working?

Is TLS disabled or\nsingle unit cluster

Stop pgBackRest\nTLS server

Is current\nunit a replica\nand TLS server isn't\nrunning on primary?

Start pgBackRest\nTLS server

When certificates are received from TLS certificates operator through the certificates relation (or the relation is removed) the steps starting from Is TLS disabled or single unit cluster are also executed.

On Create Backup Hook

Click to navigate the mermaid diagram on GitHub.

Mermaid Diagram

yes

no

yes

no

yes

no

no

yes

no

yes

yes

no

no

yes

no

yes

no

no

yes

yes

no

yes

create-backup Hook

Is unit in\nblocked state?

fail action

Is primary in\na TLS enabled\nmultiple units cluster?

Is replica and\nwith TLS disabled?

Has stanza been initialised?

Is S3 relation\nestablished?

Has missing S3 parameters?

Was it possible\nto upload metadata file\nto test connectivity to S3?

Is current\nunit a replica?

Set Maintenance Status

Block new\nconnections to this\nunit's database

Has backup creation succeeded?

Upload error\nlogs to S3

fail action

Is current\nunit a replica?

Set Active Status

Allow new\nconnections to this\nunit's database

Were backup logs\nuploaded to S3?

backup created

On List Backups Hook

Click to navigate the mermaid diagram on GitHub.

Mermaid Diagram

no

yes

yes

no

no

yes

list-backups Hook

Is S3 relation\nestablished?

fail action

Has missing S3 parameters?

Does pgBackRest\nreturned the\nbackups list?

Return formatted\nbackup list

On Restore Hook

Click to navigate the mermaid diagram on GitHub.

Mermaid Diagram

no

yes

no

yes

yes

no

no

yes

no

yes

no

yes

no

yes

no

yes

restore Hook

Has user provided\na backup id?

fail action

Is workload\ncontainer accessible?

Is unit in\nblocked state?

Is single\nunit cluster?

Is current\nunit leader?

Is backup id\nvalid?

Set Maintenance Status

Has database\nstopped?

Was previous cluster\ninfo removed?

Start database again

Was the data\ndirectory emptied?

no

yes

Configure Patroni to restore the backup

Start the database

restore started

The unit status becomes Active or Blocked after a, respectively, successful or failed restore is detected in the update status hook.


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