@@ -14,44 +14,37 @@ GitOps is a way to do Continuous Delivery, it works by using Git as a source of
14
14
for declarative infrastructure and workloads.
15
15
For Kubernetes this means using ` git push ` instead of ` kubectl apply/delete ` or ` helm install/upgrade ` .
16
16
17
- In this workshop you'll be using GitHub to host the config repository and [ Flux] ( https://fluxcd.io ) as the GitOps delivery solution.
17
+ In this workshop you'll be using GitHub to host the config repository and [ Flux] ( https://fluxcd.io )
18
+ as the GitOps delivery solution.
18
19
19
20
### What is Progressive Delivery?
20
21
21
22
Progressive delivery is an umbrella term for advanced deployment patterns like canaries, feature flags and A/B testing.
22
23
Progressive delivery techniques are used to reduce the risk of introducing a new software version in production
23
24
by giving app developers and SRE teams a fine-grained control over the blast radius.
24
25
25
- In this workshop you'll be using [ Flagger] ( https://flagger.app ) and Prometheus to automate Canary Releases and A/B Testing for your applications.
26
+ In this workshop you'll be using [ Flagger] ( https://flagger.app ) , Istio and Prometheus to automate
27
+ Canary Releases and A/B Testing for your applications.
26
28
27
- ![ Progressive Delivery GitOps Pipeline] ( https://raw.githubusercontent.com/fluxcd/flagger/main/ docs/diagrams/ flagger-gitops-istio .png)
29
+ ![ Progressive Delivery GitOps Pipeline] ( / docs/images/flux- flagger-gitops.png)
28
30
29
31
## Prerequisites
30
32
31
- You'll need a Kubernetes cluster ** v1.16 ** or newer with ` LoadBalancer ` support.
33
+ You'll need a Kubernetes cluster ** v1.20 ** or newer with ` LoadBalancer ` support.
32
34
For testing purposes you can use Minikube with 2 CPUs and 4GB of memory.
33
35
34
- Install the ` flux ` CLI with Homebrew:
36
+ Install ` jq ` , ` yq ` and the ` flux ` CLI with Homebrew:
35
37
36
38
``` bash
37
- brew install fluxcd/tap/flux
39
+ brew install jq yq fluxcd/tap/flux
38
40
```
39
41
40
- Binaries for macOS AMD64/ARM64, Linux AMD64/ARM and Windows are available
41
- to download on the [ flux2 release page] ( https://github.com/fluxcd/flux2/releases ) .
42
-
43
42
Verify that your cluster satisfies the prerequisites with:
44
43
45
44
``` bash
46
45
flux check --pre
47
46
```
48
47
49
- Install ` jq ` and ` yq ` with Homebrew:
50
-
51
- ``` bash
52
- brew install jq yq
53
- ```
54
-
55
48
Fork this repository and clone it:
56
49
57
50
``` bash
@@ -86,7 +79,7 @@ check _Allow write access_, paste the Flux public key and click _Add key_.
86
79
87
80
When Flux has access to your repository it will do the following:
88
81
89
- * installs the Istio operator
82
+ * installs Istio using the Istio ` base ` , ` istiod ` and ` gateway ` Helm charts
90
83
* waits for Istio control plane to be ready
91
84
* installs Flagger, Prometheus and Grafana
92
85
* creates the Istio public gateway
@@ -95,8 +88,9 @@ When Flux has access to your repository it will do the following:
95
88
* creates the frontend deployment and canary
96
89
* creates the backend deployment and canary
97
90
98
- When bootstrapping a cluster with Istio, it is important to define the apply order. For the applications
99
- pods to be injected with Istio sidecar, the Istio control plane must be up and running before the apps.
91
+ When bootstrapping a cluster with Istio, it is important to control the installation order.
92
+ For the applications pods to be injected with Istio sidecar,
93
+ the Istio control plane must be up and running before the apps.
100
94
101
95
With Flux v2 you can specify the execution order by defining dependencies between objects.
102
96
For example, in [ clusters/my-cluster/apps.yaml] ( https://github.com/stefanprodan/gitops-istio/blob/main/clusters/my-cluster/apps.yaml )
@@ -130,37 +124,48 @@ You can tail the Flux reconciliation logs with:
130
124
flux logs --all-namespaces --follow --tail=10
131
125
```
132
126
133
- ## Istio customizations and upgrades
127
+ List all the Kubernetes resources managed by Flux with:
134
128
135
- ![ Flux Istio Operator] ( https://raw.githubusercontent.com/fluxcd/helm-operator-get-started/master/diagrams/flux-istio-operator.png )
129
+ ``` bash
130
+ flux tree kustomization flux-system
131
+ ```
132
+
133
+ ## Istio customizations
136
134
137
- You can customize the Istio installation with the ` IstioOperator ` resource located at
138
- [ istio/system/profile .yaml] ( https://github.com/stefanprodan/gitops-istio/blob/main/istio/system/profile .yaml ) :
135
+ You can customize the Istio installation using the Flux ` HelmReleases ` located at
136
+ [ istio/system/istio .yaml] ( https://github.com/stefanprodan/gitops-istio/blob/main/istio/system/istio .yaml ) :
139
137
140
138
``` yaml
141
- apiVersion : install.istio. io/v1alpha1
142
- kind : IstioOperator
139
+ apiVersion : helm.toolkit.fluxcd. io/v2beta1
140
+ kind : HelmRelease
143
141
metadata :
144
- name : istio-default
142
+ name : istiod
145
143
namespace : istio-system
146
144
spec :
147
- profile : demo
148
- components :
145
+ # chart spec omitted
146
+ values :
149
147
pilot :
150
- k8s :
151
- resources :
152
- requests :
153
- cpu : 10m
154
- memory : 100Mi
148
+ resources :
149
+ requests :
150
+ cpu : 100m
151
+ memory : 128Mi
155
152
` ` `
156
153
157
- After modifying the Istio settings, you can push the change to git and Flux will apply it on the cluster.
158
- The Istio operator will reconfigure the Istio control plane according to your changes.
154
+ After modifying the Helm release values, you can push the change to git and Flux
155
+ will reconfigure the Istio control plane according to your changes.
156
+
157
+ ## Istio control plane upgrades
158
+
159
+ Istio upgrades are automated using GitHub Actions and Flux.
160
+
161
+ 
159
162
160
- When a new Istio version is available, the [` update-istio` GitHub Action workflow](https://github.com/stefanprodan/gitops-istio/blob/main/.github/workflows/update-istio.yaml)
161
- will open a pull request with the manifest updates needed for upgrading Istio Operator.
162
- The new Istio version is tested on Kubernetes Kind by the [`e2e` workflow](https://github.com/stefanprodan/gitops-istio/blob/main/.github/workflows/e2e.yaml)
163
- and when the PR is merged into the main branch, Flux will upgrade Istio in-cluster.
163
+ When a new Istio version is available, the
164
+ [` update-istio` GitHub Action workflow](https://github.com/stefanprodan/gitops-istio/blob/main/.github/workflows/update-istio.yaml)
165
+ will open a pull request with the manifest updates needed for upgrading Istio.
166
+ The new Istio version is tested on Kubernetes Kind by the
167
+ [`e2e` workflow](https://github.com/stefanprodan/gitops-istio/blob/main/.github/workflows/e2e.yaml)
168
+ and when the PR is merged into the main branch, Flux will upgrade Istio on the production cluster.
164
169
165
170
# # Application bootstrap
166
171
0 commit comments