Skip to content

Commit 7ec80c6

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

26 files changed

+1339
-495
lines changed

docs/explanation/e-users.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,4 +127,11 @@ mysql> select Host,User,account_locked from mysql.user where User like 'mysql_ro
127127
128128
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 `mysql` system database it can only read data) and also to create and delete non-system databases.
129129
130-
**Note**: `extra-user-roles` is supported by modern interface `mysql_client` only and missing for legacy `mysql` interface. Read more about the supported charm interfaces [here](/t/10249).
130+
**Note**: `extra-user-roles` is supported by modern interface `mysql_client` only and missing for legacy `mysql` interface. Read more about the supported charm interfaces [here](/t/10249).
131+
132+
133+
<a name="admin-port"></a>
134+
### Admin Port User Access
135+
136+
The charm mainly uses the `serverconfig` user for internal operations. For connections with this user, a special admin port is used (port `33062`), which enables the charm to operate MySQL even when users connections are saturated.
137+
For further information on the administrative connection, refer to [MySQL docs](https://dev.mysql.com/doc/refman/8.0/en/administrative-connection-interface.html) on the topic.

docs/how-to/h-deploy-airgapped.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
# Deploy in an offline or air-gapped environment
2+
3+
An air-gapped environment refers to a system that does not have access to the public internet.
4+
This guide goes through the special configuration steps for installing Charmed PostgreSQL k8s in an air-gapped environment.
5+
6+
## Requirements
7+
8+
Canonical does not prescribe how you should set up your specific air-gapped environment. However, it is assumed that it meets the following conditions:
9+
10+
* A K8s cluster is running.
11+
* DNS is configured to the local nameservers.
12+
* [Juju is configured](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#configure-juju) to use local air-gapped services.
13+
* The [`store-admin`](https://snapcraft.io/store-admin) tool is installed and configured.
14+
* [Air-gapped CharmHub](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/) is installed and running.
15+
* Local APT and LXD Images caches are reachable.
16+
* An air-gapped container registry (such as [Artifactory](https://jfrog.com/artifactory/)) is reachable from the K8s cluster over HTTPS
17+
* **Note**: Secure (HTTPS) OCI access is important, otherwise Juju won’t work!
18+
19+
## Air-gapped concept summary
20+
21+
1. [Export](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#export-packages)
22+
2. [Transfer](https://en.wikipedia.org/wiki/Air_gap_(networking))
23+
3. [Import](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#import-packages)
24+
4. [Deploy](/t/9298)
25+
26+
## Air-gapped day-to-day example
27+
28+
**1.** Exporting K8s Charms and OCI Resources are currently independent processes.
29+
> Sseveral improvements are planned: [#1](https://warthogs.atlassian.net/browse/PF-5369), [#2](https://warthogs.atlassian.net/browse/PF-5185)
30+
31+
**1.1.** Charm. The necessary charm(s) can be exported as bundle OR independently (charm-by-charm). The special store-admin tool is designed to simplify the process. At the moment exporting of Charms and OCI resources are separated, but in the future the `store-admin export` [could](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#export-charms) export all necessary OCI resource(s)) from official CharmHub.
32+
33+
At the moment, the store-admin exports (and includes into the blob) all the OCI resources metadata only:
34+
```shell
35+
store-admin export bundle mysql-k8s-bundle --channel=8.0/edge --series=jammy --arch=amd64
36+
```
37+
38+
[details="Example output"]
39+
40+
```shell
41+
> store-admin export bundle mysql-k8s-bundle --channel=8.0/edge --series=jammy --arch=amd64
42+
Downloading mysql-k8s-bundle revision 45 (8.0/edge)
43+
[####################################] 100%
44+
Downloading data-integrator revision 71 (edge)
45+
[####################################] 100%
46+
Downloading grafana-agent-k8s revision 93 (edge)
47+
[####################################] 100%
48+
Downloading resources for grafana-agent-k8s
49+
Downloading oci-image resource agent-image revision 45
50+
[####################################] 100%
51+
Falling back to OCI image subpath from online Charmhub for 'agent-image' in charm 'grafana-agent-k8s'.
52+
Downloading mysql-k8s revision 201 (8.0/edge)
53+
[####################################] 100%
54+
Downloading resources for mysql-k8s
55+
Downloading oci-image resource mysql-image revision 113
56+
[####################################] 100%
57+
Falling back to OCI image subpath from online Charmhub for 'mysql-image' in charm 'mysql-k8s'.
58+
Downloading mysql-router-k8s revision 164 (8.0/edge)
59+
[####################################] 100%
60+
Downloading resources for mysql-router-k8s
61+
Downloading oci-image resource mysql-router-image revision 57
62+
[####################################] 100%
63+
Falling back to OCI image subpath from online Charmhub for 'mysql-router-image' in charm 'mysql-router-k8s'.
64+
Downloading mysql-test-app revision 63 (edge)
65+
[####################################] 100%
66+
Downloading s3-integrator revision 59 (edge)
67+
[####################################] 100%
68+
Downloading self-signed-certificates revision 200 (edge)
69+
[####################################] 100%
70+
Downloading sysbench revision 78 (edge)
71+
[####################################] 100%
72+
Successfully exported charm bundle mysql-k8s-bundle: /home/ubuntu/snap/store-admin/common/export/mysql-k8s-bundle-20241006T231254.tar.gz
73+
74+
```
75+
76+
[/details]
77+
78+
**1.2.** OCI: for the manual OCI export, please follow [the official CharmHub guide](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#export-oci-images).
79+
80+
**2.** Transfer the binary blobs using the way of your choice into Air-gapped environment.
81+
82+
```shell
83+
cp /home/ubuntu/snap/store-admin/common/export/mysql-k8s-bundle-20241006T231254.tar.gz /media/usb/
84+
...
85+
cp /media/usb/mysql-k8s-bundle-20241006T231254.tar.gz /var/snap/snap-store-proxy/common/charms-to-push/
86+
```
87+
> **Note**: always check [checksum](https://en.wikipedia.org/wiki/Checksum) for the transferred blobs!
88+
89+
**3.** Upload the charm blobs into local Air-gapped CharmHub:
90+
```shell
91+
sudo snap-store-proxy push-charm-bundle /var/snap/snap-store-proxy/common/charms-to-push/mysql-k8s-bundle-20241006T231254.tar.gz
92+
```
93+
> **Note**: when [re-importing](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#import-packages) charms or importing other revisions, make sure to provide the `--push-channel-map`.
94+
95+
**4.** Upload the charm OCI into local Air-gapped OCI registry.
96+
97+
For the manual OCI import, please follow [the official CharmHub guide](https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/#import-packages).
98+
99+
**5.** [Deploy and enjoy Juju charms the usual way](/t/9298):
100+
```shell
101+
juju deploy mysql-k8s --trust
102+
```
103+
> **Note**: all the Air-gapp-deployed charms revisions and OCI resources tags/revisions must match the official CharmHub revisions/tags (users can rely in [the official release notes](/t/11878)).
104+
105+
## Additional links:
106+
107+
* https://docs.ubuntu.com/snap-store-proxy/en/airgap
108+
* https://documentation.ubuntu.com/snap-store-proxy/
109+
* https://documentation.ubuntu.com/snap-store-proxy/en/airgap-charmhub/
110+
* https://ubuntu.com/kubernetes/docs/install-offline
111+
* https://charmed-kubeflow.io/docs/install-in-airgapped-environment

docs/how-to/h-deploy-aks.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,21 @@
33
[Azure Kubernetes Service](https://learn.microsoft.com/en-us/azure/aks/) (AKS) allows you to quickly deploy a production ready Kubernetes cluster in Azure. To access the AKS Web interface, go to [https://portal.azure.com/](https://portal.azure.com/).
44

55
## Summary
6-
* [Install AKS and Juju tooling](#heading--install-aks-juju)
7-
* [Create a new AKS cluster](#heading--create-aks-cluster)
8-
* [Bootstrap Juju on AKS](#heading--boostrap-juju)
9-
* [Deploy charms](#heading--deploy-charms)
10-
* [Display deployment information](#heading--display-information)
11-
* [Clean up](#heading--clean-up)
6+
* [Install AKS and Juju tooling](#install-aks-and-juju-tooling)
7+
* [Authenticate](#authenticate)
8+
* [Create a new AKS cluster](#create-a-new-aks-cluster)
9+
* [Bootstrap Juju on AKS](#bootstrap-juju-on-aks)
10+
* [Deploy charms](#deploy-charms)
11+
* [Display deployment information](#display-deployment-information)
12+
* [Clean up](#clean-up)
1213

1314
---
1415

15-
<a href="#heading--install-aks-juju"><h2 id="heading--install-aks-juju"> Install AKS and Juju tooling</h2></a>
16+
## Install AKS and Juju tooling
1617

1718
Install Juju and Azure CLI tool:
1819
```shell
19-
sudo snap install juju --classic
20+
sudo snap install juju
2021
sudo apt install --yes azure-cli
2122
```
2223
Follow the installation guides for:
@@ -46,7 +47,7 @@ Login to your Azure account:
4647
az login
4748
```
4849

49-
<a href="#heading--create-aks-cluster"><h2 id="heading--create-aks-cluster"> Create a new AKS cluster</h2></a>
50+
## Create a new AKS cluster
5051

5152
Export the deployment name for further use:
5253
```shell
@@ -95,7 +96,7 @@ Sample output:
9596
Merged "aks" as current context in ~/.kube/config
9697
```
9798

98-
<a href="#heading--boostrap-juju"><h2 id="heading--boostrap-juju"> Bootstrap Juju on AKS</h2></a>
99+
## Bootstrap Juju on AKS
99100

100101
Bootstrap Juju controller:
101102
```shell
@@ -127,7 +128,7 @@ juju add-model welcome aks
127128
juju model-config logging-config='<root>=INFO;unit=DEBUG'
128129
```
129130

130-
<a href="#heading--deploy-charms"><h2 id="heading--deploy-charms">Deploy charms</h2></a>
131+
## Deploy charms
131132

132133
The following command deploys MySQL K8s:
133134

@@ -157,7 +158,7 @@ mysql-k8s/1 active idle 10.244.0.15
157158
mysql-k8s/2 active idle 10.244.0.16
158159
```
159160

160-
<a href="#heading--display-information"><h2 id="heading--display-information"> Display deployment information</h2></a>
161+
## Display deployment information
161162

162163
Display information about the current deployments with the following commands:
163164
```shell
@@ -178,7 +179,7 @@ NAME STATUS ROLES AGE VERSION
178179
aks-nodepool1-55146003-vmss000000 Ready agent 11m v1.28.9
179180
```
180181

181-
<a href="#heading--clean-up"><h2 id="heading--clean-up"> Clean up</h2></a>
182+
## Clean up
182183

183184
[note type="caution"]
184185
Always clean AKS resources that are no longer necessary - they could be costly!

0 commit comments

Comments
 (0)