diff --git a/docs/explanation.md b/docs/explanation.md index 8fc131b9e6..05c2add64e 100644 --- a/docs/explanation.md +++ b/docs/explanation.md @@ -1,14 +1,22 @@ # Explanation -This section contains pages with more detailed explanations that provide additional context about some of the key concepts behind the PostgreSQL charm: +This section contains pages with more detailed explanations that provide additional context about key concepts behind the PostgreSQL charm. +## Core concepts and design * [Architecture] * [Interfaces and endpoints] +* [Juju] +* [Legacy charm] + +## Operational concepts * [Connection pooling] * [Users] * [Logs] -* [Juju] -* [Legacy charm] + +## Security and hardening +* [Security hardening guide][Security] + * [Cryptography] + @@ -18,4 +26,6 @@ This section contains pages with more detailed explanations that provide additio [Logs]: /t/12099 [Juju]: /t/11985 [Legacy charm]: /t/10690 -[Connection pooling]: /t/15777 \ No newline at end of file +[Connection pooling]: /t/15777 +[Security]: /t/16852 +[Cryptography]: /t/16853 \ No newline at end of file diff --git a/docs/explanation/e-architecture.md b/docs/explanation/e-architecture.md index 25beb72f43..2a9885f514 100644 --- a/docs/explanation/e-architecture.md +++ b/docs/explanation/e-architecture.md @@ -75,6 +75,10 @@ The snap "charmed-postgresql" also ships list of tools used by charm: 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. +### GLAuth + +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. + ### Grafana 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. diff --git a/docs/explanation/e-users.md b/docs/explanation/e-users.md index 2a2c85d186..f0f9ce86da 100644 --- a/docs/explanation/e-users.md +++ b/docs/explanation/e-users.md @@ -1,9 +1,10 @@ # Charm Users explanations -There are two types of users in PostgreSQL: +There are three types of users in PostgreSQL: * Internal users (used by charm operator) -* Relation/integration users (used by related applications) +* Relation users (used by related applications) * Extra user roles (if default permissions are not enough) +* Identity users (used when LDAP is enabled) ## Internal users explanations: @@ -72,7 +73,7 @@ unit-postgresql-1: **Note**: the action `set-password` must be executed on juju leader unit (to update peer relation data with new value). -## Relation/integration users explanations: +## Relation users explanations: 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): @@ -99,4 +100,10 @@ postgres=# \du 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. -**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). \ No newline at end of file +**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). + + +## Identity users explanations: +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. + +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. \ No newline at end of file diff --git a/docs/how-to.md b/docs/how-to.md index 497d33ce18..c21e3a5086 100644 --- a/docs/how-to.md +++ b/docs/how-to.md @@ -4,7 +4,7 @@ The following guides cover key processes and common tasks for managing and using ## Deployment and setup -The following guides walk you through the details of how to install different cloud services and bootstrap them to Juju: +Installation of different cloud services with Juju: * [Sunbeam] * [LXD] * [MAAS] @@ -13,7 +13,7 @@ The following guides walk you through the details of how to install different cl * [Azure] * [Multi-availability zones (AZ)][Multi-AZ] -The following guides cover some specific deployment scenarios and architectures: +Specific deployment scenarios and architectures: * [Terraform] * [Air-gapped] * [TLS VIP access] @@ -54,7 +54,7 @@ The following guides cover some specific deployment scenarios and architectures: ## Development -This section is aimed at charm developers looking to support PostgreSQL integrations with their charm. +This section is for charm developers looking to support PostgreSQL integrations with their charm. * [Integrate with your charm] * [Migrate data via pg_dump] diff --git a/docs/how-to/h-deploy.md b/docs/how-to/h-deploy.md index 4769d863c6..f73fcb80ac 100644 --- a/docs/how-to/h-deploy.md +++ b/docs/how-to/h-deploy.md @@ -21,7 +21,7 @@ Then, either continue with the `juju` client **or** use the `terraform juju` cli To deploy with the `juju` client: ```shell -juju deploy postgresql +juju deploy postgresql -n ``` > See also: [`juju deploy` command](https://canonical-juju.readthedocs-hosted.com/en/latest/user/reference/juju-cli/list-of-juju-cli-commands/deploy/) diff --git a/docs/how-to/h-enable-profiling.md b/docs/how-to/h-enable-profiling.md new file mode 100644 index 0000000000..aabc52bc34 --- /dev/null +++ b/docs/how-to/h-enable-profiling.md @@ -0,0 +1,174 @@ +[note] +**Note**: All commands are written for `juju >= v3.1` + +If you're using `juju 2.9`, check the [`juju 3.0` Release Notes](https://juju.is/docs/juju/roadmap#heading--juju-3-0-0---22-oct-2022). +[/note] + +# Enable profiling with Parca + +This guide contains the steps to enable profiling with [Parca](https://www.parca.dev/docs/overview/) for your PostgreSQL application. + +## Summary +* [Prerequisites](#prerequisites) +* [Set up the Parca backend](#set-up-the-parca-backend) + * [Charmed Parca K8s](#charmed-parca-k8s) + * [Polar Signals Cloud](#polar-signals-cloud) +* [View profiles](#view-profiles) + +--- + +## Prerequisites + +[note type=caution] +**Do not skip this section** if you are deploying PostgreSQL in an LXD model or if your base is `ubuntu@22.04`. +[/note] + + +This guide assumes you already have a juju model with Charmed PostgreSQL deployed. + +> See: [How to deploy PostgreSQL](/t/16811) + +In order for your Charmed PostgreSQL deployment to be correctly set up for integration with Parca, there are two important considerations: +* [LXD virtualization type](#lxd-virtualization-type) +* [Base (Ubuntu version)](#base-ubuntu-version) + +### LXD virtualization type + +**If you are deploying Charmed PostgreSQL in a LXD model, you will need to ensure that LXD's virtualization type is set to `virtual-machine` for the Juju application.** + +This is because LXD does not allow `/sys/kernel/tracing` to be mounted in a system container (even in privileged mode) due to security isolation concerns. + +To ensure that a virtual machine is used instead of a system container, you would need to add constraints, for example: +``` +juju deploy postgresql --constraints="virt-type=virtual-machine"`. +``` + +### Base (Ubuntu version) +**If your base is `ubuntu@22.04`, you will need to ensure that your are using the `generic` flavor of Linux.** +> See the output of `uname -r` to confirm. + +If you do not have the `generic` flavor, you can enable it on a unit to be profiled as follows: + +``` +juju ssh postgresql/0 bash +sudo apt-get update && sudo apt-get install linux-image-virtual +sudo apt-get autopurge linux-image-kvm +``` + +If your application is deployed in an LXD model, run the following command: +``` +rm /etc/default/grub.d/40-force-partuuid.cfg +``` + +Open the `/etc/default/grub` file with your editor of choice and replace the line that starts with `GRUB_DEFAULT=` with: +``` +release=$(linux-version list | grep -e '-generic$' | sort -V | tail -n1) +GRUB_DEFAULT="Advanced options for Ubuntu>Ubuntu, with Linux $release" +``` + +Exit out of the `/etc/default/grub file`, update GRUB, and reboot: +``` +sudo update-grub +sudo reboot +``` + +Nothing needs to be done if the base is `ubuntu@24.04`, which already loads the kernel symbol table for debugging by default. + +## Set up the Parca backend + +There are two potential backends: +* [Charmed Parca K8s](#charmed-parca-k8s) (requires COS and cross-model integrations) +* [Polar Signals Cloud](#polar-signals-cloud) (COS is optional) + +### Charmed Parca K8s + +This section goes through the steps for enabling profiling with Charmed Parca K8s as the backend. + +#### 1. Deploy `cos-lite` and `parca-k8s` + +Refer to [Getting started on MicroK8s](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s) and deploy the `cos-lite` bundle from the `latest/edge` track in a Kubernetes environment. + +Then, refer to [Deploy Charmed Parca on top of COS-lite](https://discourse.charmhub.io/t/how-to-deploy-charmed-parca-on-top-of-cos-lite/16579) to deploy Charmed Parca K8s in the same model as the `cos-lite` bundle. + +#### 2. Offer interfaces + +Offer interfaces for cross-model integrations: + +``` +juju offer :parca-store-endpoint +``` + +#### 3. Deploy and integrate `parca-agent` with `postgresql` + +Switch to the model containing the Charmed PostgreSQL deployment, deploy Charmed Parca Agent, and integrate it with Charmed PostgreSQL: + +``` +juju switch : + +juju deploy parca-agent --channel latest/edge +juju integrate postgresql parca-agent +``` + +#### 4. Integrate `parca-agent` with `parca-k8s` + +Consume the parca offer from [Step 2](#2-offer-interfaces) and integrate with them: + +``` +juju find-offers : +``` + +> :exclamation: Do not miss the colon "`:`" in the command above. + +Below is a sample output where `k8s` is the K8s controller name and `cos` is the model where `cos-lite` and `parca-k8s` are deployed: + +``` +Store URL Access Interfaces +k8s admin/cos.parca admin parca_store:parca-store-endpoint +``` + +Next, consume this offer so that is reachable from the current machine model: + +``` +juju consume k8s:admin/cos.parca +``` + +Finally, relate Charmed Parca Agent with the consumed offer endpoint: +``` +juju integrate parca-agent parca +``` + +### Polar Signals Cloud + +This section goes through the steps for enabling profiling with Polar Signals Cloud (PSC) as the backend. + +[note] +With PSC, `cos-lite` and `parca-k8s` are not required. This section goes through the recommended setup, where `polar-signals-cloud-integrator` is deployed in the same model as `postgresql`, and `parca-agent` is used to relay traffic to PSC. + +If you would like to use `parca-k8s` to relay traffic to PSC instead, refer to [Steps 1 and 2](#1-deploy-cos-lite-and-parca-k8s) in the Charmed Parca K8s section. +[/note] + +#### 1. Deploy and integrate `parca-agent` with `postgresql` + +In the machine model where PostgreSQL is deployed, deploy `parca-agent` and integrate it with `postgresql`: + +``` +juju deploy parca-agent --channel latest/edge +juju integrate postgresql parca-agent +``` + +#### 2. Integrate `parca-agent` with `polar-signals-cloud-integrator` + +Follow the guide [How to integrate with Polar Signals Cloud](https://discourse.charmhub.io/t/charmed-parca-docs-how-to-integrate-with-polar-signals-cloud/16559). + + +## View profiles + +After the backend setup is complete, the profiles for the machines where the PostgreSQL units are running will be accessible from the Parca web interface. + +If you are running Charmed Parca K8s, you can also access the link for Parca's web interface from COS catalogue (`juju run traefik/0 show-proxied-endpoints` in the K8s model where `cos-lite` is deployed). + +![Example profile with Parca Web UI690x753](upload://zFOOKY8nokrg2Q4xUVTbD8UGjD3.png) + +Furthermore, if you have `cos-lite` deployed, you can use Grafana to explore profiles under the `Explore` section with `parca-k8s` as the data source. + +![Example profile with Grafana's Parca plugin|690x383](upload://w3G5STYOxMZHCpIA48gEJHUniLi.jpeg) \ No newline at end of file diff --git a/docs/how-to/h-enable-tls.md b/docs/how-to/h-enable-tls.md index c8d8640870..c5a872288d 100644 --- a/docs/how-to/h-enable-tls.md +++ b/docs/how-to/h-enable-tls.md @@ -32,15 +32,9 @@ First, deploy the TLS charm: juju deploy self-signed-certificates ``` -To enable TLS on `postgresql`, integrate the two applications: +To enable TLS integrate (formerly known as “relate”) the two applications: ```shell -juju integrate self-signed-certificates postgresql -``` - -## Disable TLS -Disable TLS by removing the integration. -```shell -juju remove-relation self-signed-certificates postgresql +juju integrate postgresql:certificates self-signed-certificates:certificates ``` ## Check certificates in use @@ -79,4 +73,10 @@ Updates can also be done with auto-generated keys: juju run postgresql/0 set-tls-private-key juju run postgresql/1 set-tls-private-key juju run postgresql/2 set-tls-private-key +``` + +## Disable TLS +Disable TLS by removing the integration. +```shell +juju remove-relation postgresql:certificates self-signed-certificates:certificates ``` \ No newline at end of file diff --git a/docs/how-to/h-external-access.md b/docs/how-to/h-external-access.md index 7182b626d9..023177692b 100644 --- a/docs/how-to/h-external-access.md +++ b/docs/how-to/h-external-access.md @@ -8,7 +8,7 @@ This page summarizes resources for setting up deployments where an external appl There are many possible ways to connect the Charmed PostgreSQL database from outside of the LAN where the database cluster is located. The available options are heavily dependent on the cloud/hardware/virtualization in use. -One of the possible options is to use [virtual IP addresses (VIP)](https://en.wikipedia.org/wiki/Virtual_IP_address) which the charm PgBouncer provides with assistance from the charm/interface `hacluster`. Please follow the [PgBouncer documentation](https://charmhub.io/pgbouncer/docs/h-external-access?channel=1/stable) for such configuration. +One of the possible options is to use [virtual IP addresses (VIP)](https://en.wikipedia.org/wiki/Virtual_IP_address) which the charm PgBouncer provides with assistance from the charm/interface `hacluster`. Please follow the [PgBouncer documentation](https://charmhub.io/pgbouncer/docs/h-external-access) for such configuration. > See also: [How to deploy for external TLS VIP access](/t/16576). diff --git a/docs/how-to/h-integrate.md b/docs/how-to/h-integrate.md index 54a9761380..fa8438764e 100644 --- a/docs/how-to/h-integrate.md +++ b/docs/how-to/h-integrate.md @@ -25,7 +25,9 @@ This guide shows how to integrate Charmed PostgreSQL with both charmed and non-c Integrations with charmed applications are supported via the modern [`postgresql_client`](https://github.com/canonical/charm-relation-interfaces/blob/main/interfaces/postgresql_client/v0/README.md) interface, and the legacy `psql` interface from the [original version](https://launchpad.net/postgresql-charm) of the charm. -> You can see which existing charms are compatible with PostgreSQL in the [Integrations](https://charmhub.io/postgresql/integrations) tab. +[note] +You can see which existing charms are compatible with PostgreSQL in the [Integrations](https://charmhub.io/postgresql/integrations) tab. +[/note] ### Modern `postgresql_client` interface To integrate with a charmed application that supports the `postgresql_client` interface, run @@ -41,7 +43,7 @@ juju remove-relation postgresql ### Legacy `pgsql` interface [note type="caution"] Note that this interface is **deprecated**. -See more information in [Explanation > Legacy charm](/t/10690). +See the [legacy charm explanation page](/t/10690). [/note] To integrate via the legacy interface, run diff --git a/docs/overview.md b/docs/overview.md index 273a9b0f53..958348ebd8 100644 --- a/docs/overview.md +++ b/docs/overview.md @@ -77,6 +77,7 @@ PostgreSQL is a trademark or registered trademark of PostgreSQL Global Developme | 3 | h-enable-monitoring | [Enable monitoring](/t/10600) | | 3 | h-enable-alert-rules | [Enable alert rules](/t/13084) | | 3 | h-enable-tracing | [Enable tracing](/t/14521) | +| 3 | h-enable-profiling | [Enable profiling](/t/17172) | | 2 | h-upgrade | [Upgrade](/t/12086) | | 3 | h-upgrade-minor | [Perform a minor upgrade](/t/12089) | | 3 | h-rollback-minor | [Perform a minor rollback](/t/12090) | @@ -94,20 +95,21 @@ PostgreSQL is a trademark or registered trademark of PostgreSQL Global Developme | 2 | r-software-testing | [Software testing](/t/11773) | | 2 | r-performance | [Performance and resources](/t/11974) | | 2 | r-troubleshooting | [Troubleshooting](/t/11864) | +| 3 | r-sos-report | [SOS report](/t/17228) | | 2 | r-plugins-extensions | [Plugins/extensions](/t/10946) | | 2 | r-alert-rules | [Alert rules](/t/15841) | | 2 | r-statuses | [Statuses](/t/10844) | | 2 | r-contacts | [Contacts](/t/11863) | | 1 | explanation | [Explanation](/t/16768) | | 2 | e-architecture | [Architecture](/t/11857) | -| 2 | e-security | [Security](/t/16852) | -| 2 | e-cryptography | [Cryptography](/t/16853) | | 2 | e-interfaces-endpoints | [Interfaces and endpoints](/t/10251) | +| 2 | e-juju-details | [Juju](/t/11985) | +| 2 | e-legacy-charm | [Legacy charm](/t/10690) | | 2 | e-connection-pooling| [Connection pooling](/t/15777) | | 2 | e-users | [Users](/t/10798) | | 2 | e-logs | [Logs](/t/12099) | -| 2 | e-juju-details | [Juju](/t/11985) | -| 2 | e-legacy-charm | [Legacy charm](/t/10690) | +| 2 | e-security | [Security](/t/16852) | +| 3 | e-cryptography | [Cryptography](/t/16853) | | 1 | search | [Search](https://canonical.com/data/docs/postgresql/iaas) | [/details] diff --git a/docs/reference.md b/docs/reference.md index f686a8f86b..2decbe04cb 100644 --- a/docs/reference.md +++ b/docs/reference.md @@ -1,6 +1,6 @@ # Reference -The Reference section of our documentation contains pages for technical specifications, APIs, release notes, and other reference material for fast lookup. +Technical specifications, APIs, release notes, and other reference material for fast lookup. **In the left sidebar navigation**, you will find the following references: | Page | Description | @@ -20,8 +20,7 @@ The Reference section of our documentation contains pages for technical specific | Page | Description | |----------------------------------------------------------------------------|---------------------------------------------------------| -| [Resources](https://charmhub.io/postgresql/resources) | :construction: Under construction | | [Integrations](https://charmhub.io/postgresql/integrations) | Integration/relation interfaces supported by this charm | | [Libraries](https://charmhub.io/postgresql/libraries) | VM charm library is empty as charm uses [K8s library](https://charmhub.io/postgresql-k8s/libraries/) (more info [here](/t/11857)) | -| [Configuration](https://charmhub.io/postgresql/configuration) | Application configuration parameters (more info [here](https://juju.is/docs/juju/configuration?&_ga=2.95573596.1153611399.1713171630-773562698.1708605078#heading--application-configuration)) | +| [Configuration](https://charmhub.io/postgresql/configuration) | Application configuration parameters | | [Actions](https://charmhub.io/postgresql/actions) | Juju actions supported by this charm | \ No newline at end of file diff --git a/docs/reference/r-contacts.md b/docs/reference/r-contacts.md index 8447eab17f..ed3075fe4a 100644 --- a/docs/reference/r-contacts.md +++ b/docs/reference/r-contacts.md @@ -1,15 +1,18 @@ # Contact -Charmed PostgreSQL is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback. -* Raise software issues or feature requests on [**GitHub**](https://github.com/canonical/postgresql-operator/issues/new/choose) -* Report security issues through [**Launchpad**](https://wiki.ubuntu.com/DebuggingSecurity#How%20to%20File) -* Contact the Canonical Data Platform team through our [Matrix](https://matrix.to/#/#charmhub-data-platform:ubuntu.com) channel. +Charmed PostgreSQL is an open source project that warmly welcomes community contributions, suggestions, fixes, and constructive feedback: + +* [Raise](https://github.com/canonical/postgresql-operator/issues/new/choose) software issues or feature requests +* [Report](https://github.com/canonical/postgresql-operator/security/advisories/new) security issues +* Contact the Canonical Data Platform team directly through our [Matrix](https://matrix.to/#/#charmhub-data-platform:ubuntu.com) channel. + [note] Our legacy [Mattermost](https://chat.charmhub.io/charmhub/channels/data-platform) channel is read-only until January 31, 2025. [/note] Useful links: + * [Canonical Data Fabric](https://ubuntu.com/data/) * [Charmed PostgreSQL](https://charmhub.io/postgresql) * [Git sources for Charmed PostgreSQL](https://github.com/canonical/postgresql-operator) diff --git a/docs/reference/r-sos-report.md b/docs/reference/r-sos-report.md new file mode 100644 index 0000000000..7c1a3a0441 --- /dev/null +++ b/docs/reference/r-sos-report.md @@ -0,0 +1,114 @@ +# SoS report + +SoS is an extensible, portable, support data collection tool primarily aimed at Linux distributions and other UNIX-like operating systems. + +You can use the [built-in version of SoS](#use-built-in-sos-recommended), or [retrieve the latest version from GitHub](#use-the-latest-sos-plugins-from-git). + +[note type=caution] +Always review the collected data before sharing it! + +The generated archive may contain sensitive data. Its content should be reviewed by the originating organization before being passed to any third party. +[/note] + +## Use built-in SoS (recommended) + +Charmed PostgreSQL shipped with built-in [SoS](https://github.com/sosreport/sos) reporting tool. You can use it to collect logs on a specific unit or multiple units at once. + +### Collect logs on one unit + +To generate the troubleshooting report archiving all logs simply call `sos report` inside the relevant Juju unit: +```shell +juju ssh postgresql/0 +> sudo sos report -o system,systemd,snap,charmed_postgresql --low-priority +``` +As a result, the archive will all logs will be generated and can be shared with your support representative: +```shell +... +Your sos report has been generated and saved in: + /tmp/sosreport-juju-d4c067-1-2025-04-07-chdmwlz.tar.xz + + Size 216.36KiB + Owner root + sha256 b3bf2c54bb3d934ca61ab2a17c19e98b2abeafd45589f268b62bd02f6b2a4c5f +... +``` + +Use `juju scp` to copy logs from Juju unit to localhost: +```shell +juju scp postgresql/0:/tmp/sosreport-juju-d4c067-1-2025-04-07-chdmwlz.tar.xz . +``` + +[details="Example output"] +```shell +juju ssh postgresql/0 + +ubuntu@juju-d4c067-1:~$ sudo sos report -o system,systemd,snap,charmed_postgresql --low-priority + +sos report (version 4.8.2) + +This command will collect system configuration and diagnostic +information from this Ubuntu system. + +For more information on Canonical visit: + + Community Website : https://www.ubuntu.com/ + Commercial Support : https://www.canonical.com + +The generated archive may contain data considered sensitive and its +content should be reviewed by the originating organization before being +passed to any third party. + +No changes will be made to system configuration. + + +Press ENTER to continue, or CTRL-C to quit. + +Optionally, please enter the case id that you are generating this report for []: + + Setting up archive ... + Setting up plugins ... + Running plugins. Please wait ... + + Starting 4/4 systemd [Running: charmed_postgresql system snap systemd] + Finishing plugins [Running: charmed_postgresql] + Finished running plugins +Creating compressed archive... + +Your sos report has been generated and saved in: + /tmp/sosreport-juju-d4c067-1-2025-04-07-qntyqpz.tar.xz + + Size 285.60KiB + Owner root + sha256 d318d7de7595ebae1bce093a375129fafbd397c297317de3006fbfe45e93d43d + +Please send this file to your support representative. + +ubuntu@juju-d4c067-1:~$ exit + +juju scp postgresql/0:/tmp/sosreport-juju-d4c067-1-2025-04-07-qntyqpz.tar.xz . +``` +[/details] + +### Collect logs from several units + +The sos tool allows you to collect logs from several Juju units (replace labels with proper Juju unit like `postgresql/0`). + +Run the following command from outside the Juju units: +```shell +sos collect --cluster-type juju --no-local -c "juju.units=,,<...>" --batch -o system,systemd,snap,charmed_postgresql --low-priority +``` + +## Use the latest sos plugins from Git + +The latest version of [sos plugins](https://github.com/sosreport/sos/tree/main/sos/report/plugins) can be retrieved from Git easily: +```shell +git clone https://github.com/sosreport/sos.git +cd sos +sudo ./bin/sos report -­a +``` + +The output will be the same to the example above providing archive with all logs as above: +```shell +Your sos report has been generated and saved in: + /tmp/sosreport-juju-d4c067-1-2025-04-07-egosqmi.tar.xz +``` \ No newline at end of file diff --git a/docs/tutorial/t-enable-tls.md b/docs/tutorial/t-enable-tls.md index 0a425966fb..55f3b1b7e4 100644 --- a/docs/tutorial/t-enable-tls.md +++ b/docs/tutorial/t-enable-tls.md @@ -55,7 +55,7 @@ Machine State Address Inst id Series AZ Message To enable TLS on Charmed PostgreSQL VM, integrate the two applications: ```shell -juju integrate postgresql self-signed-certificates +juju integrate postgresql:certificates self-signed-certificates:certificates ``` PostgreSQL is now using TLS certificate generated by the `self-signed-certificates` charm. @@ -72,7 +72,7 @@ verify error:num=19:self-signed certificate in certificate chain

Remove TLS certificate

To remove the external TLS, remove the integration: ```shell -juju remove-relation postgresql self-signed-certificates +juju remove-relation postgresql:certificates self-signed-certificates:certificates ``` If you once again check the TLS certificates in use via the OpenSSL client, you will see something similar to the output below: diff --git a/docs/tutorial/t-set-up.md b/docs/tutorial/t-set-up.md index bf2ddb57b9..3223686f32 100644 --- a/docs/tutorial/t-set-up.md +++ b/docs/tutorial/t-set-up.md @@ -1,4 +1,4 @@ -> [Charmed PostgreSQL K8s Tutorial](/t/9707) > 1. Set up the environment +> [Charmed PostgreSQL VM Tutorial](/t/9707) > 1. Set up the environment # Set up the environment