Upgrade
The following upgrade instructions aim to upgrade running deployments to a newer version of Airlock Microgateway without interruption of service.
Notice
- The upgrade instructions may not apply to breaking release upgrades of Airlock Microgateway. Refer to the release notes published on GitHub.
- Do not add the
--reuse-values
flag to thehelm upgrade
command when upgrading to a different version of Airlock Microgateway/Helm charts. The flag would prevent updating some required settings and changes.
- Update the CRDs. This will not break your current installation if not noted otherwise in the release notes of the new Microgateway version.
- Terminal box
kubectl apply -k https://github.com/airlock/microgateway/deploy/charts/airlock-microgateway/crds/?ref=4.5.0 --server-side --force-conflicts
- For sidecar-based data plane mode deployments:
Upgrade the Microgateway CNI plugin. - Terminal box
helm upgrade airlock-microgateway-cni -n kube-system oci://quay.io/airlockcharts/microgateway-cni --version '4.5.0'
- Upgrade the Microgateway Operator.
- Terminal box
helm upgrade airlock-microgateway -n airlock-microgateway-system oci://quay.io/airlockcharts/microgateway --version '4.5.0'
- You can verify the current Pod status by checking the
version
label. - For sidecar-based data plane mode deployments:
To finalize the upgrade process, use our script to manually restart all application Pods containing Microgateway Engine sidecars. See section Restart script for sidecar-based applications. - For sidecarless data plane mode deployments:
Upgrade the K8s Gateway API CRDs tov1.2.1
from the standard channel.
Restart script for sidecar-based applications
We have created a useful script to accelerate the deployment update process with multiple application Pods. The script can fetch Deployments, DaemonSets, and StatefulSets managing outdated application Pods.
- Save the script fetch-outdated-resources, rename it to
fetch-outdated-resources.sh
, and make it executable. - Variant 1
Automatic rollout restart of outdated resources with the following command:
- Terminal box
./fetch-outdated-resources.sh <application-namespace> | xargs kubectl rollout restart -n <application-namespace>
- Variant 2
- Set the
microgateway.airlock.com/restartRequired=true
label. - Terminal box
./fetch-outdated-resources.sh <application-namespace> | xargs -I{} kubectl label {} -n <application-namespace> "restartRequired=true"
- Perform a rollout restart of the labeled resources.
- Terminal box
kubectl rollout restart -n <application-namespace> deployments -l microgateway.airlock.com/restartRequired=true kubectl rollout restart -n <application-namespace> daemonsets -l microgateway.airlock.com/restartRequired=true kubectl rollout restart -n <application-namespace> statefulsets -l microgateway.airlock.com/restartRequired=true
- Remove the
microgateway.airlock.com/restartRequired=true
label after rollout.
- Set the
Further information and links:
Internal links:
- Downloadable script: fetch-outdated-resources
External links: