Skip to content

Commit 2262dee

Browse files
github-actions[bot]upload-charms-docs-bot
and
upload-charms-docs-bot
authored
[DPE-5353;DPE-5355] Documentation on AKS and EKS deployments (#155)
Co-authored-by: upload-charms-docs-bot <[email protected]>
1 parent 51cd333 commit 2262dee

File tree

2 files changed

+155
-54
lines changed

2 files changed

+155
-54
lines changed

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

+72-28
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
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+
67
* [Install Azure and Juju tooling](#install-client-environment)
78
* [Create AKS Cluster](#create-aks-cluster)
89
* [Bootstrap Juju controller on AKS](#bootstrap-juju-controller-on-aks)
@@ -14,12 +15,16 @@
1415

1516
## Install Client Environment
1617

18+
Client environment includes:
19+
* Juju
20+
* Azure CLI
21+
1722
### Juju
1823

1924
Install Juju via snap:
2025

2126
```shell
22-
sudo snap install juju
27+
sudo snap install juju --channel 3.5/stable
2328
```
2429

2530
Check that the Juju version is correctly installed:
@@ -28,11 +33,11 @@ Check that the Juju version is correctly installed:
2833
juju version
2934
```
3035

31-
which should show:
32-
36+
[details="Sample output:"]
3337
```shell
3438
3.5.2-genericlinux-amd64
3539
```
40+
[/details]
3641

3742
### Azure CLI
3843

@@ -44,8 +49,7 @@ Verify that it is correctly installed running the command below:
4449
az --version
4550
```
4651

47-
which should show the following output:
48-
52+
[details="Sample output:"]
4953
```shell
5054
azure-cli 2.65.0
5155

@@ -66,33 +70,38 @@ Legal docs and information: aka.ms/AzureCliLegal
6670

6771
Your CLI is up-to-date.
6872
```
73+
[/details]
6974

7075
## Create AKS cluster
7176

7277
Login to your Azure account:
78+
7379
```shell
7480
az login
7581
```
7682

77-
This following examples in this guide will use the single server AKS in location `eastus` - feel free to change this for your own deployment.
78-
7983
Create a new [Azure Resource Group](https://learn.microsoft.com/en-us/cli/azure/manage-azure-groups-azure-cli):
8084

8185
```shell
82-
az group create --name aks --location eastus
86+
az group create --name <RESOURCE_GROUP> --location <LOCATION>
8387
```
8488

85-
Export the deployment name for further use:
86-
```shell
87-
export JUJU_NAME=aks-$USER-$RANDOM
88-
```
89+
The placeholder `<RESOURCE_GROUP>` can be a label of your choice, and it will be used to tag
90+
the resources created on Azure. Also the following guide will use the single server AKS,
91+
using `LOCATION=eastus` - but feel free to change this for your own deployment.
8992

9093
Bootstrap AKS with the following command (increase nodes count/size if necessary):
94+
9195
```shell
92-
az aks create -g aks -n ${JUJU_NAME} --enable-managed-identity --node-count 1 --node-vm-size=Standard_D4s_v4 --generate-ssh-keys
96+
az aks create -g <RESOURCE_GROUP> -n $<K8S_CLUSTER_NAME> --enable-managed-identity --node-count 1 --node-vm-size=<INSTANCE_TYPE> --generate-ssh-keys
9397
```
9498

95-
Sample output:
99+
[note type="caution"]
100+
We recommend selecting an instance type that provides at the very least `16` GB of RAM and `4` cores, e.g. `Standard_A4_v4`.
101+
You can find more information about the available instance types in the [Azure documentation](https://learn.microsoft.com/en-us/azure/virtual-machines/sizes/overview).
102+
[/note]
103+
104+
[details="Sample output:"]
96105
```yaml
97106
{
98107
"aadProfile": null,
@@ -110,17 +119,20 @@ Sample output:
110119
"enableNodePublicIp": false,
111120
...
112121
```
122+
[/details]
113123

114124
Dump newly bootstrapped AKS credentials:
125+
115126
```shell
116-
az aks get-credentials --resource-group aks --name ${JUJU_NAME} --context aks
127+
az aks get-credentials --resource-group <RESOURCE_GROUP> --name <K8S_CLUSTER_NAME> --context aks
117128
```
118129

119-
Sample output:
130+
[details="Sample output:"]
120131
```shell
121132
...
122133
Merged "aks" as current context in ~/.kube/config
123134
```
135+
[/details]
124136

125137
You can verify that the cluster and your client `kubectl` CLI is correctly configured by running a simple command, such as:
126138

@@ -133,10 +145,12 @@ which should provide the list of the pod services running.
133145
## Bootstrap Juju controller on AKS
134146

135147
Bootstrap Juju controller:
148+
136149
```shell
137150
juju bootstrap aks <CONTROLLER_NAME>
138151
```
139-
Sample output:
152+
153+
[details="Sample output:"]
140154
```shell
141155
Creating Juju controller "aks" on aks/eastus
142156
Bootstrap to Kubernetes cluster identified as azure/eastus
@@ -152,23 +166,28 @@ Now you can run
152166
juju add-model <model-name>
153167
to create a new model to deploy k8s workloads.
154168
```
169+
[/details]
155170

156171
## Deploy Charms
157172

158173
Create a new Juju model, if needed:
174+
159175
```shell
160176
juju add-model <MODEL_NAME>
161177
```
162-
> (Optional) Increase the debug level if you are troubleshooting charms:
163-
> ```shell
164-
> juju model-config logging-config='<root>=INFO;unit=DEBUG'
165-
> ```
178+
179+
[note type="caution"]
180+
(Optional) Increase the debug level if you are troubleshooting charms:
181+
```shell
182+
juju model-config logging-config='<root>=INFO;unit=DEBUG'
183+
```
184+
[/note]
166185

167186
Then, Charmed Kafka can be deployed as usual:
168187

169188
```shell
170189
juju deploy zookeeper-k8s -n3 --channel 3/stable
171-
juju deploy kafka-k8s -n3 --constraints "instance-type=Standard_A4_v2" --channel 3/stable
190+
juju deploy kafka-k8s -n3 --channel 3/stable
172191
juju integrate kafka-k8s zookeeper-k8s
173192
```
174193

@@ -191,23 +210,42 @@ For more information on Data Integrator and how to use it, please refer to the [
191210
## Display deployment information
192211

193212
Display information about the current deployments with the following commands:
213+
214+
```shell
215+
kubectl cluster-info
216+
```
217+
218+
[details="Sample output:"]
194219
```shell
195-
~$ kubectl cluster-info
196220
Kubernetes control plane is running at https://aks-user-aks-aaaaa-bbbbb.hcp.eastus.azmk8s.io:443
197221
CoreDNS is running at https://aks-user-aks-aaaaa-bbbbb.hcp.eastus.azmk8s.io:443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
198222
Metrics-server is running at https://aks-user-aks-aaaaa-bbbbb.hcp.eastus.azmk8s.io:443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy
223+
```
224+
[/details]
199225

200-
~$ az aks list
226+
```
227+
az aks list
228+
```
229+
[details="Sample output:"]
230+
```shell
201231
...
202232
"count": 1,
203233
"currentOrchestratorVersion": "1.28.9",
204234
"enableAutoScaling": false,
205235
...
236+
```
237+
[/details]
206238

207-
~$ kubectl get node
239+
```
240+
kubectl get node
241+
```
242+
243+
[details="Sample output:"]
244+
```shell
208245
NAME STATUS ROLES AGE VERSION
209246
aks-nodepool1-31246187-vmss000000 Ready agent 11m v1.28.9
210247
```
248+
[/details]
211249

212250
## Clean up
213251

@@ -220,16 +258,22 @@ To clean the AKS cluster, resources and juju cloud, run the following commands:
220258
```shell
221259
juju destroy-controller <CONTROLLER_NAME> --destroy-all-models --destroy-storage --force
222260
```
261+
223262
List all services and then delete those that have an associated EXTERNAL-IP value (load balancers, ...):
263+
224264
```shell
225265
kubectl get svc --all-namespaces
226-
kubectl delete svc <service-name>
266+
kubectl delete svc <SERVICE_NAME>
227267
```
268+
228269
Next, delete the AKS resources (source: [Deleting an all Azure VMs]((https://learn.microsoft.com/en-us/cli/azure/delete-azure-resources-at-scale#delete-all-azure-resources-of-a-type) ))
270+
229271
```shell
230-
az aks delete -g aks -n ${JUJU_NAME}
272+
az aks delete -g <RESOURCE_GROUP> -n <K8S_CLUSTER_NAME>
231273
```
232-
Finally, logout from AKS to clean the local credentials (to avoid forgetting and leaking):
274+
275+
Finally, logout from AKS to clean the local credentials (to avoid forgetting and getting exposed to a risk of leaking credentials):
276+
233277
```shell
234278
az logout
235279
```

0 commit comments

Comments
 (0)