Skip to content

Commit bd2eb4c

Browse files
authored
Merge pull request #230519 from schaffererin/aks-stop-apiupgrade
Stop cluster upgrades on API breaking changes in AKS
2 parents 2d24fbf + 176881e commit bd2eb4c

File tree

2 files changed

+87
-0
lines changed

2 files changed

+87
-0
lines changed

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,8 @@
185185
items:
186186
- name: Maintaining and upgrading an AKS cluster
187187
href: upgrade.md
188+
- name: Stop cluster upgrades on API breaking changes (preview)
189+
href: stop-api-upgrade.md
188190
- name: Abort long running operations
189191
href: manage-abort-operations.md
190192
- name: Automatically upgrade an AKS cluster

articles/aks/stop-api-upgrade.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
---
2+
title: Stop cluster upgrades on API breaking changes in Azure Kubernetes Service (AKS) (preview)
3+
description: Learn how to stop minor version change Azure Kubernetes Service (AKS) cluster upgrades on API breaking changes.
4+
ms.topic: article
5+
ms.author: schaffererin
6+
author: schaffererin
7+
ms.date: 03/24/2023
8+
---
9+
10+
# Stop cluster upgrades on API breaking changes in Azure Kubernetes Service (AKS)
11+
12+
To stay within a supported Kubernetes version, you usually have to upgrade your version at least once per year and prepare for all possible disruptions. These disruptions include ones caused by API breaking changes and deprecations and dependencies such as Helm and CSI. It can be difficult to anticipate these disruptions and migrate critical workloads without experiencing any downtime.
13+
14+
Azure Kubernetes Service (AKS) now supports fail fast on minor version change cluster upgrades. This feature alerts you with an error message if it detects usage on deprecated APIs in the goal version.
15+
16+
[!INCLUDE [preview features callout](./includes/preview/preview-callout.md)]
17+
18+
## Fail fast on control plane minor version manual upgrades in AKS (preview)
19+
20+
AKS will fail fast on minor version change cluster manual upgrades if it detects usage on deprecated APIs in the goal version. This will only happen if the following criteria are true:
21+
22+
- It's a minor version change for the cluster control plane.
23+
- Your Kubernetes goal version is >= 1.26.0.
24+
- The PUT MC request uses a preview API version of >= 2023-01-02-preview.
25+
- The usage is performed within the last 1-12 hours. We record usage hourly, so usage within the last hour isn't guaranteed to appear in the detection.
26+
27+
If the previous criteria are true and you attempt an upgrade, you'll receive an error message similar to the following example error message:
28+
29+
```
30+
Bad Request({
31+
32+
"code": "ValidationError",
33+
34+
"message": "Control Plane upgrade is blocked due to recent usage of a Kubernetes API deprecated in the specified version. Please refer to https://kubernetes.io/docs/reference/using-api/deprecation-guide to migrate the usage. To bypass this error, set IgnoreKubernetesDeprecations in upgradeSettings.overrideSettings. Bypassing this error without migrating usage will result in the deprecated Kubernetes API calls failing. Usage details: 1 error occurred:\n\t* usage has been detected on API flowcontrol.apiserver.k8s.io.prioritylevelconfigurations.v1beta1, and was recently seen at: 2023-03-23 20:57:18 +0000 UTC, which will be removed in 1.26\n\n",
35+
36+
"subcode": "UpgradeBlockedOnDeprecatedAPIUsage"
37+
38+
})
39+
```
40+
41+
After receiving the error message, you have two options:
42+
43+
- Remove usage on your end and wait 12 hours for the current record to expire.
44+
- Bypass the validation to ignore API changes.
45+
46+
### Remove usage on API breaking changes
47+
48+
Remove usage on API breaking changes using the following steps:
49+
50+
1. Remove the deprecated API, which is listed in the error message.
51+
2. Wait 12 hours for the current record to expire.
52+
3. Retry your cluster upgrade.
53+
54+
### Bypass validation to ignore API changes
55+
56+
To bypass validation to ignore API breaking changes, update the `"properties":` block of `Microsoft.ContainerService/ManagedClusters` `PUT` operation with the following settings:
57+
58+
> [!NOTE]
59+
> The date and time you specify for `"until"` has to be in the future. `Z` stands for timezone. The following example is in GMT. For more information, see [Combined date and time representations](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations).
60+
61+
```
62+
{
63+
"properties": {
64+
"upgradeSettings": {
65+
"overrideSettings": {
66+
"controlPlaneOverrides": [
67+
"IgnoreKubernetesDeprecations"
68+
],
69+
"until": "2023-04-01T13:00:00Z"
70+
}
71+
}
72+
}
73+
}
74+
```
75+
76+
## Next steps
77+
78+
In this article, you learned how AKS detects deprecated APIs before an update is triggered and fails the upgrade operation upfront. To learn more about AKS cluster upgrades, see:
79+
80+
- [Upgrade an AKS cluster][upgrade-cluster]
81+
- [Use Planned Maintenance to schedule and control upgrades for your AKS clusters (preview)][planned-maintenance-aks]
82+
83+
<!-- INTERNAL LINKS -->
84+
[upgrade-cluster]: upgrade-cluster.md
85+
[planned-maintenance-aks]: planned-maintenance.md

0 commit comments

Comments
 (0)