Skip to content

Commit 6b0b0b2

Browse files
committed
Add workshop introduction
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 43d86fe commit 6b0b0b2

File tree

1 file changed

+41
-26
lines changed

1 file changed

+41
-26
lines changed

README.md

Lines changed: 41 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,57 @@
22

33
[![e2e](https://github.com/stefanprodan/gitops-istio/workflows/e2e/badge.svg)](https://github.com/stefanprodan/gitops-istio/actions)
44

5-
This guide walks you through setting up Istio on a Kubernetes cluster and
6-
automating A/B testing and canary releases with GitOps pipelines.
5+
This is a self-paced workshop where you will get hands-on experience with GitOps and
6+
Progressive Delivery using Kubernetes and Istio.
77

8-
![Progressive Delivery GitOps Pipeline](https://raw.githubusercontent.com/weaveworks/flagger/master/docs/diagrams/flagger-gitops-istio.png)
8+
## Introduction
9+
10+
### What is GitOps?
11+
12+
GitOps is a way to do Continuous Delivery, it works by using Git as a source of truth
13+
for declarative infrastructure and workloads.
14+
For Kubernetes this means using `git push` instead of `kubectl create/apply` or `helm install/upgrade`.
15+
16+
In this workshop you'll be using GitHub to host the config repository and Flux as the GitOps delivery solution.
917

10-
Components:
18+
### What is Progressive Delivery?
1119

12-
* **Istio** service mesh
13-
* manages the traffic flows between microservices, enforcing access policies and aggregating telemetry data
14-
* **Prometheus** monitoring system
15-
* time series database that collects and stores the service mesh metrics
16-
* **Flux v2** continuous delivery
17-
* syncs YAMLs and Helm charts between git and clusters
18-
* scans container registries and deploys new images
19-
* **Flagger** progressive delivery
20-
* automates the release process using Istio routing for traffic shifting and Prometheus metrics for canary analysis
20+
Progressive delivery is an umbrella term for advanced deployment patterns like canaries, feature flags and A/B testing.
21+
Progressive delivery techniques are used to reduce the risk of introducing a new software version in production
22+
by giving app developers and SRE teams a fine-grained control over the blast radius.
23+
24+
In this workshop you'll be using Flagger and Prometheus to automate Canary Releases and A/B Testing for your applications.
25+
26+
![Progressive Delivery GitOps Pipeline](https://raw.githubusercontent.com/weaveworks/flagger/master/docs/diagrams/flagger-gitops-istio.png)
2127

22-
### Prerequisites
28+
## Prerequisites
2329

2430
You'll need a Kubernetes cluster **v1.16** or newer with `LoadBalancer` support.
2531
For testing purposes you can use Minikube with four CPUs and 4GB of memory.
2632

27-
Install Flux CLI and yq:
33+
Install the `flux` CLI and `yq` with Homebrew:
2834

2935
```bash
3036
brew install fluxcd/tap/flux yq
3137
```
3238

39+
Binaries for macOS, Windows and Linux AMD64/ARM are available
40+
to download on the [flux2 release page](https://github.com/fluxcd/flux2/releases).
41+
42+
Verify that your cluster satisfies the prerequisites with:
43+
44+
```bash
45+
flux check --pre
46+
```
47+
3348
Fork this repository and clone it:
3449

3550
```bash
3651
git clone https://github.com/<YOUR-USERNAME>/gitops-istio
3752
cd gitops-istio
3853
```
3954

40-
### Cluster bootstrap
55+
## Cluster bootstrap
4156

4257
Install Flux by specifying your fork URL:
4358

@@ -57,7 +72,7 @@ When Flux has access to your repository it will do the following:
5772

5873
* installs the Istio operator
5974
* waits for Istio control plane to be ready
60-
* installs Flagger and Grafana
75+
* installs Flagger, Prometheus and Grafana
6176
* creates the Istio public gateway
6277
* creates the `prod` namespace
6378
* creates the load tester deployment
@@ -69,7 +84,7 @@ pods to be injected with Istio sidecar, the Istio control plane must be up and r
6984

7085
With Flux v2 you can specify the execution order by defining dependencies between objects.
7186
For example, in [clusters/my-cluster/apps.yaml](https://github.com/stefanprodan/gitops-istio/blob/main/clusters/my-cluster/apps.yaml)
72-
we tell Flux that the `apps` reconciliation depends on the `istio` one:
87+
we tell Flux that the `apps` reconciliation depends on the `istio-system` one:
7388

7489
```yaml
7590
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
@@ -88,13 +103,13 @@ spec:
88103
prune: true
89104
```
90105
91-
Watch Flux reconciling Istio, then the demo apps:
106+
Watch Flux installing Istio first, then the demo apps:
92107
93108
```bash
94109
watch flux get kustomizations
95110
```
96111

97-
### Istio customization
112+
## Istio customization
98113

99114
![Flux Istio Operator](https://raw.githubusercontent.com/fluxcd/helm-operator-get-started/master/diagrams/flux-istio-operator.png)
100115

@@ -121,7 +136,7 @@ spec:
121136
After modifying the Istio settings, you can push the change to git and Flux will apply it on the cluster.
122137
The Istio operator will reconfigure the Istio control plane according to your changes.
123138
124-
### App bootstrap
139+
## Application bootstrap
125140
126141
When Flux syncs the Git repository with your cluster, it creates the frontend/backend deployment, HPA and a canary object.
127142
Flagger uses the canary definition to create a series of objects: Kubernetes deployments,
@@ -166,7 +181,7 @@ kubectl -n istio-system get svc istio-ingressgateway -ojson | jq .status.loadBal
166181

167182
Open a browser and navigate to the ingress address, you'll see the frontend UI.
168183

169-
### Canary releases
184+
## Canary releases
170185

171186
Flagger implements a control loop that gradually shifts traffic to the canary while measuring key performance indicators
172187
like HTTP requests success rate, requests average duration and pod health.
@@ -244,7 +259,7 @@ http://localhost:3000/d/flagger-istio/istio-canary?refresh=10s&orgId=1&var-names
244259

245260
Note that if new changes are applied to the deployment during the canary analysis, Flagger will restart the analysis phase.
246261

247-
### A/B testing
262+
## A/B testing
248263

249264
Besides weighted routing, Flagger can be configured to route traffic to the canary based on HTTP match conditions.
250265
In an A/B testing scenario, you'll be using HTTP headers or cookies to target a certain segment of your users.
@@ -279,7 +294,7 @@ Trigger a deployment by updating the frontend container image:
279294
yq e '.images[0].newTag="5.0.1"' -i ./apps/frontend/kustomization.yaml
280295
281296
git add -A && \
282-
git commit -m "backend 5.0.1" && \
297+
git commit -m "frontend 5.0.1" && \
283298
git push origin main
284299
285300
flux reconcile source git flux-system
@@ -311,7 +326,7 @@ prod frontend Progressing 100
311326
prod backend Succeeded 0
312327
```
313328

314-
### Rollback based on Istio metrics
329+
## Rollback based on Istio metrics
315330

316331
Flagger makes use of the metrics provided by Istio telemetry to validate the canary workload.
317332
The frontend app [analysis](https://github.com/stefanprodan/gitops-istio/blob/main/apps/frontend/canary.yaml)
@@ -376,7 +391,7 @@ You can extend the analysis with custom metric checks targeting
376391
For configuring alerting of the canary analysis for Slack, MS Teams, Discord or Rocket see the
377392
[docs](https://docs.flagger.app/usage/alerting#canary-configuration).
378393

379-
### Getting Help
394+
## Getting Help
380395

381396
If you have any questions about progressive delivery:
382397

0 commit comments

Comments
 (0)