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
+62-46Lines changed: 62 additions & 46 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,70 +11,84 @@ To deploy on Kubernetes, please use [Charmed PostgreSQL K8s Operator](https://ch
11
11
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
-
## Usage
15
-
14
+
## README contents
15
+
*[Basic usage](#basic-usage): Deploy and scale Charmerd PostgreSQL
16
+
*[Integrations](#integrations-relations): Supported interfaces for integrations
17
+
*[Contributing](#contributing)
18
+
*[Licensing and trademark](#licensing-and-trademark)
19
+
20
+
## Basic usage
21
+
22
+
### Deployment
16
23
Bootstrap a [lxd controller](https://juju.is/docs/olm/lxd#heading--create-a-controller) and create a new Juju model:
17
24
18
25
```shell
19
-
juju add-model postgresql
26
+
juju add-model sample-model
20
27
```
21
28
22
-
### Basic Usage
23
-
To deploy a single unit of PostgreSQL using its default configuration.
29
+
To deploy a single unit of PostgreSQL using its [default configuration](config.yaml), run the following command:
24
30
25
31
```shell
26
-
juju deploy postgresql --channel edge
32
+
juju deploy postgresql --channel 14/stable
27
33
```
28
34
29
-
It is customary to use PostgreSQL with replication. Hence usually more than one unit (preferably an odd number to prohibit a "split-brain" scenario) is deployed. To deploy PostgreSQL with multiple replicas, specify the number of desired units with the `-n` option.
35
+
It is customary to use PostgreSQL with replication to ensure high availability. A replica is equivalent to a juju unit.
36
+
37
+
To deploy PostgreSQL with multiple replicas, specify the number of desired units with the `-n` option:
Similarly, the primary replica is displayed as a status message in `juju status`, however one
41
-
should note that this hook gets called on regular time intervals and the primary may be outdated if
42
-
the status hook has not been called recently.
54
+
Similarly, the primary replica is displayed as a status message in `juju status`. Note that this hook gets called at regular time intervals, so the primary may be outdated if the status hook has not been called recently.
43
55
44
56
### Replication
45
-
#### Adding Replicas
57
+
58
+
#### Add replicas
46
59
47
60
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, avoiding multiple replicas syncing from the primary at the same time.
64
+
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.
52
65
53
-
#### Removing Replicas
66
+
#### Remove replicas
54
67
55
-
Similarly to scale down the number of replicas the `juju remove-unit` functionality may be used i.e.
68
+
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.
60
73
61
74
### Password rotation
62
75
63
76
#### Charm users
64
77
65
-
For users used internally by the Charmed PostgreSQL Operator an action can be used to rotate their passwords.
78
+
To rotate the password of users internal to the Charmed PostgreSQL operator, use the `set-password` action as follows:
juju run postgresql/leader set-password username=<user> password=<password>
68
81
```
69
-
Note: currently, the users used by the operator are `operator`, `replication`, `backup` and `rewind`. Those users should not be used outside the operator.
82
+
>[!NOTE]
83
+
>Currently, internal users are `operator`, `replication`, `backup` and `rewind`. These users should not be used outside the operator.
70
84
71
-
#### Related applications users
85
+
#### Integrated (related) application users
72
86
73
-
To rotate the passwords of users created for related applications the relation should be removed and the application should be related again to the Charmed PostgreSQL Operator. That process will generate a new user and password for the application (removing the old user).
87
+
To rotate the passwords of users created for integrated applications, the integration to Charmed PostgreSQL should be removed and re-created. This process will generate a new user and password for the application (and remove the old user).
The Charmed PostgreSQL Operator also supports TLS encryption on internal and external connections. To enable TLS:
137
+
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).
Note: The TLS settings shown here are for self-signed-certificates, which are not recommended for production clusters. The TLS Certificates Operator offers a variety of configurations. Read more on the TLS Certificates Operator [here](https://charmhub.io/tls-certificates-operator).
149
+
>[!WARNING]
150
+
>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.
137
151
138
152
## Security
139
-
Security issues in the Charmed PostgreSQL Operator can be reported through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File). Please do not file GitHub issues about security issues.
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.
140
154
141
155
## Contributing
142
-
Please see the [Juju SDK docs](https://juju.is/docs/sdk) for guidelines on enhancements to this charm following best practice guidelines, and [CONTRIBUTING.md](https://github.com/canonical/postgresql-operator/blob/main/CONTRIBUTING.md) for developer guidance.
156
+
* For best practices on how to write and contribute to charms, see the [Juju SDK docs](https://juju.is/docs/sdk/how-to)
157
+
* For more specific developer guidance for contributions to Charmed PostgreSQL, see the file [CONTRIBUTING.md](CONTRIBUTING.md)
158
+
* Report security issues for the Charmed PostgreSQL Operator through [LaunchPad](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File).
159
+
* Report technical issues, bug reports and feature requests through the [GitHub Issues tab](https://github.com/canonical/postgresql-operator/issues).
143
160
144
-
## License
145
-
The Charmed PostgreSQL Operator [is distributed](https://github.com/canonical/postgresql-operator/blob/main/LICENSE) under the Apache Software License, version 2.0. It installs/operates/depends on [PostgreSQL](https://www.postgresql.org/ftp/source/), which [is licensed](https://www.postgresql.org/about/licence/) under PostgreSQL License, a liberal Open Source license, similar to the BSD or MIT licenses.
161
+
## Licensing and trademark
162
+
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.
146
163
147
-
## Trademark Notice
148
164
PostgreSQL is a trademark or registered trademark of PostgreSQL Global Development Group. Other trademarks are property of their respective owners.
0 commit comments