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: README.md
+20-4Lines changed: 20 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@ To deploy on Kubernetes, please use [Charmed PostgreSQL K8s Operator](https://ch
12
12
This operator provides a PostgreSQL database with replication enabled: one primary instance and one (or more) hot standby replicas. The Operator in this repository is a Python script which wraps PostgreSQL versions distributed by Ubuntu Jammy series and adding [Patroni](https://github.com/zalando/patroni) on top of it, providing lifecycle management and handling events (install, configure, integrate, remove, etc).
13
13
14
14
## README contents
15
+
15
16
*[Basic usage](#basic-usage): Deploy and scale Charmerd PostgreSQL
16
17
*[Integrations](#integrations-relations): Supported interfaces for integrations
17
18
*[Contributing](#contributing)
@@ -20,6 +21,7 @@ This operator provides a PostgreSQL database with replication enabled: one prima
20
21
## Basic usage
21
22
22
23
### Deployment
24
+
23
25
Bootstrap a [lxd controller](https://juju.is/docs/olm/lxd#heading--create-a-controller) and create a new Juju model:
24
26
25
27
```shell
@@ -46,7 +48,9 @@ To add replicas to an existing deployment, see the [Add replicas](#add-replicas)
46
48
>It is generally recommended to have an odd number of units to avoid a "[split-brain](https://en.wikipedia.org/wiki/Split-brain_(computing))" scenario
47
49
48
50
### Primary replica
51
+
49
52
To retrieve the primary replica, use the action `get-primary` on any of the units running PostgreSQL.
53
+
50
54
```shell
51
55
juju run postgresql/leader get-primary
52
56
```
@@ -58,27 +62,33 @@ Similarly, the primary replica is displayed as a status message in `juju status`
58
62
#### Add replicas
59
63
60
64
To add more replicas one can use the `juju add-unit` functionality i.e.
The implementation of `add-unit` allows the operator to add more than one unit, but functions internally by adding one replica at a time. This is done to avoid multiple replicas syncing from the primary at the same time.
65
71
66
72
#### Remove replicas
67
73
68
74
To scale down the number of replicas the `juju remove-unit` functionality may be used i.e.
The implementation of `remove-unit` allows the operator to remove more than one unit. The functionality of `remove-unit` functions by removing one replica at a time to avoid downtime.
73
81
74
82
### Password rotation
75
83
76
84
#### Charm users
77
85
78
86
To rotate the password of users internal to the Charmed PostgreSQL operator, use the `set-password` action as follows:
87
+
79
88
```shell
80
89
juju run postgresql/leader set-password username=<user> password=<password>
81
90
```
91
+
82
92
>[!NOTE]
83
93
>Currently, internal users are `operator`, `replication`, `backup` and `rewind`. These users should not be used outside the operator.
84
94
@@ -90,7 +100,7 @@ To rotate the passwords of users created for integrated applications, the integr
We have also added support for the two database legacy relations from the [original version](https://launchpad.net/postgresql-charm) of the charm via the `pgsql` interface. Please note that these relations will be deprecated.
130
141
```shell
131
142
juju relate postgresql:db mailman3-core
132
143
juju relate postgresql:db-admin landscape-server
133
144
```
134
145
135
-
#### `tls-certificates` interface:
146
+
#### `tls-certificates` interface
136
147
137
148
The Charmed PostgreSQL Operator also supports TLS encryption on internal and external connections. Below is an example of enabling TLS with the [self-signed certificates charm](https://charmhub.io/self-signed-certificates).
>The TLS settings shown here are for self-signed-certificates, which are not recommended for production clusters. See the guide [Security with X.509 certificates](https://charmhub.io/topics/security-with-x-509-certificates) for an overview of available certificates charms.
151
163
152
164
## Security
153
-
Security issues in the Charmed PostgreSQL Operator can be reported through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File). Please do not use GitHub to submit security issues.
165
+
166
+
Security issues in the Charmed PostgreSQL Operator can be reported through [private security reports](https://github.com/canonical/postgresql-operator/security/advisories/new) on GitHub.
167
+
For more information, see the [Security policy](SECURITY.md).
154
168
155
169
## Contributing
170
+
156
171
* For best practices on how to write and contribute to charms, see the [Juju SDK docs](https://juju.is/docs/sdk/how-to)
157
172
* For more specific developer guidance for contributions to Charmed PostgreSQL, see the file [CONTRIBUTING.md](CONTRIBUTING.md)
158
173
* Report security issues for the Charmed PostgreSQL Operator through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File).
159
174
* Report technical issues, bug reports and feature requests through the [GitHub Issues tab](https://github.com/canonical/postgresql-operator/issues).
160
175
161
176
## Licensing and trademark
177
+
162
178
The Charmed PostgreSQL Operator is distributed under the [Apache Software License, version 2.0](https://github.com/canonical/postgresql-operator/blob/main/LICENSE). It installs, operates and depends on [PostgreSQL](https://www.postgresql.org/ftp/source/), which is licensed under the [PostgreSQL License](https://www.postgresql.org/about/licence/), a liberal Open Source license similar to the BSD or MIT licenses.
163
179
164
180
PostgreSQL is a trademark or registered trademark of PostgreSQL Global Development Group. Other trademarks are property of their respective owners.
This section contains pages with more detailed explanations that provide additional context about some of the key concepts behind the PostgreSQL charm:
3
+
This section contains pages with more detailed explanations that provide additional context about key concepts behind the PostgreSQL charm.
4
4
5
+
## Core concepts and design
5
6
*[Architecture]
6
7
*[Interfaces and endpoints]
8
+
*[Juju]
9
+
*[Legacy charm]
10
+
11
+
## Operational concepts
7
12
*[Connection pooling]
8
13
*[Users]
9
14
*[Logs]
10
-
*[Juju]
11
-
*[Legacy charm]
15
+
16
+
## Security and hardening
17
+
*[Security hardening guide][Security]
18
+
*[Cryptography]
19
+
12
20
13
21
<!-- Links -->
14
22
@@ -18,4 +26,6 @@ This section contains pages with more detailed explanations that provide additio
Copy file name to clipboardExpand all lines: docs/explanation/e-architecture.md
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,6 +75,10 @@ The snap "charmed-postgresql" also ships list of tools used by charm:
75
75
76
76
The charm "[PostgreSQL Test App](https://charmhub.io/postgresql-test-app)" is a Canonical test application to validate the charm installation / functionality and perform the basic performance tests.
77
77
78
+
### GLAuth
79
+
80
+
GLAuth is a secure, easy-to-use and open-sourced LDAP server which provides capabilities to centrally manage accounts across infrastructures. The charm is only available for Kubernetes clouds, under the [GLAuth-K8s operator](https://charmhub.io/glauth-k8s) page, so a cross-controller relation is needed in order to integrate both charms.
81
+
78
82
### Grafana
79
83
80
84
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](/t/10600) setup.
Copy file name to clipboardExpand all lines: docs/explanation/e-users.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,10 @@
1
1
# Charm Users explanations
2
2
3
-
There are two types of users in PostgreSQL:
3
+
There are three types of users in PostgreSQL:
4
4
* Internal users (used by charm operator)
5
-
* Relation/integration users (used by related applications)
5
+
* Relation users (used by related applications)
6
6
* Extra user roles (if default permissions are not enough)
7
+
* Identity users (used when LDAP is enabled)
7
8
8
9
<aname="internal-users"></a>
9
10
## Internal users explanations:
@@ -72,7 +73,7 @@ unit-postgresql-1:
72
73
**Note**: the action `set-password` must be executed on juju leader unit (to update peer relation data with new value).
73
74
74
75
<a name="relation-users"></a>
75
-
## Relation/integration users explanations:
76
+
## Relation users explanations:
76
77
77
78
The operator created a dedicated user for every application related/integrated with database. Those users are removed on the juju relation/integration removal request. However, DB data stays in place and can be reused on re-created relations (using new user credentials):
78
79
@@ -99,4 +100,10 @@ postgres=# \du
99
100
100
101
When an application charm requests a new user through the relation/integration it can specify that the user should have the `admin` role in the `extra-user-roles` field. The `admin` role enables the new user to read and write to all databases (for the `postgres` system database it can only read data) and also to create and delete non-system databases.
101
102
102
-
**Note**: `extra-user-roles` is supported by modern interface `postgresql_client` only and missing for legacy `pgsql` interface. Read more about the supported charm interfaces [here](/t/10251).
103
+
**Note**: `extra-user-roles` is supported by modern interface `postgresql_client` only and missing for legacy `pgsql` interface. Read more about the supported charm interfaces [here](/t/10251).
104
+
105
+
<a name="identity-users"></a>
106
+
## Identity users explanations:
107
+
The operator considers Identity users all those that are automatically created when the LDAP integration is enabled, or in other words, the [GLAuth](https://charmhub.io/glauth-k8s) charm is related/integrated.
108
+
109
+
When synchronized from the LDAP server, these users do not have any permissions by default, so the LDAP group they belonged to must be mapped to a PostgreSQL pre-defined authorization role by using the `ldap_map` configuration option.
0 commit comments