Skip to content

Commit

Permalink
Sync docs from Discourse
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 11, 2024
1 parent bd2f317 commit 08c7de2
Show file tree
Hide file tree
Showing 24 changed files with 211 additions and 65 deletions.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,33 +1,56 @@
# Enable monitoring
[note]
**Note**: All commands are written for [`juju >= v3.0`](https://juju.is/docs/juju/roadmap#heading--juju-3-0-0---22-oct-2022)
[/note]

> **: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
# How to enable monitoring with COS and Grafana

Enabling monitoring requires that you:
This guide goes over the steps to integrate MySQL Router K8s deployment with COS to enable monitoring in Grafana.

* [Have a Charmed MySQLRouter K8s deployed](https://charmhub.io/mysql-router/docs/t-deploy-charm?channel=dpe/edge)
* [Deploy cos-lite bundle in a Kubernetes environment](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s)
To learn about Alert Rules, see [Charmed MySQL K8s > How to enable COS Alert Rules](https://charmhub.io/mysql-k8s/docs/h-enable-alert-rules).

Switch to the COS K8s environment and offer COS interfaces to be cross-model related with Charmed MySQLRouter K8s model:
## Prerequisites
* A deployed [Charmed MySQL Router K8s](/t/12233) operator
* A deployed [‘cos-lite’ bundle in a Kubernetes environment](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s)

## Summary
* [Offer interfaces via the COS controller](#offer-interfaces-via-the-cos-controller)
* [Consume offers via the MySQL Router K8s model](#consume-offers-via-the-mysql-router-k8s-model)
* [Deploy and integrate Grafana](#deploy-and-integrate-grafana)
* [Connect to the Grafana web interface](#connect-to-the-grafana-web-interface)

---

## Offer interfaces via the COS controller

First, we will switch to the COS K8s environment and offer COS interfaces to be cross-model integrated with the Charmed MySQLRouter K8s model.

To switch to the Kubernetes controller for the COS model, run

```shell
# Switch to the Kubernetes controller, on the COS model
juju switch <k8s_cos_controller>:<cos_model_name>
juju switch <k8s_controller>:<cos_model_name>
```

To offer the COS interfaces, run
```shell
juju offer grafana:grafana-dashboard
juju offer loki:logging
juju offer prometheus:receive-remote-write
```
## Consume offers via the MySQL Router K8s model

Switch to the Charmed MySQLRouter K8s model, find offers and consume them:
Next, we will switch to the Charmed MySQL Router K8s model, find offers, and consume them.

We are currently on the Kubernetes controller for the COS model. To switch to the MySQL Router K8smodel, run

```shell
# We are on the Kubernetes controller, on the COS model. Switch the mysqlrouter model
juju switch <k8s_db_controller>:<mysql_router_model_name>

```
Display a list of available interfaces with the following command:
```shell
juju find-offers <k8s_cos_controller>: # Do not miss the ':' here!
```

A similar output should appear, if `k8s` is the k8s controller name and `cos` is the model where cos-lite has been deployed:
In the sample output below, `k8s` is the k8s controller name and `cos` is the model where `cos-lite` has been deployed:

```shell
Store URL Access Interfaces
Expand All @@ -36,31 +59,36 @@ k8s admin/cos.loki admin loki_push_api:logging
k8s admin/cos.prometheus admin prometheus_remote_write:receive-remote-write
```

Consume the offers to be reachable in the current model:
To consume offers to be reachable in the current model, run

```shell
juju consume k8s:admin/cos.grafana
juju consume k8s:admin/cos.loki
juju consume k8s:admin/cos.prometheus
```

Now, deploy ‘[grafana-agent-k8s](https://charmhub.io/grafana-agent-k8s)and integrate (relate) it with Charmed MySQLRouter K8s, then later integrate (relate) `grafana-agent-k8s` with the consumed COS offers:
## Deploy and integrate Grafana

First, deploy [grafana-agent](https://charmhub.io/grafana-agent):
```shell
juju deploy grafana-agent-k8s --trust

```
Then, integrate (previously known as "[relate](https://juju.is/docs/juju/integration)") `grafana-agent` with Charmed MySQL Router K8s:
```shell
juju integrate grafana-agent-k8s grafana
juju integrate grafana-agent-k8s loki
juju integrate grafana-agent-k8s prometheus

```
Finally, integrate `grafana-agent-k8s` with the consumed COS offers:
```shell
juju integrate grafana-agent-k8s mysql-router-k8s:grafana-dashboard
juju integrate grafana-agent-k8s mysql-router-k8s:logging
juju integrate grafana-agent-k8s mysql-router-k8s:metrics-endpoint
```

After this is complete, Grafana will show the new dashboards `MySQLRouter Exporter` and allow access for Charmed MySQLRouter K8s logs on Loki.
After this is complete, Grafana will show the new dashboards `MySQLRouter Exporter` and allow access for Charmed MySQL Router K8s logs on Loki.

An example of `juju status` on Charmed MySQLRouter K8s model:
An example of `juju status` on Charmed MySQL Router K8s model:

```shell
ubuntu@localhost:~$ juju status
Expand Down Expand Up @@ -114,7 +142,9 @@ loki loki loki-k8s 124 2/2 logging loki_push_api
prometheus prometheus prometheus-k8s 171 2/2 receive-remote-write prometheus_remote_write provider
```

To connect Grafana WEB interface, follow the COS section “[Browse dashboards](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s#heading--browse-dashboards)”:
## Connect to Grafana web interface

To connect to the Grafana web interface, follow the [Browse dashboards](https://charmhub.io/topics/canonical-observability-stack/tutorials/install-microk8s?_ga=2.201254254.1948444620.1704703837-757109492.1701777558#heading--browse-dashboards) section of the MicroK8s "Getting started" guide.

```shell
juju run grafana/leader get-admin-password --model <k8s_controller>:<cos_model_name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ Integrate `tempo-k8s` with the COS charms as follows:
```shell
juju integrate tempo-k8s:grafana-dashboard grafana:grafana-dashboard
juju integrate tempo-k8s:grafana-source grafana:grafana-source
juju integrate tempo-k8s:ingress traefik:traefik
juju integrate tempo-k8s:ingress traefik:traefik-route
juju integrate tempo-k8s:metrics-endpoint prometheus:metrics-endpoint
juju integrate tempo-k8s:logging loki:logging
```
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ juju refresh mysql-router-k8s --channel 8.0/edge
# example with channel selection and juju 3.x
juju refresh mysql-router-k8s --channel 8.0/edge --trust

# example with specific revision selection
juju refresh mysql-router-k8s --revision=89
# example with specific revision selection (do NOT miss OCI resource!)
juju refresh mysql-router-k8s --revision=89 --resource mysql-router-image=...
```

After the Router upgrade is completed, upgrade the Server:
Expand Down
94 changes: 55 additions & 39 deletions docs/index.md → docs/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,42 +24,58 @@ This MySQL Router K8s charm is an official distribution of MySQL Router. It’s
| [Tutorials](/t/12176)</br> Get started - a hands-on introduction to using Charmed MySQL operator for new users </br> | [How-to guides](/t/12233) </br> Step-by-step guides covering key operations and common tasks |
| [Reference](/t/12201) </br> Technical information - specifications, APIs, architecture | [Explanation](/t/12223) </br> Concepts - discussion and clarification of key topics |

# Contents

1. [Tutorial](tutorial)
1. [1. Introduction](tutorial/t-overview.md)
1. [2. Set up the environment](tutorial/t-setup-environment.md)
1. [3. Deploy MySQL Router](tutorial/t-deploy-charm.md)
1. [4. Manage units](tutorial/t-managing-units.md)
1. [5. Enable security](tutorial/t-enable-security.md)
1. [6. Cleanup environment](tutorial/t-cleanup-environment.md)
1. [How To](how-to)
1. [Setup](how-to/h-setup)
1. [Deploy on MicroK8s](how-to/h-setup/h-deploy-microk8s.md)
1. [Manage units](how-to/h-setup/h-manage-units.md)
1. [Enable encryption](how-to/h-setup/h-enable-encryption.md)
1. [Manage applications](how-to/h-setup/h-manage-app.md)
1. [Monitor (COS)](how-to/h-monitor)
1. [Enable monitoring](how-to/h-monitor/h-enable-monitoring.md)
1. [Enable tracing](how-to/h-monitor/h-enable-tracing.md)
1. [Upgrade](how-to/h-upgrade)
1. [Intro](how-to/h-upgrade/h-upgrade-intro.md)
1. [Major upgrade](how-to/h-upgrade/h-upgrade-major.md)
1. [Major rollback](how-to/h-upgrade/h-rollback-major.md)
1. [Minor upgrade](how-to/h-upgrade/h-upgrade-minor.md)
1. [Minor rollback](how-to/h-upgrade/h-rollback-minor.md)
1. [Contribute](how-to/h-contribute.md)
1. [Reference](reference)
1. [Release Notes](reference/r-releases-group)
1. [All releases](reference/r-releases-group/r-releases.md)
1. [Revision 117](reference/r-releases-group/r-releases-rev117.md)
1. [Revision 96](reference/r-releases-group/r-releases-rev96.md)
1. [Revision 82](reference/r-releases-group/r-releases-rev82.md)
1. [Revision 69](reference/r-releases-group/r-releases-rev69.md)
1. [Requirements](reference/r-requirements.md)
1. [Testing](reference/r-testing.md)
1. [Contacts](reference/r-contacts.md)
1. [Explanation](explanation)
1. [Interfaces/endpoints](explanation/e-interfaces.md)
1. [Statuses](explanation/e-statuses.md)
1. [Juju](explanation/e-juju-details.md)
# Navigation

[details=Navigation]

| Level | Path | Navlink |
|---------|---------|-------------|
| 1 | tutorial | [Tutorial]() |
| 2 | t-introduction | [1. Introduction](/t/12176) |
| 2 | t-set-up| [2. Set up the environment](/t/12178) |
| 2 | t-deploy | [3. Deploy MySQL Router](/t/12180) |
| 2 | t-manage-units | [4. Manage units](/t/12182) |
| 2 | t-enable-tls | [5. Enable TLS encryption](/t/12203) |
| 2 | t-clean-up | [6. Cleanup environment](/t/12204) |
| 1 | how-to | [How To]() |
| 2 | h-setup | [Setup]() |
| 3 | h-deploy-microk8s | [Deploy on MicroK8s](/t/12233) |
| 3 | h-manage-units | [Manage units](/t/12240) |
| 3 | h-enable-encryption | [Enable encryption](/t/12241) |
| 3 | h-manage-app | [Manage applications](/t/12242) |
| 2 | h-monitor | [Monitor (COS)]() |
| 3 | h-enable-monitoring | [Enable monitoring](/t/14101) |
| 3 | h-enable-tracing | [Enable tracing](/t/14553) |
| 2 | h-upgrade | [Upgrade]() |
| 3 | h-upgrade-intro | [Intro](/t/12235) |
| 3 | h-upgrade-major | [Major upgrade](/t/12236) |
| 3 | h-rollback-major | [Major rollback](/t/12237) |
| 3 | h-upgrade-minor | [Minor upgrade](/t/12238) |
| 3 | h-rollback-minor | [Minor rollback](/t/12239) |
| 2 | h-contribute | [Contribute](/t/14528) |
| 1 | reference | [Reference]() |
| 2 | r-releases-group | [Release Notes]() |
| 3 | r-releases | [All releases](/t/12201) |
| 3 | r-releases-rev155 | [Revision 154/155](/t/15354) |
| 3 | r-releases-rev117 | [Revision 117](/t/14074) |
| 3 | r-releases-rev96 | [Revision 96](/t/13523) |
| 3 | r-releases-rev82 | [Revision 82](/t/12796) |
| 3 | r-releases-rev69 | [Revision 69](/t/12202) |
| 2 | r-requirements | [Requirements](/t/12179) |
| 2 | r-testing | [Testing](/t/12234) |
| 2 | r-contacts | [Contacts](/t/12177) |
| 1 | explanation | [Explanation]() |
| 2 | e-interfaces | [Interfaces/endpoints](/t/12223) |
| 2 | e-statuses | [Statuses](/t/12231) |
| 2 | e-juju-details | [Juju](/t/12273) |

[/details]



# Redirects

[details=Mapping table]
| Path | Location |
| ---- | -------- |
[/details]
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
>Reference > Release Notes > [All revisions](/t/12201) > Revision 117
# Revision 117 (`8.0/candidate` only)
<sub>TODO: DD, MM, YYYY</sub>
# Revision 117

<sub>Aug 20, 2024</sub>

Dear community,

Expand Down
98 changes: 98 additions & 0 deletions docs/reference/r-releases-rev155.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
> Reference > Release Notes > [All releases] > Revision 154/155
# Revision 154/155
<sub>September 2, 2024</sub>

Dear community,

Canonical's newest Charmed MySQL Router K8s operator has been published in the [8.0/stable channel].

Due to the newly added support for arm64 architecture, the MySQL Router K8s charm now releases two revisions simultaneously:
* Revision 155 is built for `amd64`
* Revision 154 is built for `arm64`

To make sure you deploy for the right architecture, we recommend setting an [architecture constraint](https://juju.is/docs/juju/constraint#heading--arch) for your entire Juju model.

Otherwise, you can specify the architecture at deploy time with the `--constraints` flag as follows:

```shell
juju deploy mysql-router-k8s --constraints arch=<arch> --trust
```
where `<arch>` can be `amd64` or `arm64`.

## Highlights

Below is an overview of the major highlights, enhancements, and bugfixes in this revision. For a detailed list of all commits since the last stable release, see the [GitHub release notes].

* Upgraded MySQL Router from `v8.0.36` -> `v8.0.37` (see [Packaging](#packaging))
* Added support for ARM architecture

### Bugfixes

* [[DPE-4173](https://warthogs.atlassian.net/browse/DPE-4173)] Stabilize exporter tests by using listen-port to avoid ephemeral ports in [#277](https://github.com/canonical/mysql-router-k8s-operator/pull/277)
* [[DPE-3881](https://warthogs.atlassian.net/browse/DPE-3881)] Use ruff as a linter and formatter in [#292](https://github.com/canonical/mysql-router-k8s-operator/pull/292)
* Use poetry package-mode=false in [#296](https://github.com/canonical/mysql-router-k8s-operator/pull/296)
* [[DPE-4739](https://warthogs.atlassian.net/browse/DPE-4739)] Avoid using time.sleep in rollback integration tests in [#298](https://github.com/canonical/mysql-router-k8s-operator/pull/298)
* [[DPE-4817](https://warthogs.atlassian.net/browse/DPE-4817)] Upgrade to use lok_push_api v1 and capture rotated log files in [#283](https://github.com/canonical/mysql-router-k8s-operator/pull/283)
* Update Python dependencies

## Technical details
This section contains some technical details about the charm's contents and dependencies.

* The K8s NodePort used to expose the DB service will change after every refresh which might lead to disconnections of clients sitting outside Juju. Check more details in [DPE-5276](https://warthogs.atlassian.net/browse/DPE-5276).

If you are jumping over several stable revisions, check [previous release notes][All releases] before upgrading.

### Requirements
See the [system requirements][] page for more details about software and hardware prerequisites.

### Packaging
This charm is based on the [`charmed-mysql` rock] Revision TODO. It packages:
- mysql-router `v8.0.37`
- [8.0.37-0ubuntu0.22.04.1]
- mysql-shell `v8.0.37`
- [8.0.37+dfsg-0ubuntu0.22.04.1~ppa3]
- prometheus-mysqlrouter-exporter `v5.0.1`
- [5.0.1-0ubuntu0.22.04.1~ppa1]

### Libraries and interfaces
* **mysql `v0`**
* See the [Libraries tab] in MySQL VM for the API reference.
* **grafana_agent `v0`** for integration with Grafana
* Implements `cos_agent` interface
* **rolling_ops `v0`** for rolling operations across units
* Implements `rolling_op` interface
* **tempo_k8s `v1`, `v2`** for integration with Tempo charm
* Implements `tracing` interface
* **tls_certificates_interface `v2`** for integration with TLS charms
* Implements `tls-certificates` interface

See the [`/lib/charms` directory on GitHub][] for a full list of supported libraries.

See the [Integrations tab][] for a full list of supported integrations/interfaces/endpoints

## Contact us

Charmed MySQL K8s 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/mysql-k8s-operator/issues)
* 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.

<!-- LINKS -->
[8.0/stable channel]: https://charmhub.io/mysql-router-k8s?channel=8.0/stable
[GitHub release notes]: https://github.com/canonical/mysql-router-k8s-operator/releases/tag/rev155

[All releases]: /t/12201
[system requirements]: /t/12179

[Integrations tab]: https://charmhub.io/mysql-router-k8s/integrations
[Libraries tab]: https://charmhub.io/mysql-router-k8s/libraries

[`/lib/charms` directory on GitHub]: https://github.com/canonical/mysql-router-k8s-operator/tree/main/lib/charms

[`charmed-mysql` rock]: https://snapcraft.io/charmed-mysql
[8.0.37-0ubuntu0.22.04.1]: https://launchpad.net/ubuntu/+source/mysql-8.0/8.0.37-0ubuntu0.24.04.1
[8.0.37+dfsg-0ubuntu0.22.04.1~ppa3]: https://launchpad.net/~data-platform/+archive/ubuntu/mysql-shell
[0.14.0-0ubuntu0.22.04.1~ppa2]: https://launchpad.net/~data-platform/+archive/ubuntu/mysqld-exporter
[5.0.1-0ubuntu0.22.04.1~ppa1]: https://launchpad.net/~data-platform/+archive/ubuntu/mysqlrouter-exporter
[8.0.35-31-0ubuntu0.22.04.1~ppa3]: https://launchpad.net/~data-platform/+archive/ubuntu/xtrabackup
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

Canonical publishes here release notes for production ready revisions available in [CharmHub](https://charmhub.io) [channels](https://juju.is/docs/sdk/channel):

* [revision 117](/t/14074) in `8.0/candidate` (WIP)
* [revision 154/155](/t/15354) in `8.0/stable`
* [revision 117](/t/14074) in `8.0/stable`
* [revision 96](/t/13523) in `8.0/stable`
* [revision 82](/t/12796) in `8.0/stable`
* [revision 69](/t/12202) in `8.0/stable`
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Environment Setup
# Set up your environment

This is part of the [MySQL Router K8s Tutorial](/t/12176). Please refer to this page for more information and the overview of the content.

Expand Down

0 comments on commit 08c7de2

Please sign in to comment.