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
# Tutorial: Workload management in a multi-cluster environment with GitOps
14
14
15
-
This tutorial will walk you through typical scenarios of the workload deployment and configuration in a multi-cluster Kubernetes environment. It will show you how to use GitHub repositories setup and toolings from the perspective of the Platform Team and Application Team personas in their daily activities.
15
+
This tutorial walks you through typical scenarios of the workload deployment and configuration in a multi-cluster Kubernetes environment. It shows you how to use GitHub repositories setup and toolings from the perspective of the Platform Team and Application Team personas in their daily activities.
16
16
17
17
## Installation options and requirements
18
18
@@ -30,7 +30,7 @@ In order to successfully deploy the sample, you need the following:
30
30
31
31
### Deployment
32
32
33
-
To deploy the sample run the following script:
33
+
To deploy the sample, run the following script:
34
34
35
35
```azurecli-interactive
36
36
mkdir kalypso && cd kalypso
@@ -100,7 +100,7 @@ The `main` branch:
100
100
|------|-----------|
101
101
|.github/workflows| GitHub workflows that implement the promotional flow|
102
102
|.environments| Contains a list of environments with the pointers to the branches with the environment configurations|
103
-
|templates| Contains manifest templates for various reconcilers (e.g. Flux and ArgoCD) as well as a template for the workload namespace|
103
+
|templates| Contains manifest templates for various reconcilers (for example, Flux and ArgoCD) as well as a template for the workload namespace|
104
104
|workloads| Contains a list of onboarded applications and services with the pointers to the corresponding GitOps repositories|
105
105
106
106
The `dev` and `stage` branches:
@@ -158,7 +158,7 @@ spec:
158
158
path: ./uat-test
159
159
```
160
160
161
-
The file contains a list of three deployment targets. They are marked with custom labels and point to the folders in [Application GitOps](https://github.com/microsoft/kalypso-app-gitops) repository where the Application Team will generate application manifests for each deployment target.
161
+
The file contains a list of three deployment targets. They are marked with custom labels and point to the folders in [Application GitOps](https://github.com/microsoft/kalypso-app-gitops) repository where the Application Team generates application manifests for each deployment target.
162
162
163
163
With this file Application Team requests Kubernetes compute resources from the Platform Team. In response, the Platform Team registers the application in the [Control Plane](https://github.com/microsoft/kalypso-control-plane) repo. Let's open a terminal and do that with the following script:
164
164
@@ -252,11 +252,11 @@ git pull --no-edit
252
252
git push
253
253
```
254
254
255
-
The first policy states that all deployment targets from the `kaizen-app-team` workspace, marked with labels `purpose: functional-test` and `edge: "true"` should be scheduled on all environment cluster types, that are marked with label `restricted: "true"`. You can treat a workspace as a group of applications produced by an application team.
255
+
The first policy states that all deployment targets from the `kaizen-app-team` workspace, marked with labels `purpose: functional-test` and `edge: "true"` should be scheduled on all environment cluster types that are marked with label `restricted: "true"`. You can treat a workspace as a group of applications produced by an application team.
256
256
257
-
The second policy states that all deployment targets from the `kaizen-app-team` workspace, marked with labels `purpose: performance-test` and `edge: "false"` should be scheduled on all environment cluster types, that are marked with label `size: "large"`.
257
+
The second policy states that all deployment targets from the `kaizen-app-team` workspace, marked with labels `purpose: performance-test` and `edge: "false"` should be scheduled on all environment cluster types that are marked with label `size: "large"`.
258
258
259
-
This push to the `dev` branch will trigger the scheduling process and will create a PR to the `dev` branch in the `Platform GitOps` repository:
259
+
This push to the `dev` branch triggers the scheduling process and creates a PR to the `dev` branch in the `Platform GitOps` repository:
260
260
261
261

262
262
@@ -270,7 +270,7 @@ Only `drone` and `large` cluster types were selected by the scheduling policies
270
270
271
271
Let's have a closer look at the generated assignment manifests for the `functional-test` deployment target. There are `namespace.yaml`, `config.yaml` and `reconciler.yaml` manifest files:
272
272
273
-
`namespace.yaml` defines a namespace, that will be created on any `drone` cluster where the `hello-world` application will run.
273
+
`namespace.yaml` defines a namespace, that will be created on any `drone` cluster where the `hello-world` application runs.
274
274
```yaml
275
275
apiVersion: v1
276
276
kind: Namespace
@@ -299,7 +299,7 @@ data:
299
299
SOME_COMMON_ENVIRONMENT_VARIABLE: "false"
300
300
```
301
301
302
-
`reconciler.yaml` contains Flux resources that a `drone` cluster will use to fetch application manifests, prepared by the Application Team for the `functional-test` deployment target:
302
+
`reconciler.yaml` contains Flux resources that a `drone` cluster uses to fetch application manifests, prepared by the Application Team for the `functional-test` deployment target:
303
303
```yaml
304
304
apiVersion: source.toolkit.fluxcd.io/v1beta2
305
305
kind: GitRepository
@@ -342,7 +342,7 @@ The PR merging event starts a GitHub workflow `checkpromote` in the `control pla
342
342
343
343

344
344
345
-
Once the `checkpromote` is successful, it will start `cd` workflow that promotes the change (application registration) to the `Stage` environment. For the better visibility it will also update the git commit status in the `control plane` repository:
345
+
Once the `checkpromote` is successful, it starts the `cd` workflow that promotes the change (application registration) to the `Stage` environment. For the better visibility, it also updates the git commit status in the `control plane` repository:
346
346
347
347

348
348
@@ -387,7 +387,7 @@ As in the case with the `Dev` environment, after reviewing and merging the PR to
387
387
388
388

389
389
390
-
On successful execution it will update the commit status:
390
+
On successful execution updates the commit status:
391
391
392
392

393
393
@@ -397,13 +397,13 @@ Application Team on a regular basis submits PRs to the `main` branch in the `App
- Build application Docker image and push it to the GitHub repository package
405
-
- Generate manifests for the `functional-test` and `performance-test` deployment targets. It will use configuration values from the `dev-configs` branch. The generated manifests are PRed and auto-merged in the `dev` branch.
406
-
- Generate manifests for the `uat-test` deployment target. It will use configuration values from the `stage-configs` branch. The generated manifests are PRed to the `stage` branch waiting for our approval:
404
+
- Builds application Docker image and push it to the GitHub repository package
405
+
- 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.
406
+
- 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 our approval:
407
407
408
408

> It may take up to 3 minutes on the `large` cluster to reconcile the changes from the application GitOps repository.
452
452
453
-
The application instance on the `large` cluster will render the following greeting page:
453
+
The application instance on the `large` cluster renders the following greeting page:
454
454
455
455

456
456
457
457
## Platform Team: Provide Platform Configurations
458
458
459
-
Applications in our fleet grab the data from the very same database in both `Dev` and `Stage` environments. Let's change this and configure `west-us` clusters to provide a different database url for the applications working in the `Stage` environment:
459
+
Applications in our 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:
460
460
461
461
```azurecli-interactivet
462
462
# Switch to stage branch (representing Stage environemnt) in the control-plane folder
@@ -485,7 +485,7 @@ git push
485
485
486
486
The scheduler scans all config maps in the environment and collects values for each cluster type basing on the label matching. Then, it puts a `platform-config` config map in every deployment target folder in the `Platform GitOps` repository. The `platform-config` config map contains all platform configuration values, that the workload can use on this cluster type in this environment.
487
487
488
-
In a few seconds, a new PR to the `stage` branch in the `Platform GitOps` repository will appear:
488
+
In a few seconds, a new PR to the `stage` branch in the `Platform GitOps` repository appears:
489
489
490
490

491
491
@@ -510,7 +510,7 @@ You will see a web page like this one:
We're interested in the `stage` tile for this exercise. If you click on it, it will provide you with more details on the reconciliation state from the `stage` branch to this cluster. You can even click the `SYNC` buttons to force the reconciliation and speed up the process.
513
+
We're interested in the `stage` tile for this exercise. If you click on it, it provides you with more details on the reconciliation state from the `stage` branch to this cluster. You can even click the `SYNC` buttons to force the reconciliation and speed up the process.
514
514
515
515
Once the new configuration has arrived to the cluster, we can check the `uat-test` application instance at `localhost:8002` after
516
516
running the following commands:
@@ -555,7 +555,7 @@ git pull --no-edit
555
555
git push
556
556
```
557
557
558
-
In a few seconds, the scheduler will submit a PR to the `Platform GitOps` repository. According to the `uat-test-policy`, that we have created before, it will assign the `uat-test` deployment target to the new cluster type as it is supposed to work on all available cluster types in the environment:
558
+
In a few seconds, the scheduler submits a PR to the `Platform GitOps` repository. According to the `uat-test-policy`, that we have created before, 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:
559
559
560
560

561
561
@@ -570,7 +570,7 @@ To delete the resources, created for this tutorial, run the following command:
570
570
571
571
## Next Steps
572
572
573
-
In this tutorial you have gone through a few of the most common workload management scenarios in a multi-cluster Kubernetes environment. It's hard to put all the scenarios in a single tutorial. So, the suggestion is to play with this tutorial setup and see how you can implement the use-cases, that are most common in your daily activities.
573
+
In this tutorial, you have gone through a few of the most common workload management scenarios in a multi-cluster Kubernetes environment. It's hard to put all the scenarios in a single tutorial. So, the suggestion is to play with this tutorial setup and see how you can implement the use-cases, that are most common in your daily activities.
574
574
575
575
To understand the underlying concepts and mechanics deeper, refer to the following resources:
0 commit comments