You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/explanation/architecture.md
+13-14Lines changed: 13 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,6 @@
4
4
5
5

6
6
7
-
<aname="hld"></a>
8
7
## HLD (High Level Design)
9
8
10
9
The charm design leverages on the SNAP “[charmed-postgresql](https://snapcraft.io/charmed-postgresql)” which is deployed by Juju on the specified VM/MAAS/bare-metal machine based on Ubuntu Jammy/22.04. SNAP allows to run PostgreSQL service(s) in a secure and isolated environment ([strict confinement](https://ubuntu.com/blog/demystifying-snap-confinement)). The installed SNAP:
@@ -56,7 +55,6 @@ The snap "charmed-postgresql" also ships list of tools used by charm:
56
55
All snap resources must be executed under the special snap user `_daemon_` only!
57
56
```
58
57
59
-
<aname="integrations"></a>
60
58
## Integrations
61
59
62
60
### PgBouncer
@@ -85,7 +83,7 @@ GLAuth is a secure, easy-to-use and open-sourced LDAP server which provides capa
85
83
86
84
### Grafana
87
85
88
-
Grafana is an open-source visualization tools that allows to query, visualize, alert on, and visualize metrics from mixed datasources in configurable dashboards for observability. This charms is shipped with its own Grafana dashboard and supports integration with the [Grafana Operator](https://charmhub.io/grafana-k8s) to simplify observability. Please follow [COS Monitoring](/how-to/monitoring-cos/enable-monitoring) setup.
86
+
Grafana is an open-source visualisation tools that allows to query, visualise, alert on, and visualise metrics from mixed data sources in configurable dashboards for observability. This charms is shipped with its own Grafana dashboard and supports integration with the [Grafana Operator](https://charmhub.io/grafana-k8s) to simplify observability. Please follow [COS Monitoring](/how-to/monitoring-cos/enable-monitoring) setup.
89
87
90
88
### Loki
91
89
@@ -97,7 +95,7 @@ Prometheus is an open-source systems monitoring and alerting toolkit with a dime
97
95
98
96
## LLD (Low Level Design)
99
97
100
-
Please check the charm state machines displayed in the [workflow diagrams](https://canonical-charmed-postgresql-k8s.readthedocs-hosted.com/14/explanation/flowcharts/). The low-level logic is mostly common for both VM and K8s charms.
98
+
Please check the charm state machines displayed in the [workflow diagrams](https://discourse.charmhub.io/t/charmed-postgresql-k8s-explanations-charm-flowcharts/9305). The low-level logic is mostly common for both VM and K8s charms.
101
99
102
100
<!--- TODO: Describe all possible installations? Cross-model/controller? --->
103
101
@@ -107,25 +105,26 @@ Accordingly to the [Juju SDK](https://juju.is/docs/sdk/event): “an event is a
107
105
108
106
For this charm, the following events are observed:
109
107
110
-
1.[`on_install`](https://juju.is/docs/sdk/install-event): install the snap "charmed-postgresql" and perform basic preparations to bootstrap the cluster on the first leader (or join the already configured cluster).
111
-
2.[`leader-elected`](https://juju.is/docs/sdk/leader-elected-event): generate all the secrets to bootstrap the cluster.
112
-
3.[`leader-settings-changed`](https://juju.is/docs/sdk/leader-settings-changed-event): Handle the leader settings changed event.
113
-
4.[`start`](https://juju.is/docs/sdk/start-event): Init/setting up the cluster node.
114
-
5.[`config_changed`](https://juju.is/docs/sdk/config-changed-event): usually fired in response to a configuration change using the GUI or CLI. Create and set default cluster and cluster-set names in the peer relation databag (on the leader only).
115
-
6.[`update-status`](https://juju.is/docs/sdk/update-status-event): Takes care of workload health checks.
108
+
1.[`on_install`](https://documentation.ubuntu.com/juju/3.6/reference/hook/#install): install the snap "charmed-postgresql" and perform basic preparations to bootstrap the cluster on the first leader (or join the already configured cluster).
109
+
2.[`leader-elected`](https://documentation.ubuntu.com/juju/3.6/reference/hook/#leader-elected): generate all the secrets to bootstrap the cluster.
110
+
3.[`leader-settings-changed`](https://documentation.ubuntu.com/juju/3.6/reference/hook/#leader-settings-changed): Handle the leader settings changed event.
111
+
4.[`start`](https://documentation.ubuntu.com/juju/3.6/reference/hook/#start): Init/setting up the cluster node.
112
+
5.[`config_changed`](https://documentation.ubuntu.com/juju/3.6/reference/hook/#config-changed): usually fired in response to a configuration change using the GUI or CLI. Create and set default cluster and cluster-set names in the peer relation databag (on the leader only).
113
+
6.[`update-status`](https://documentation.ubuntu.com/juju/3.6/reference/hook/#update-status): Takes care of workload health checks.
[`src/charm.py`](https://github.com/canonical/postgresql-operator/blob/main/src/charm.py) is the default entry point for a charm and has the `PostgresqlOperatorCharm` Python class which inherits from CharmBase.
120
+
[`src/charm.py`](https://github.com/canonical/postgresql-operator/blob/main/src/charm.py) is the default entry point for a charm and has the `PostgresqlOperatorCharm` Python class which inherits from `CharmBase`.
123
121
124
-
CharmBase is the base class from which all Charms are formed, defined by [Ops](https://juju.is/docs/sdk/ops) (Python framework for developing charms). See more information in [Charm](https://juju.is/docs/sdk/constructs#charm).
122
+
`CharmBase` is the base class from which all Charms are formed, defined by [Ops](https://ops.readthedocs.io/en/latest/) (Python framework for developing charms). See more information in the [Ops documentation for `CharmBase`](https://ops.readthedocs.io/en/latest/reference/ops.html#ops.CharmBase).
125
123
126
124
The `__init__` method guarantees that the charm observes all events relevant to its operation and handles them.
127
125
128
-
The VM and K8s charm flavors shares the codebase via [charm libraries](https://juju.is/docs/sdk/libraries) in [lib/charms/postgresql_k8s/v0/](https://github.com/canonical/postgresql-k8s-operator/blob/main/lib/charms/postgresql_k8s/v0/postgresql.py) (of K8s flavor of the charm!):
126
+
The VM and K8s charm flavours shares the codebase via charm libraries in [`lib/charms/postgresql_k8s/v0/`](https://github.com/canonical/postgresql-k8s-operator/blob/main/lib/charms/postgresql_k8s/v0/postgresql.py) (of K8s flavour of the charm!):
Copy file name to clipboardExpand all lines: docs/explanation/legacy-charm.md
+11-10Lines changed: 11 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,19 +1,19 @@
1
-
# Charm types: "legacy" vs "modern"
1
+
# Legacy charm
2
2
3
-
There are [two types of charms](https://juju.is/docs/sdk/charm-taxonomy#charm-types-by-generation) stored under the same charm name `postgresql`:
3
+
There are [two types of charms](https://documentation.ubuntu.com/juju/3.6/reference/charm/#by-generation) stored under the same charm name `postgresql`:
4
4
5
-
1.[Reactive](https://juju.is/docs/sdk/charm-taxonomy#reactive) charm in the channel `latest/stable` (called `legacy`)
6
-
2.[Ops-based](https://juju.is/docs/sdk/ops) charm in the channels`14/stable` and `16/stable` (called `modern`)
5
+
1.[Reactive](https://documentation.ubuntu.com/juju/3.6/reference/charm/#reactive) charm in the channel `latest/stable` (called `legacy`)
6
+
2.[Ops-based](https://documentation.ubuntu.com/juju/3.6/reference/charm/#ops) charm in the channel`14/stable` (called `modern`)
7
7
8
8
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 details about the available [endpoints/interfaces](/explanation/interfaces-and-endpoints).
9
9
10
10
```{note}
11
11
Choose one endpoint to use, rather than relating both simultaneously.
12
12
```
13
13
14
-
<!--TODO: Explain `latest` in the context of `16`-->
14
+
<!--TODO: Explain in the context of 16 -->
15
15
16
-
## The default track `latest` vs `14`
16
+
## The default track "latest" vs "14"
17
17
18
18
The [default track](https://docs.openstack.org/charm-guide/yoga/project/charm-delivery.html) has been switched from the `latest` to `14`. It is [to ensure](https://discourse.charmhub.io/t/request-switch-default-track-from-latest-to-14-for-postgresql-k8s-charms/10314) 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.
19
19
@@ -31,12 +31,13 @@ The "modern" charm provides temporary support for the legacy interfaces:
31
31
32
32
***proper migration**: migrate the application to the new interface "[postgresql_client](https://github.com/canonical/charm-relation-interfaces)". The application will connect PostgreSQL using "[data_interfaces](https://charmhub.io/data-platform-libs/libraries/data_interfaces)" library from "[data-platform-libs](https://github.com/canonical/data-platform-libs/)" via endpoint `database`.
33
33
34
+
34
35
```{warning}
35
36
**In-place upgrades are not supported for this case.**
36
37
37
38
Reactive charms cannot be upgraded to an operator-framework-based version. To move database data, the new DB application must be launched nearby, and data should be copied from "legacy" application to the "modern" one.
38
39
39
-
Please [contact us](https://chat.charmhub.io/charmhub/channels/data-platform) if you need migration instructions.
40
+
Please [contact us](/reference/contacts) if you need migration instructions.
40
41
```
41
42
42
43
## How to deploy old "legacy" PostgreSQL charm
@@ -49,7 +50,7 @@ Deploy the charm using the channel `latest/stable`:
49
50
channel: latest/stable
50
51
```
51
52
52
-
```{note}
53
+
```{caution}
53
54
Remove the charm store prefix `cs:` from the bundle.
54
55
55
56
Otherwise, the modern charm will be chosen by Juju (due to the default track pointing to `14/stable` and not `latest/stable`).
@@ -61,7 +62,7 @@ A common error message is: `cannot deploy application "postgresql": unknown opti
61
62
62
63
The legacy charm config options were not moved to the modern charm due to no need. The modern charm applies the best possible configuration automatically.
63
64
64
-
Feel free to [contact us](https://chat.charmhub.io/charmhub/channels/data-platform) about the DB tuning/config options.
65
+
Feel free to [contact us](/reference/contacts) about the DB tuning/config options.
65
66
66
67
## Extensions supported by modern charm
67
68
@@ -81,7 +82,7 @@ For more information about migrating the new interface, see [this guide](/how-to
81
82
82
83
At the moment, the modern charms support PostgreSQL 14 (based on Jammy/22.04 series) only.
83
84
84
-
Please [contact us](https://chat.charmhub.io/charmhub/channels/data-platform) if you need different versions/series.
85
+
Please [contact us](/reference/contacts) if you need different versions/series.
Copy file name to clipboardExpand all lines: docs/explanation/logs.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -98,5 +98,5 @@ Charmed PostgreSQL is configured to rotate PostgreSQL text logs every minute and
98
98
99
99
For PostgreSQL, logs will be truncated when the week turns and the same minute of the same hour of the same weekday comes to pass. E.g. at 12:01 UTC on Monday either a new log file will be created or last week's log will be overwritten.
100
100
101
-
Due to Patroni only supporting size based rotation, it has been configured to retain logs for a comparatively similar timeframe as PostgreSQL. The assumed size of a minute of Patroni logs is 600 bytes, but the estimation is bound to be imprecise. Patroni will retain 10,080 log files (for every minute of a week). The current log is `patroni.log`, when rotating Patroni will append a number to the name of the file and remove logs over the limit.
101
+
Due to Patroni only supporting size based rotation, it has been configured to retain logs for a comparatively similar time frame as PostgreSQL. The assumed size of a minute of Patroni logs is 600 bytes, but the estimation is bound to be imprecise. Patroni will retain 10,080 log files (for every minute of a week). The current log is `patroni.log`, when rotating Patroni will append a number to the name of the file and remove logs over the limit.
0 commit comments