You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- [Services GitOps](https://github.com/microsoft/kalypso-svc-gitops): Contains final manifests of sample dial-tone platform services to be deployed across the clusters.
85
85
86
-
A couple of the Application Team repositories are also included:
86
+
The infrastructure also includes a couple of the Application Team repositories:
87
87
88
88
- [Application Source](https://github.com/microsoft/kalypso-app-src): Contains a sample application source code, including Docker files, manifest templates and CI/CD workflows.
89
89
- [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
170
170
171
171
To register the application, open a terminal and use the following script:
172
172
173
-
```azurecli-interactive
173
+
```bash
174
174
export org=<github org>
175
175
export prefix=<prefix>
176
176
@@ -201,15 +201,15 @@ git push
201
201
```
202
202
203
203
> [!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.
205
205
206
206
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.
207
207
208
208
### Define application scheduling policy on Dev
209
209
210
210
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:
211
211
212
-
```azurecli-interactive
212
+
```bash
213
213
# Switch to dev branch (representing Dev environemnt) in the control-plane folder
214
214
git checkout dev
215
215
mkdir -p scheduling/kaizen
@@ -266,7 +266,7 @@ The second policy states that all deployment targets from the `kaizen-app-team`
266
266
267
267
This push to the `dev` branch triggers the scheduling process and creates a PR to the `dev` branch in the `Platform GitOps` repository:
268
268
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:::
270
270
271
271
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.
272
272
@@ -365,7 +365,7 @@ Once the `checkpromote` is successful, it starts the `cd` workflow that promotes
365
365
366
366
Next, configure a scheduling policy for the `uat-test` deployment target in the stage environment:
367
367
368
-
```azurecli-interactive
368
+
```bash
369
369
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
370
370
git checkout stage
371
371
mkdir -p scheduling/kaizen
@@ -397,35 +397,35 @@ The policy states that all deployment targets from the `kaizen-app-team` workspa
397
397
398
398
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.
399
399
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.
401
401
402
402
:::image type="content" source="media/tutorial-workload-management/check-promote-to-stage.png" alt-text="Screenshot showing promotion to stage.":::
403
403
404
-
On successful execution, the commit status is updated:
404
+
On successful execution, the commit status is updated.
## 3 - Application Dev Team: Build and deploy application
409
409
410
410
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.
411
411
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`.
413
413
414
414
:::image type="content" source="media/tutorial-workload-management/run-workflow-button.png" alt-text="Screenshot showing the Run workflow option.":::
415
415
416
416
The workflow does the following:
417
417
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":::
419
419
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:
423
423
424
424
:::image type="content" source="media/tutorial-workload-management/app-pr-to-stage.png" alt-text="Screenshot showing a PR to stage.":::
425
425
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:
@@ -476,7 +476,7 @@ The application instance on the `large` cluster shows the following greeting pag
476
476
477
477
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:
478
478
479
-
```azurecli-interactive
479
+
```bash
480
480
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
481
481
git checkout stage
482
482
@@ -505,15 +505,15 @@ The scheduler scans all config maps in the environment and collects values for e
505
505
506
506
In a few seconds, a new PR to the `stage` branch in the `Platform GitOps` repository appears:
507
507
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":::
509
509
510
510
Approve the PR and merge it.
511
511
512
512
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.
513
513
514
514
To access the ArgoCD UI on the `large` cluster, run the following command:
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:
526
526
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":::
528
528
529
529
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.
530
530
531
531
Once the new configuration has arrived to the cluster, check the `uat-test` application instance at `localhost:8002` after
:::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":::
542
542
543
543
## 5 - Platform Team: Add cluster type to environment
544
544
545
545
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.
546
546
547
-
```azurecli-interactive
547
+
```bash
548
548
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
549
549
git checkout stage
550
550
@@ -572,12 +572,12 @@ git push
572
572
573
573
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.
574
574
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":::
576
576
577
577
## Clean up resources
578
578
When no longer needed, delete the resources that you created for this tutorial. To do so, run the following command:
579
579
580
-
```azurecli-interactive
580
+
```bash
581
581
# In kalypso folder
582
582
./deploy.sh -d -p <preix. e.g. kalypso> -o <github org. e.g. eedorenko> -t <github token> -l <azure-location. e.g. westus2>
0 commit comments