Skip to content

Commit f32d32d

Browse files
authored
add lightbox, change code languages, minor cleanup
1 parent 942b089 commit f32d32d

File tree

1 file changed

+34
-34
lines changed

1 file changed

+34
-34
lines changed

articles/azure-arc/kubernetes/tutorial-workload-management.md

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -38,17 +38,17 @@ In order to successfully deploy the sample, you need the following:
3838

3939
To deploy the sample, run the following script:
4040

41-
```azurecli-interactive
41+
```bash
4242
mkdir kalypso && cd kalypso
4343
curl -fsSL -o deploy.sh https://raw.githubusercontent.com/microsoft/kalypso/main/deploy/deploy.sh
4444
chmod 700 deploy.sh
45-
./deploy.sh -c -p <preix. e.g. kalypso> -o <github org. e.g. eedorenko> -t <github token> -l <azure-location. e.g. westus2>
45+
./deploy.sh -c -p <prefix. e.g. kalypso> -o <github org. e.g. eedorenko> -t <github token> -l <azure-location. e.g. westus2>
4646
```
4747

4848
This script may take a while to complete. After it's done, it reports the execution result in the output like this:
4949

50-
```azurecli-interactive
51-
Depoyment is complete!
50+
```output
51+
Deployment is complete!
5252
---------------------------------
5353
Created repositories:
5454
- https://github.com/eedorenko/kalypso-control-plane
@@ -64,15 +64,15 @@ Created AKS clusters in kalypso-rg resource group:
6464
```
6565

6666
> [!NOTE]
67-
> If something goes wrong with the deployment, you can delete created resources with the following command:
67+
> If something goes wrong with the deployment, you can delete the created resources with the following command:
6868
>
69-
> ```azurecli-interactive
69+
> ```bash
7070
> ./deploy.sh -d -p <preix. e.g. kalypso> -o <github org. e.g. eedorenko> -t <github token> -l <azure-location. e.g. westus2>
7171
> ```
7272
7373
### Sample overview
7474
75-
This deployment script created an infrastructure shown on the following diagram:
75+
This deployment script created an infrastructure, shown in the following diagram:
7676
7777
:::image type="content" source="media/tutorial-workload-management/infra-diagram.png" alt-text="Diagram showing the infrastructure of the sample.":::
7878
@@ -83,7 +83,7 @@ There are a few Platform Team repositories:
8383
- [Services Source](https://github.com/microsoft/kalypso-svc-src): Contains high-level manifest templates of sample dial-tone platform services.
8484
- [Services GitOps](https://github.com/microsoft/kalypso-svc-gitops): Contains final manifests of sample dial-tone platform services to be deployed across the clusters.
8585
86-
A couple of the Application Team repositories are also included:
86+
The infrastructure also includes a couple of the Application Team repositories:
8787
8888
- [Application Source](https://github.com/microsoft/kalypso-app-src): Contains a sample application source code, including Docker files, manifest templates and CI/CD workflows.
8989
- [Application GitOps](https://github.com/microsoft/kalypso-app-gitops): Contains final sample application manifests to be deployed to the deployment targets.
@@ -170,7 +170,7 @@ With this file, Application Team requests Kubernetes compute resources from the
170170
171171
To register the application, open a terminal and use the following script:
172172
173-
```azurecli-interactive
173+
```bash
174174
export org=<github org>
175175
export prefix=<prefix>
176176
@@ -201,15 +201,15 @@ git push
201201
```
202202
203203
> [!NOTE]
204-
> For sinmplicity, this tutorial pushes changes directly to `main`. In practice, one would create a pull request to submit the changes.
204+
> For sinmplicity, this tutorial pushes changes directly to `main`. In practice, you'd create a pull request to submit the changes.
205205
206206
With that in place, the application is onboarded in the control plane. But the control plane still doesn't know how to map the application deployment targets to the cluster types in the fleet.
207207
208208
### Define application scheduling policy on Dev
209209
210210
The Platform Team must define how the application deployment targets are going to be scheduled on cluster types in the `Dev` environment. To do this, submit scheduling policies for the `functional-test` and `performance-test` deployment targets with the following script:
211211
212-
```azurecli-interactive
212+
```bash
213213
# Switch to dev branch (representing Dev environemnt) in the control-plane folder
214214
git checkout dev
215215
mkdir -p scheduling/kaizen
@@ -266,7 +266,7 @@ The second policy states that all deployment targets from the `kaizen-app-team`
266266
267267
This push to the `dev` branch triggers the scheduling process and creates a PR to the `dev` branch in the `Platform GitOps` repository:
268268
269-
:::image type="content" source="media/tutorial-workload-management/pr-to-dev-with-app-assignment.png" alt-text="Screenshot showing a PR to dev environment with application assignment.":::
269+
:::image type="content" source="media/tutorial-workload-management/pr-to-dev-with-app-assignment.png" alt-text="Screenshot showing a PR to dev environment with application assignment." lightbox="media/tutorial-workload-management/pr-to-dev-with-app-assignment.png:::
270270
271271
Besides `Promoted_Commit_id`, which is just tracking information for the promotion CD flow, the PR contains assignment manifests. The `functional-test` deployment target is assigned to the `drone` cluster type, and the `performance-test` deployment target is assigned to the `large` cluster type. Those manifests are going to be landed in `drone` and `large` folders that contain all assignments to these cluster types in the `Dev` environment.
272272
@@ -365,7 +365,7 @@ Once the `checkpromote` is successful, it starts the `cd` workflow that promotes
365365
366366
Next, configure a scheduling policy for the `uat-test` deployment target in the stage environment:
367367
368-
```azurecli-interactive
368+
```bash
369369
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
370370
git checkout stage
371371
mkdir -p scheduling/kaizen
@@ -397,35 +397,35 @@ The policy states that all deployment targets from the `kaizen-app-team` workspa
397397
398398
Pushing this policy to the `stage` branch triggers the scheduling process, which creates a PR with the assignment manifests to the `Platform GitOps` repository, similar to those for the `Dev` environment.
399399
400-
As in the case with the `Dev` environment, after reviewing and merging the PR to the `Platform GitOps` repository, the `checkpromote` workflow in the `control plane` repository waits until Azure Arc-enabled clusters with Flux (`drone`) reconcile the assignment manifests:
400+
As in the case with the `Dev` environment, after reviewing and merging the PR to the `Platform GitOps` repository, the `checkpromote` workflow in the `control plane` repository waits until Azure Arc-enabled clusters with Flux (`drone`) reconcile the assignment manifests.
401401
402402
:::image type="content" source="media/tutorial-workload-management/check-promote-to-stage.png" alt-text="Screenshot showing promotion to stage.":::
403403
404-
On successful execution, the commit status is updated:
404+
On successful execution, the commit status is updated.
405405
406406
:::image type="content" source="media/tutorial-workload-management/stage-git-commit-status.png" alt-text="Screenshot showing successful commit status.":::
407407
408408
## 3 - Application Dev Team: Build and deploy application
409409
410410
The Application Team regularly submits pull requests to the `main` branch in the `Application Source` repository. Once a PR is merged to `main`, it starts a CI/CD workflow. In this tutorial, the workflow will be started manually.
411411
412-
Go to the `Application Source` repository in GitHub. On the `Actions` tab, select `Run workflow`:
412+
Go to the `Application Source` repository in GitHub. On the `Actions` tab, select `Run workflow`.
413413
414414
:::image type="content" source="media/tutorial-workload-management/run-workflow-button.png" alt-text="Screenshot showing the Run workflow option.":::
415415
416416
The workflow does the following:
417417
418-
:::image type="content" source="media/tutorial-workload-management/cicd-workflow.png" alt-text="Screenshot showing the CI/CD workflow.":::
418+
:::image type="content" source="media/tutorial-workload-management/cicd-workflow.png" alt-text="Screenshot showing the CI/CD workflow." lightbox="media/tutorial-workload-management/cicd-workflow.png":::
419419
420-
- Builds application Docker image and pushes it to the GitHub repository package.
421-
- Generates manifests for the `functional-test` and `performance-test` deployment targets. It uses configuration values from the `dev-configs` branch. The generated manifests are PRed and auto-merged in the `dev` branch.
422-
- Generates manifests for the `uat-test` deployment target. It uses configuration values from the `stage-configs` branch. The generated manifests are PRed to the `stage` branch waiting for approval:
420+
- Builds the application Docker image and pushes it to the GitHub repository package.
421+
- Generates manifests for the `functional-test` and `performance-test` deployment targets. It uses configuration values from the `dev-configs` branch. The generated manifests are added to a pull request and auto-merged in the `dev` branch.
422+
- Generates manifests for the `uat-test` deployment target. It uses configuration values from the `stage-configs` branch. The generated manifests are added to a pull request to the `stage` branch waiting for approval:
423423
424424
:::image type="content" source="media/tutorial-workload-management/app-pr-to-stage.png" alt-text="Screenshot showing a PR to stage.":::
425425
426-
To test the application manually on the `Dev` environment before approving the PR to the `Stage` environment, first verify how the `functional-tesl` application instance works on the `drone` cluster:
426+
To test the application manually on the `Dev` environment before approving the PR to the `Stage` environment, first verify how the `functional-test` application instance works on the `drone` cluster:
427427
428-
```azurecli-interactive
428+
```bash
429429
kubectl port-forward svc/hello-world-service -n dev-kaizen-app-team-hello-world-app-functional-test 9090:9090 --context=drone
430430
431431
# output:
@@ -440,7 +440,7 @@ While this command is running, open `localhost:9090` in your browser. You'll see
440440
441441
The next step is to check how the `performance-test` instance works on the `large` cluster:
442442
443-
```azurecli-interactivet
443+
```bash
444444
kubectl port-forward svc/hello-world-service -n dev-kaizen-app-team-hello-world-app-performance-test 8080:8080 --context=large
445445
446446
# output:
@@ -455,13 +455,13 @@ Once you are satisfied with the `Dev` environment, approve and merge the PR to t
455455
456456
Run the following command for the `drone` cluster and open `localhost:8001` in your browser:
457457
458-
```azurecli-interactive
458+
```bash
459459
kubectl port-forward svc/hello-world-service -n stage-kaizen-app-team-hello-world-app-uat-test 8001:8000 --context=drone
460460
```
461461
462462
Run the following command for the `large` cluster and open `localhost:8002` in your browser:
463463
464-
```azurecli-interactive
464+
```bash
465465
kubectl port-forward svc/hello-world-service -n stage-kaizen-app-team-hello-world-app-uat-test 8002:8000 --context=large
466466
```
467467
@@ -476,7 +476,7 @@ The application instance on the `large` cluster shows the following greeting pag
476476
477477
Applications in the fleet grab the data from the very same database in both `Dev` and `Stage` environments. Let's change it and configure `west-us` clusters to provide a different database url for the applications working in the `Stage` environment:
478478
479-
```azurecli-interactive
479+
```bash
480480
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
481481
git checkout stage
482482
@@ -505,15 +505,15 @@ The scheduler scans all config maps in the environment and collects values for e
505505
506506
In a few seconds, a new PR to the `stage` branch in the `Platform GitOps` repository appears:
507507
508-
:::image type="content" source="media/tutorial-workload-management/stage-db-url-update-pr.png" alt-text="Screenshot showing a PR to update the database URL on stage.":::
508+
:::image type="content" source="media/tutorial-workload-management/stage-db-url-update-pr.png" alt-text="Screenshot showing a PR to update the database URL on stage." lightbox="media/tutorial-workload-management/stage-db-url-update-pr.png":::
509509
510510
Approve the PR and merge it.
511511
512512
The `large` cluster is handled by ArgoCD, which, by default, is configured to reconcile every three minutes. This cluster doesn't report its compliance state to Azure like the clusters such as `drone` which have the Azure Arc GitOps extension. However, you can still monitor the reconciliation state on the cluster with ArgoCD UI.
513513
514514
To access the ArgoCD UI on the `large` cluster, run the following command:
515515
516-
```azurecli-interactive
516+
```bash
517517
# Get ArgoCD username and password
518518
echo "ArgoCD username: admin, password: $(kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" --context large| base64 -d)"
519519
# output:
@@ -524,27 +524,27 @@ kubectl port-forward svc/argocd-server 8080:80 -n argocd --context large
524524
525525
Next, open `localhost:8080` in your browser and provide the username and password printed by the script. You'll see a web page similar to this one:
526526
527-
:::image type="content" source="media/tutorial-workload-management/argocd-ui.png" alt-text="Screenshot showing the Argo CD user interface web page.":::
527+
:::image type="content" source="media/tutorial-workload-management/argocd-ui.png" alt-text="Screenshot showing the Argo CD user interface web page." lightbox="media/tutorial-workload-management/argocd-ui.png":::
528528
529529
Select the `stage` tile to see more details on the reconciliation state from the `stage` branch to this cluster. You can select the `SYNC` buttons to force the reconciliation and speed up the process.
530530
531531
Once the new configuration has arrived to the cluster, check the `uat-test` application instance at `localhost:8002` after
532532
running the following commands:
533533
534-
```azurecli-interactive
534+
```bash
535535
kubectl rollout restart deployment hello-world-deployment -n stage-kaizen-app-team-hello-world-app-uat-test
536536
kubectl port-forward svc/hello-world-service -n stage-kaizen-app-team-hello-world-app-uat-test 8002:8000 --context=large
537537
```
538538
539539
You'll see the updated database url:
540540
541-
:::image type="content" source="media/tutorial-workload-management/updated-db-url.png" alt-text="Screenshot showing a page with updated database url.":::
541+
:::image type="content" source="media/tutorial-workload-management/updated-db-url-page.png" alt-text="Screenshot showing a page with updated database url." lightbox="media/tutorial-workload-management/updated-db-url-page.png":::
542542
543543
## 5 - Platform Team: Add cluster type to environment
544544
545545
Currently, only `drone` and `large` cluster types are included in the `Stage` environment. Let's include the `small` cluster type to `Stage` as well. Even though we don't have a physical cluster representing this cluster type, you can see how the scheduler reacts to this change.
546546
547-
```azurecli-interactive
547+
```bash
548548
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
549549
git checkout stage
550550
@@ -572,12 +572,12 @@ git push
572572
573573
In a few seconds, the scheduler submits a PR to the `Platform GitOps` repository. According to the `uat-test-policy` that you created, it assigns the `uat-test` deployment target to the new cluster type, as it is supposed to work on all available cluster types in the environment.
574574
575-
:::image type="content" source="media/tutorial-workload-management/small-cluster-type-assignment.png" alt-text="Screenshot showing the assignment for the small cluster type.":::
575+
:::image type="content" source="media/tutorial-workload-management/small-cluster-type-assignment.png" alt-text="Screenshot showing the assignment for the small cluster type." lightbox="media/tutorial-workload-management/small-cluster-type-assignment.png":::
576576
577577
## Clean up resources
578578
When no longer needed, delete the resources that you created for this tutorial. To do so, run the following command:
579579
580-
```azurecli-interactive
580+
```bash
581581
# In kalypso folder
582582
./deploy.sh -d -p <preix. e.g. kalypso> -o <github org. e.g. eedorenko> -t <github token> -l <azure-location. e.g. westus2>
583583
```

0 commit comments

Comments
 (0)