Skip to content

Commit 068b5a1

Browse files
committed
Update podinfo to v6.1
Signed-off-by: Stefan Prodan <[email protected]>
1 parent 5af952d commit 068b5a1

File tree

10 files changed

+41
-45
lines changed

10 files changed

+41
-45
lines changed

.github/workflows/e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
flux tree ks flux-system
4646
- name: Test canary release
4747
run: |
48-
kubectl -n prod set image deployment/backend backend=stefanprodan/podinfo:5.0.1
48+
kubectl -n prod set image deployment/backend backend=ghcr.io/stefanprodan/podinfo:6.1.1
4949
echo '>>> Waiting for canary finalization'
5050
retries=25
5151
count=0

README.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ For example, in [clusters/my-cluster/apps.yaml](https://github.com/stefanprodan/
9797
we tell Flux that the `apps` reconciliation depends on the `istio-system` one:
9898

9999
```yaml
100-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
100+
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
101101
kind: Kustomization
102102
metadata:
103103
name: apps
@@ -139,16 +139,16 @@ You can customize the Istio installation using the Flux `HelmReleases` located a
139139
apiVersion: helm.toolkit.fluxcd.io/v2beta1
140140
kind: HelmRelease
141141
metadata:
142-
name: istiod
142+
name: istio-gateway
143143
namespace: istio-system
144144
spec:
145-
# chart spec omitted
145+
dependsOn:
146+
- name: istio-base
147+
- name: istiod
148+
# source: https://github.com/istio/istio/blob/master/manifests/charts/gateway/values.yaml
146149
values:
147-
pilot:
148-
resources:
149-
requests:
150-
cpu: 100m
151-
memory: 128Mi
150+
autoscaling:
151+
enabled: true
152152
```
153153
154154
After modifying the Helm release values, you can push the change to git and Flux
@@ -237,14 +237,14 @@ git pull origin main
237237
To trigger a canary deployment for the backend app, bump the container image:
238238

239239
```bash
240-
yq e '.images[0].newTag="5.0.1"' -i ./apps/backend/kustomization.yaml
240+
yq e '.images[0].newTag="6.1.1"' -i ./apps/backend/kustomization.yaml
241241
```
242242

243243
Commit and push changes:
244244

245245
```bash
246246
git add -A && \
247-
git commit -m "backend 5.0.1" && \
247+
git commit -m "backend 6.1.1" && \
248248
git push origin main
249249
```
250250

@@ -322,10 +322,10 @@ have an insider cookie. The frontend configuration can be found at `apps/fronten
322322
Trigger a deployment by updating the frontend container image:
323323

324324
```bash
325-
yq e '.images[0].newTag="5.0.1"' -i ./apps/frontend/kustomization.yaml
325+
yq e '.images[0].newTag="6.1.1"' -i ./apps/frontend/kustomization.yaml
326326
327327
git add -A && \
328-
git commit -m "frontend 5.0.1" && \
328+
git commit -m "frontend 6.1.1" && \
329329
git push origin main
330330
331331
flux reconcile source git flux-system
@@ -384,7 +384,8 @@ defines two metric checks:
384384
The Prometheus queries used for checking the error rate and latency are located at
385385
[flagger-metrics.yaml](https://github.com/stefanprodan/gitops-istio/blob/main/istio/gateway/flagger-metrics.yaml).
386386

387-
During the canary analysis you can generate HTTP 500 errors and high latency to test Flagger's rollback.
387+
Bump the frontend version to `6.1.2`, then during the canary analysis you can generate
388+
HTTP 500 errors and high latency to test Flagger's rollback.
388389

389390
Generate HTTP 500 errors:
390391

apps/backend/canary.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
progressDeadlineSeconds: 120
1515
# HPA reference (optional)
1616
autoscalerRef:
17-
apiVersion: autoscaling/v2beta1
17+
apiVersion: autoscaling/v2beta2
1818
kind: HorizontalPodAutoscaler
1919
name: backend
2020
service:

apps/backend/deployment.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
---
21
apiVersion: apps/v1
32
kind: Deployment
43
metadata:

apps/backend/hpa.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: autoscaling/v2beta1
1+
apiVersion: autoscaling/v2beta2
22
kind: HorizontalPodAutoscaler
33
metadata:
44
name: backend
@@ -7,13 +7,13 @@ spec:
77
scaleTargetRef:
88
apiVersion: apps/v1
99
kind: Deployment
10-
name: backend
10+
name: frontend
1111
minReplicas: 1
1212
maxReplicas: 4
1313
metrics:
14-
- type: Resource
15-
resource:
16-
name: cpu
17-
# scale up if usage is above
18-
# 99% of the requested CPU (100m)
19-
targetAverageUtilization: 99
14+
- type: Resource
15+
resource:
16+
name: cpu
17+
target:
18+
type: Utilization
19+
averageUtilization: 99

apps/backend/kustomization.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ resources:
77
images:
88
- name: ghcr.io/stefanprodan/podinfo
99
newName: ghcr.io/stefanprodan/podinfo
10-
newTag: 5.0.0
10+
newTag: 6.1.0

apps/frontend/canary.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
progressDeadlineSeconds: 60
1515
# HPA reference (optional)
1616
autoscalerRef:
17-
apiVersion: autoscaling/v2beta1
17+
apiVersion: autoscaling/v2beta2
1818
kind: HorizontalPodAutoscaler
1919
name: frontend
2020
service:

apps/frontend/hpa.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: autoscaling/v2beta1
1+
apiVersion: autoscaling/v2beta2
22
kind: HorizontalPodAutoscaler
33
metadata:
44
name: frontend
@@ -8,12 +8,12 @@ spec:
88
apiVersion: apps/v1
99
kind: Deployment
1010
name: frontend
11-
minReplicas: 1
11+
minReplicas: 2
1212
maxReplicas: 4
1313
metrics:
14-
- type: Resource
15-
resource:
16-
name: cpu
17-
# scale up if usage is above
18-
# 99% of the requested CPU (100m)
19-
targetAverageUtilization: 99
14+
- type: Resource
15+
resource:
16+
name: cpu
17+
target:
18+
type: Utilization
19+
averageUtilization: 99

apps/frontend/kustomization.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
apiVersion: kustomize.config.k8s.io/v1beta1
22
kind: Kustomization
33
resources:
4-
- canary.yaml
5-
- deployment.yaml
6-
- hpa.yaml
4+
- canary.yaml
5+
- deployment.yaml
6+
- hpa.yaml
77
images:
88
- name: ghcr.io/stefanprodan/podinfo
99
newName: ghcr.io/stefanprodan/podinfo
10-
newTag: 5.0.0
10+
newTag: 6.1.0

clusters/my-cluster/apps.yaml

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: kustomize.toolkit.fluxcd.io/v1beta1
1+
apiVersion: kustomize.toolkit.fluxcd.io/v1beta2
22
kind: Kustomization
33
metadata:
44
name: apps
@@ -12,9 +12,5 @@ spec:
1212
name: flux-system
1313
path: ./apps
1414
prune: true
15-
validation: client
16-
healthChecks:
17-
- apiVersion: apps/v1
18-
kind: Deployment
19-
name: flagger-loadtester
20-
namespace: prod
15+
wait: true
16+
timeout: 2m0s

0 commit comments

Comments
 (0)