Istio’s canary upgrade assistance with Kiali
In Istio, upgrades to the control plane can be done by installing the new control plane while keeping the current one, and then monitoring the update using a small percentage of the workloads before migrating all of the traffic to the new version.
For more information about updating the control plane, check Istio’s documentation.
In this demonstration, we will have the current v1.15 control plane, and will then install a new v1.16 control plane.
It’s important to mention that each control plane has a revision name, and that revision is used to indicate to the workloads which control plane to use. The current revision is usually called default, and in this case represents the 1.15 control plane
Let’s say we have installed Kiali’s Travels application which includes the following namespaces:
- travel-control
- travel-portal
- travel-agency
We can migrate one of them to the new control plane just by labeling the namespace with istio.io/rev=v-1-16.
For a small number of namespaces it can be fine to control the migration by manually assigning and checking labels. But for a large number of namespaces it is nice to have some assistance, and this is where Kiali can help.
Kiali can be configured with the canary information to assist us in the migration process, the configuration can be found in Kiali’s documentation.
Once Kiali knows the current and the canary revision (in this demonstration default and v-1-16), it will show the canary upgrade information on the control plane card in the Overview page:
The information shown is the percentage of namespaces migrated, which version is the current, and which version is the canary. It also shows each namespace of the data plane with a label indicating which control plane it belongs to. In the previous image, all namespaces are still working with the current revision. Let’s migrate the bookinfo namespace with the following action in Kiali:
Below we can see the the bookinfo namespace has migrated to v-1–16. The percentage of namespace migration has increased, and that 3 namespaces remain to be migrated:
Once we’ve migrated all the namespaces, the percentage will reach 100% and all will have the new version label:
After the migration, we can delete the old control plane and configure Kiali indicating that the canary is now the default version.
The next time Istio releases a version, we can repeat the same steps to upgrade.