Skip to content

Commit e2411b0

Browse files
Sync docs from Discourse (#523)
Co-authored-by: GitHub Actions <41898282+github-actions[bot]@users.noreply.github.com>
1 parent 96aea9f commit e2411b0

28 files changed

+508
-233
lines changed

docs/how-to/h-async-deployment.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Deploy Async replication
22

3+
The following table shows the source and target controller/model combinations that are currently supported:
4+
5+
| | AWS | GCP | Azure |
6+
|---|---|:---:|:---:|
7+
| AWS | ![ check ] | | |
8+
| GCP | | ![ check ] | |
9+
| Azure | | | ![ check ] |
10+
311
## Deploy
412

513
Deploy two MySQL Clusters, named `Rome` and `Lisbon`:
@@ -92,4 +100,6 @@ The two clusters works independently, this means that it's possible to independe
92100
juju scale-application db1 3 -m rome
93101

94102
juju scale-application db2 3 -m lisbon
95-
```
103+
```
104+
105+
[check]: https://img.shields.io/badge/%E2%9C%93-brightgreen

docs/how-to/h-configure-s3-aws.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
> **:information_source: Hint**: Use [Juju 3](/t/5064). Otherwise replace `juju run ...` with `juju run-action --wait ...` and `juju integrate` with `juju relate` for Juju 2.9.
1+
[note]
2+
**Note**: All commands are written for `juju >= v.3.0`
3+
4+
If you are using an earlier version, check the [Juju 3.0 Release Notes](https://juju.is/docs/juju/roadmap#heading--juju-3-0-0---22-oct-2022).
5+
[/note]
6+
7+
# Configure S3 for AWS
28

39
Charmed MySQL K8s backup can be stored on any S3 compatible storage. The S3 access and configurations are managed with the [s3-integrator charm](https://charmhub.io/s3-integrator). Deploy and configure the s3-integrator charm for **[AWS S3](https://aws.amazon.com/s3/)** (click [here](/t/charmed-mysql-how-to-configure-s3-for-radosgw/10319) to backup on Ceph via RadosGW):
410
```shell

docs/how-to/h-configure-s3-radosgw.md

Lines changed: 35 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,29 @@
1-
Charmed MySQL K8s backup can be stored on any S3 compatible storage, e.g. on [Ceph](https://ceph.com/en/) via [RadosGW](https://docs.ceph.com/en/latest/man/8/radosgw/). The S3 access and configurations are managed with the [s3-integrator charm](https://charmhub.io/s3-integrator). Deploy and configure the s3-integrator charm for **RadosGW** (click [here](/t/charmed-mysql-k8s-how-to-configure-s3-for-aws/9651) to backup on AWS S3):
1+
[note]
2+
**Note**: All commands are written for `juju >= v.3.0`
3+
4+
If you are using an earlier version, check the [Juju 3.0 Release Notes](https://juju.is/docs/juju/roadmap#heading--juju-3-0-0---22-oct-2022).
5+
[/note]
6+
7+
# Configure S3 for RadosGW
8+
9+
A MySQL K8s backup can be stored on any S3-compatible storage. S3 access and configurations are managed with the [s3-integrator charm](https://charmhub.io/s3-integrator).
10+
11+
This guide will teach you how to deploy and configure the s3-integrator charm on Ceph via [RadosGW](https://docs.ceph.com/en/quincy/man/8/radosgw/), send the configuration to a Charmed MySQL K8s application, and update it.
12+
> For AWS, see the guide [How to configure S3 for AWS](/t/9651)
13+
14+
## Configure s3-integrator
15+
First, install the MinIO client and create a bucket:
216
```shell
3-
# Install MinIO client and create a bucket:
417
mc config host add dest https://radosgw.mycompany.fqdn <access-key> <secret-key> --api S3v4 --lookup path
518
mc mb dest/backups-bucket
6-
19+
```
20+
Then, deploy and run the charm:
21+
```shell
722
juju deploy s3-integrator
8-
juju run-action s3-integrator/leader sync-s3-credentials access-key=<access-key> secret-key=<secret-key> --wait
23+
juju run s3-integrator/leader sync-s3-credentials access-key=<access-key> secret-key=<secret-key>
24+
```
25+
Lastly, use `juju config` to add your configuration parameters. For example:
26+
```shell
927
juju config s3-integrator \
1028
endpoint="https://radosgw.mycompany.fqdn" \
1129
bucket="backups-bucket" \
@@ -15,24 +33,27 @@ juju config s3-integrator \
1533
s3-uri-style="path"
1634
```
1735

18-
To pass these configurations to Charmed MySQL K8s, relate the two applications:
36+
## Integrate with Charmed MySQL K8s
37+
38+
To pass these configurations to Charmed MySQL K8s, integrate the two applications:
1939
```shell
20-
juju relate s3-integrator mysql-k8s
40+
juju integrate s3-integrator mysql-k8s
2141
```
2242

23-
You can create/list/restore backups now:
24-
43+
You can create, list, and restore backups now:
2544
```shell
26-
juju run-action mysql-k8s/leader list-backups --wait
27-
juju run-action mysql-k8s/leader create-backup --wait
28-
juju run-action mysql-k8s/leader list-backups --wait
29-
juju run-action mysql-k8s/leader restore backup-id=<backup-id-here> --wait
45+
juju run mysql-k8s/leader list-backups
46+
juju run mysql-k8s/leader create-backup
47+
juju run mysql-k8s/leader list-backups
48+
juju run mysql-k8s/leader restore backup-id=<backup-id-here>
3049
```
3150

32-
You can also update your S3 configuration options after relating, using:
51+
You can also update your S3 configuration options after integrating, using:
3352
```shell
3453
juju config s3-integrator <option>=<value>
3554
```
3655
The s3-integrator charm [accepts many configurations](https://charmhub.io/s3-integrator/configure) - enter whatever configurations are necessary for your S3 storage.
3756

38-
> :tipping_hand_man: **[MicroCeph TIP](https://github.com/canonical/microceph)**: make sure the `region` for `s3-integrator` matches `"sudo microceph.radosgw-admin zonegroup list"` output (use `region="default"` by default).
57+
[note]
58+
[MicroCeph](https://github.com/canonical/microceph)** tip: make sure the `region` for `s3-integrator` matches the `"sudo microceph.radosgw-admin zonegroup list"` output (use `region="default"` by default).
59+
[/note]

docs/how-to/h-create-backup.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,34 @@
1+
[note]
2+
**Note**: All commands are written for `juju >= v.3.0`
3+
4+
If you are using an earlier version, check the [Juju 3.0 Release Notes](https://juju.is/docs/juju/roadmap#heading--juju-3-0-0---22-oct-2022).
5+
[/note]
6+
17
# How to create and list backups
28

3-
Creating and listing backups requires that you:
4-
* [Have a Charmed MySQL K8s deployed](/t/charmed-mysql-k8s-how-to-manage-units/9659)
9+
This guide contains recommended steps and useful commands for creating and managing backups to ensure smooth restores.
10+
11+
## Prerequisites
12+
* A [deployed](/t/9659) MySQL K8s cluster
513
* Access to S3 storage
6-
* [Have configured settings for S3 storage](/t/charmed-mysql-k8s-how-to-configure-s3/9651)
14+
* [Configured settings for S3 storage](/t/9651)
715

8-
Once Charmed MySQL K8s is `active` and `idle` (check `juju status`), you can create your first backup with the `create-backup` command:
16+
---
17+
18+
## Create a backup
19+
20+
Once `juju status` shows Charmed MySQL K8s as `active` and `idle` you can create your first backup with the `create-backup` command:
921
```shell
10-
juju run-action mysql-k8s/leader create-backup --wait
22+
juju run mysql-k8s/leader create-backup
1123
```
1224

13-
[note]
1425
If you have a cluster of one unit, you can run the `create-backup` action on `mysql-k8s/leader` (which will also be the primary unit).
1526

1627
Otherwise, you must run the `create-backup` action on a non-primary unit (see `juju status` or run `juju run-action mysql-k8s/leader get-cluster-status` to find the primary unit).
17-
[/note]
28+
29+
## List backups
1830

1931
You can list your available, failed, and in progress backups by running the `list-backups` command:
2032
```shell
21-
juju run-action mysql-k8s/leader list-backups --wait
33+
juju run mysql-k8s/leader list-backups
2234
```

docs/how-to/h-deploy-canonical-k8s.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# How to deploy on Canonical Kubernetes
2+
3+
[Canonical Kubernetes](https://ubuntu.com/kubernetes) is a Kubernetes service built on Ubuntu and optimized for most major public clouds.
4+
5+
This guide shows you how to deploy Charmed MySQL K8s to Canonical Kubernetes.
6+
7+
## Summary
8+
This guide assumes you have a spare hardware/VMs running Ubuntu 22.04 LTS (or newer).
9+
10+
* [Install Canonical Kubernetes](#install-canonical-kubernetes)
11+
* [Install Juju](#install-juju)
12+
* [Deploy Charmed MySQL K8s](#deploy-charmed-mysql-k8s)
13+
14+
---
15+
16+
## Install Canonical Kubernetes
17+
18+
>The following instructions are a complete but summarized version of the steps for installing Canonical K8s. For more thorough instructions and details, see the official Canonical Kubernetes documentation: [Install Canonical Kubernetes from a snap](https://documentation.ubuntu.com/canonical-kubernetes/latest/src/snap/howto/install/snap/).
19+
20+
Install, bootstrap, and check the status of Canonical K8s with the following commands:
21+
```shell
22+
sudo snap install k8s --edge --classic
23+
sudo k8s bootstrap
24+
sudo k8s status --wait-ready
25+
```
26+
27+
Once Canonical K8s is up and running, [enable the local storage](https://documentation.ubuntu.com/canonical-kubernetes/latest/snap/tutorial/getting-started/#enable-local-storage) (or any another persistent volumes provider, to be used by [Juju Storage](https://juju.is/docs/juju/storage) later):
28+
```shell
29+
sudo k8s enable local-storage
30+
sudo k8s status --wait-ready
31+
```
32+
33+
(Optional) Install kubectl tool and dump the K8s config:
34+
```shell
35+
sudo snap install kubectl --classic
36+
mkdir ~/.kube
37+
sudo k8s config > ~/.kube/config
38+
kubectl get namespaces # to test the credentials
39+
```
40+
41+
## Install Juju
42+
43+
Install Juju and bootstrap the first Juju controller in K8s:
44+
```shell
45+
sudo snap install juju --channel 3.6/candidate
46+
juju add-k8s ck8s --client --context-name="k8s"
47+
juju bootstrap ck8s
48+
```
49+
50+
## Deploy Charmed MySQL K8s
51+
52+
```shell
53+
juju add-model mysql
54+
juju deploy mysql-k8s --trust
55+
```
56+
57+
follow the deployment progress using:
58+
```shell
59+
juju status --watch 1s
60+
```
61+
62+
Example output:
63+
```shell
64+
Model Controller Cloud/Region Version SLA Timestamp
65+
mysql ck8s ck8s 3.6-rc1 unsupported 18:32:38+01:00
66+
67+
App Version Status Scale Charm Channel Rev Address Exposed Message
68+
mysql-k8s 8.0.37-0ubuntu0.22.04.3 active 1 mysql-k8s 8.0/stable 180 10.152.183.146 no
69+
70+
Unit Workload Agent Address Ports Message
71+
mysql-k8s/0* active idle 10.1.0.11 Primary
72+
```
73+
74+
>**Next steps:** Learn [how to scale your application](/t/9675), [relate with other applications](/t/9671) and [more](/t/9677)!
Lines changed: 38 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,45 @@
1-
# How to integrate DB with my charm
1+
# How to integrate a database with your charm
22

3-
Please check [the supported interfaces](/t/10249) of the current charm first. You have options to use modern (preferred) or legacy interfaces. Make sure you are familiar with [Juju integration concepts](https://juju.is/docs/juju/integration).
3+
Charmed MySQL K8s can be integrated with any charmed application that supports its interfaces. This page provides some guidance and resources for charm developers to develop, integrate, and troubleshoot their charm so that it may connect with MySQL.
44

5-
The most existing charms currently use [ops-lib-mysql](https://github.com/canonical/ops-lib-mysql) interface (legacy). Canonical recommends for new charms to use [data-platform-libs](https://github.com/canonical/data-platform-libs) instead. You can take a look at [mysql-test-app](https://github.com/canonical/mysql-test-app) for more practical examples. Consider to [read the great manual about the charm development](https://juju.is/docs/sdk/integrate-your-charm-with-postgresql). The legacy charm details are well described [here](/t/11236).
5+
## Summary
6+
* Check supported interfaces
7+
* Integrate your charm with MySQL
8+
* Troubleshooting & testing
9+
* FAQ
610

11+
---
712

8-
FAQ:
9-
* Q: Does the requirer need to set anything in relation data?<br/>A: it depends on the interface. Check the `mysql_client` [interface requirements](https://github.com/canonical/charm-relation-interfaces/blob/main/interfaces/mysql_client/v0/README.md).
10-
* Q: Is there a charm library available, or does my charm need to compile the mysql relation data on its own?<br/>A: Yes, the library is available: [data-platform-libs](https://github.com/canonical/data-platform-libs).
11-
* Q: How do I obtain the database url/uri?<br/>A: [it is planned](https://warthogs.atlassian.net/browse/DPE-2278), but currently missing. Meanwhile use [PostgreSQL as an example](https://charmhub.io/postgresql-k8s/docs/h-develop-mycharm).
13+
## Check supported interfaces
1214

13-
Troubleshooting:
14-
* Please start with [Juju troubleshooting guide](https://juju.is/docs/sdk/debug-a-charm).
15-
* Check Charmed MySQL K8s [troubleshooting hints](/t/11886).
15+
First, we recommend that you check [the supported interfaces](/t/10249) of the current charm. You have the option to use modern (preferred) or legacy interfaces.
16+
17+
Most existing charms currently use [ops-lib-pgsql](https://github.com/canonical/ops-lib-pgsql) interface (legacy).
18+
> See also: [MySQL K8s legacy charm explanation](/t/11236)
19+
20+
For new charms, **Canonical recommends using [data-platform-libs](https://github.com/canonical/data-platform-libs).**
21+
22+
## Integrate your charm with MySQL
23+
24+
> See also:
25+
> * [Juju documentation | Integration](https://juju.is/docs/juju/integration)
26+
> * [Juju documentation | Integrate your charm with PostgreSQL](https://juju.is/docs/sdk/integrate-your-charm-with-postgresql)
27+
28+
Refer to [mysql-test-app](https://github.com/canonical/mysql-test-app) as a practical example of implementing data-platform-libs interfaces to integrate a charm with Charmed MySQL K8s.
29+
30+
## Troubleshooting and testing
31+
* To learn the basics of charm debugging, start with [Juju | How to debug a charm](https://juju.is/docs/sdk/debug-a-charm)
32+
* To troubleshoot Charmed MySQL, see the [Troubleshooting](/t/11886) page.
33+
* To test the charm, check the [Testing](/t/11772) reference
34+
35+
## FAQ
36+
**Does the requirer need to set anything in relation data?**
37+
> It depends on the interface. Check the `mysql_client` [interface requirements](https://github.com/canonical/charm-relation-interfaces/blob/main/interfaces/mysql_client/v0/README.md).
38+
39+
**Is there a charm library available, or does my charm need to compile the mysql relation data on its own?**
40+
> Yes, a library is available: [data-platform-libs](https://github.com/canonical/data-platform-libs).
41+
42+
**How do I obtain the database url/uri?**
43+
>This feature is [planned](https://warthogs.atlassian.net/browse/DPE-2278) but currently missing.
1644
1745
[Contact us](/t/11868) if you have any questions, issues and/or ideas!

docs/how-to/h-development.md

Lines changed: 0 additions & 13 deletions
This file was deleted.

docs/how-to/h-enable-alert-rules.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
This guide will show how to set up [Pushover](https://pushover.net/) to receive alert notifications from the COS Alert Manager with [Awesome Alert Rules](https://samber.github.io/awesome-prometheus-alerts/).
44

5-
Charmed MySQL K8s ships a pre-configured and pre-enabled [list of Awesome Alert Rules].
5+
Charmed MySQL K8s ships a pre-configured and pre-enabled [list of Awesome Alert Rules].
66

77
<details><summary>Screenshot of alert rules in the Grafana web interface</summary>
88

@@ -74,4 +74,4 @@ Do you have questions? [Contact us]!
7474
[Contact us]: /t/11868
7575
[Charmed MySQL K8s operator]: /t/11869
7676
[COS Monitoring]: /t/9981
77-
[list of Awesome Alert Rules]: https://github.com/canonical/mysql-k8s-operator/tree/main/src/prometheus_alert_rules
77+
[list of Awesome Alert Rules]: /t/15838

0 commit comments

Comments
 (0)