Skip to content

Commit 54a06e4

Browse files
author
Jill Grant
authored
Merge pull request #261257 from shashankbarsin/istio/canary-upgrade
Istio canary upgrade
2 parents b996ab3 + 6040e8e commit 54a06e4

File tree

1 file changed

+112
-4
lines changed

1 file changed

+112
-4
lines changed

articles/aks/istio-upgrade.md

Lines changed: 112 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,119 @@ This article addresses upgrade experiences for Istio-based service mesh add-on f
1212

1313
## How Istio components are upgraded
1414

15-
**Minor version:** Currently the Istio add-on only has minor version 1.17 available. Minor version upgrade experiences are planned for when newer versions of Istio (1.18) are introduced.
15+
### Minor version upgrade
1616

17-
**Patch version:**
17+
Istio add-on allows upgrading the minor version using [canary upgrade process][istio-canary-upstream]. When an upgrade is initiated, the control plane of the new (canary) revision is deployed alongside the old (stable) revision's control plane. You can then manually roll over data plane workloads while using monitoring tools to track the health of workloads during this process. If you don't observe any issues with the health of your workloads, you can complete the upgrade so that only the new revision remains on the cluster. Else, you can roll back to the previous revision of Istio.
18+
19+
If the cluster is currently using a supported minor version of Istio, upgrades are only allowed one minor version at a time. If the cluster is using an unsupported version of Istio, you must upgrade to the lowest supported minor version of Istio for that Kubernetes version. After that, upgrades can again be done one minor version at a time.
20+
21+
The following example illustrates how to upgrade from revision `asm-1-17` to `asm-1-18`. The steps are the same for all minor upgrades.
22+
23+
1. Use the [az aks mesh get-upgrades](/cli/azure/aks/mesh#az-aks-mesh-get-upgrades) command to check which revisions are available for the cluster as upgrade targets:
24+
25+
```bash
26+
az aks mesh get-upgrades --resource-group $RESOURCE_GROUP --name $CLUSTER
27+
```
28+
29+
If you expect to see a newer revision not returned by this command, you may need to upgrade your AKS cluster first so that it's compatible with the newest revision.
30+
31+
1. Initiate a canary upgrade from revision `asm-1-17` to `asm-1-18` using [az aks mesh upgrade start](/cli/azure/aks/mesh#az-aks-mesh-upgrade-start):
32+
33+
```bash
34+
az aks mesh upgrade start --resource-group $RESOURCE_GROUP --name $CLUSTER --revision asm-1-18
35+
```
36+
37+
A canary upgrade means the 1.18 control plane is deployed alongside the 1.17 control plane. They continue to coexist until you either complete or roll back the upgrade.
38+
39+
1. Verify control plane pods corresponding to both `asm-1-17` and `asm-1-18` exist:
40+
41+
* Verify `istiod` pods:
42+
43+
```bash
44+
kubectl get pods -n aks-istio-system
45+
```
46+
47+
Example output:
48+
49+
```
50+
NAME READY STATUS RESTARTS AGE
51+
istiod-asm-1-17-55fccf84c8-dbzlt 1/1 Running 0 58m
52+
istiod-asm-1-17-55fccf84c8-fg8zh 1/1 Running 0 58m
53+
istiod-asm-1-18-f85f46bf5-7rwg4 1/1 Running 0 51m
54+
istiod-asm-1-18-f85f46bf5-8p9qx 1/1 Running 0 51m
55+
```
56+
57+
* If ingress is enabled, verify ingress pods:
58+
59+
```bash
60+
kubectl get pods -n aks-istio-ingress
61+
```
62+
63+
Example output:
64+
65+
```
66+
NAME READY STATUS RESTARTS AGE
67+
aks-istio-ingressgateway-external-asm-1-17-58f889f99d-qkvq2 1/1 Running 0 59m
68+
aks-istio-ingressgateway-external-asm-1-17-58f889f99d-vhtd5 1/1 Running 0 58m
69+
aks-istio-ingressgateway-external-asm-1-18-7466f77bb9-ft9c8 1/1 Running 0 51m
70+
aks-istio-ingressgateway-external-asm-1-18-7466f77bb9-wcb6s 1/1 Running 0 51m
71+
aks-istio-ingressgateway-internal-asm-1-17-579c5d8d4b-4cc2l 1/1 Running 0 58m
72+
aks-istio-ingressgateway-internal-asm-1-17-579c5d8d4b-jjc7m 1/1 Running 0 59m
73+
aks-istio-ingressgateway-internal-asm-1-18-757d9b5545-g89s4 1/1 Running 0 51m
74+
aks-istio-ingressgateway-internal-asm-1-18-757d9b5545-krq9w 1/1 Running 0 51m
75+
```
76+
77+
Observe that ingress gateway pods of both revisions are deployed side-by-side. However, the service and its IP remain immutable.
78+
79+
1. Relabel the namespace so that any new pods get the Istio sidecar associated with the new revision and its control plane:
80+
81+
```bash
82+
kubectl label namespace default istio.io/rev=asm-1-18 --overwrite
83+
```
84+
85+
Relabeling doesn't affect your workloads until they're restarted.
86+
87+
1. Individually roll over each of your application workloads by restarting them. For example:
88+
89+
```bash
90+
kubectl rollout restart deployment <deployment name> -n <deployment namespace>
91+
```
92+
93+
1. Check your monitoring tools and dashboards to determine whether your workloads are all running in a healthy state after the restart. Based on the outcome, you have two options:
94+
95+
* **Complete the canary upgrade**: If you're satisfied that the workloads are all running in a healthy state as expected, you can complete the canary upgrade. This will remove the previous revision's control plane and leave behind the new revision's control plane on the cluster. Run the following command to complete the canary upgrade:
96+
97+
```bash
98+
az aks mesh upgrade complete --resource-group $RESOURCE_GROUP --name $CLUSTER
99+
```
100+
101+
* **Rollback the canary upgrade**: In case you observe any issues with the health of your workloads, you can roll back to the previous revision of Istio:
102+
103+
* Relabel the namespace to the previous revision
104+
105+
```bash
106+
kubectl label namespace default istio.io/rev=asm-1-17 --overwrite
107+
```
108+
109+
* Roll back the workloads to use the sidecar corresponding to the previous Istio revision by restarting these workloads again:
110+
111+
```bash
112+
kubectl rollout restart deployment <deployment name> -n <deployment namespace>
113+
```
114+
115+
* Roll back the control plane to the previous revision:
116+
117+
```
118+
az aks mesh upgrade rollback --resource-group $RESOURCE_GROUP --name $CLUSTER
119+
```
120+
121+
> [!NOTE]
122+
> Manually relabeling namespaces when moving them to a new revision can be tedious and error-prone. [Revision tags](https://istio.io/latest/docs/setup/upgrade/canary/#stable-revision-labels) solve this problem. Revision tags are stable identifiers that point to revisions and can be used to avoid relabeling namespaces. Rather than relabeling the namespace, a mesh operator can simply change the tag to point to a new revision. All namespaces labeled with that tag will be updated at the same time. However, note that you still need to restart the workloads to make sure the correct version of `istio-proxy` sidecars are injected.
123+
124+
### Patch version upgrade
18125

19126
* Istio add-on patch version availability information is published in [AKS weekly release notes][aks-release-notes].
20-
* Patches are rolled out automatically for istiod and ingress pods as part of these AKS weekly releases.
127+
* Patches are rolled out automatically for istiod and ingress pods as part of these AKS weekly releases, which respect the `default` [planned maintenance window](./planned-maintenance.md) set up for the cluster.
21128
* User needs to initiate patches to Istio proxy in their workloads by restarting the pods for reinjection:
22129
* Check the version of the Istio proxy intended for new or restarted pods. This version is the same as the version of the istiod and Istio ingress pods after they were patched:
23130

@@ -66,4 +173,5 @@ This article addresses upgrade experiences for Istio-based service mesh add-on f
66173
productpage-v1-979d4d9fc-p4764: docker.io/istio/examples-bookinfo-productpage-v1:1.17.0, mcr.microsoft.com/oss/istio/proxyv2:1.17.2-distroless
67174
```
68175
69-
[aks-release-notes]: https://github.com/Azure/AKS/releases
176+
[aks-release-notes]: https://github.com/Azure/AKS/releases
177+
[istio-canary-upstream]: https://istio.io/latest/docs/setup/upgrade/canary/

0 commit comments

Comments
 (0)