You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Automatically upgrade an Azure Kubernetes Service (AKS) cluster
3
+
description: Learn how to automatically upgrade an Azure Kubernetes Service (AKS) cluster to get the latest features and security updates.
4
+
services: container-service
5
+
ms.topic: article
6
+
ms.author: nickoman
7
+
author: nickomang
8
+
ms.date: 07/07/2022
9
+
---
10
+
11
+
# Automatically upgrade an Azure Kubernetes Service (AKS) cluster
12
+
13
+
Part of the AKS cluster lifecycle involves performing periodic upgrades to the latest Kubernetes version. It’s important you apply the latest security releases, or upgrade to get the latest features. Before learning about auto-upgrade, make sure you understand upgrade fundamentals by reading [Upgrade an AKS cluster][upgrade-aks-cluster].
14
+
15
+
## Why use auto-upgrade
16
+
17
+
Auto-upgrade provides a set once and forget mechanism that yields tangible time and operational cost benefits. By enabling auto-upgrade, you can ensure your clusters are up to date and don't miss the latest AKS features or patches from AKS and upstream Kubernetes.
18
+
19
+
AKS follows a strict versioning window with regard to supportability. With properly selected auto-upgrade channels, you can avoid clusters falling into an unsupported version. For more on the AKS support window, see [Supported Kubernetes versions][supported-kubernetes-versions].
20
+
21
+
## Using auto-upgrade
22
+
23
+
Automatically completed upgrades are functionally the same as manual upgrades. The timing of upgrades is determined by the selected channel.
24
+
25
+
The following upgrade channels are available:
26
+
27
+
|Channel| Action | Example
28
+
|---|---|---|
29
+
|`none`| disables auto-upgrades and keeps the cluster at its current version of Kubernetes| Default setting if left unchanged|
30
+
|`patch`| automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor version the same.| For example, if a cluster is running version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, your cluster is upgraded to *1.17.9*|
31
+
| `stable`| automatically upgrade the cluster to the latest supported patch release on minor version *N-1*, where *N* is the latest supported minor version.| For example, if a cluster is running version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, your cluster is upgraded to *1.18.6*.
32
+
| `rapid`| automatically upgrade the cluster to the latest supported patch release on the latest supported minor version.| In cases where the cluster is at a version of Kubernetes that is at an *N-2* minor version where *N* is the latest supported minor version, the cluster first upgrades to the latest supported patch version on *N-1* minor version. For example, if a cluster is running version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, your cluster first is upgraded to *1.18.6*, then is upgraded to *1.19.1*.
33
+
|`node-image`| automatically upgrade the node image to the latest version available.| Microsoft provides patches and new images for image nodes frequently (usually weekly), but your running nodes won't get the new images unless you do a node image upgrade. Turning on the node-image channel will automatically update your node images whenever a new version is available. |
34
+
35
+
> [!NOTE]
36
+
> Cluster auto-upgrade only updates to GA versions of Kubernetes and will not update to preview versions.
37
+
38
+
Automatically upgrading a cluster follows the same process as manually upgrading a cluster. For more information, see [Upgrade an AKS cluster][upgrade-aks-cluster].
39
+
40
+
To set the auto-upgrade channel when creating a cluster, use the *auto-upgrade-channel* parameter, similar to the following example.
41
+
42
+
```azurecli-interactive
43
+
az aks create --resource-group myResourceGroup --name myAKSCluster --auto-upgrade-channel stable --generate-ssh-keys
44
+
```
45
+
46
+
To set the auto-upgrade channel on existing cluster, update the *auto-upgrade-channel* parameter, similar to the following example.
47
+
48
+
```azurecli-interactive
49
+
az aks update --resource-group myResourceGroup --name myAKSCluster --auto-upgrade-channel stable
50
+
```
51
+
52
+
## Using auto-upgrade with Planned Maintenance
53
+
54
+
If you’re using Planned Maintenance and Auto-Upgrade, your upgrade will start during your specified maintenance window. For more information on Planned Maintenance, see [Use Planned Maintenance to schedule maintenance windows for your Azure Kubernetes Service (AKS) cluster][planned-maintenance].
55
+
56
+
## Best practices for auto-upgrade
57
+
58
+
The following best practices will help maximize your success when using auto-upgrade:
59
+
60
+
- In order to keep your cluster always in a supported version (i.e within the N-2 rule), choose either `stable` or `rapid` channels.
61
+
- If you're interested in getting the latest patches as soon as possible, use the `patch` channel. The `node-image` channel is a good fit if you want your agent pools to always be running the most recent node images.
62
+
- Follow [Operator best practices][operator-best-practices-scheduler].
63
+
- Follow [PDB best practices][pdb-best-practices].
Copy file name to clipboardExpand all lines: articles/aks/upgrade-cluster.md
+3-31Lines changed: 3 additions & 31 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -125,7 +125,7 @@ az aks nodepool update -n mynodepool -g MyResourceGroup --cluster-name MyManaged
125
125
126
126
With a list of available versions for your AKS cluster, use the [az aks upgrade][az-aks-upgrade] command to upgrade. During the upgrade process, AKS will:
127
127
- add a new buffer node (or as many nodes as configured in [max surge](#customize-node-surge-upgrade)) to the cluster that runs the specified Kubernetes version.
128
-
-[cordon and drain][kubernetes-drain] one of the old nodes to minimize disruption to running applications (if you're using max surge it will [cordon and drain][kubernetes-drain] as many nodes at the same time as the number of buffer nodes specified).
128
+
-[cordon and drain][kubernetes-drain] one of the old nodes to minimize disruption to running applications (if you're using max surge, it will [cordon and drain][kubernetes-drain] as many nodes at the same time as the number of buffer nodes specified).
129
129
- When the old node is fully drained, it will be reimaged to receive the new version and it will become the buffer node for the following node to be upgraded.
130
130
- This process repeats until all nodes in the cluster have been upgraded.
131
131
- At the end of the process, the last buffer node will be deleted, maintaining the existing agent node count and zone balance.
@@ -224,36 +224,7 @@ default 9m22s Normal Surge node/aks-nodepool1-96663640-vmss000002 Created a surg
224
224
225
225
## Set auto-upgrade channel
226
226
227
-
In addition to manually upgrading a cluster, you can set an auto-upgrade channel on your cluster. The following upgrade channels are available:
228
-
229
-
|Channel| Action | Example
230
-
|---|---|---|
231
-
|`none`| disables auto-upgrades and keeps the cluster at its current version of Kubernetes| Default setting if left unchanged|
232
-
|`patch`| automatically upgrade the cluster to the latest supported patch version when it becomes available while keeping the minor version the same.| For example, if a cluster is running version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, your cluster is upgraded to *1.17.9*|
233
-
| `stable`| automatically upgrade the cluster to the latest supported patch release on minor version *N-1*, where *N* is the latest supported minor version.| For example, if a cluster is running version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, your cluster is upgraded to *1.18.6*.
234
-
| `rapid`| automatically upgrade the cluster to the latest supported patch release on the latest supported minor version.| In cases where the cluster is at a version of Kubernetes that is at an *N-2* minor version where *N* is the latest supported minor version, the cluster first upgrades to the latest supported patch version on *N-1* minor version. For example, if a cluster is running version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, your cluster first is upgraded to *1.18.6*, then is upgraded to *1.19.1*.
235
-
|`node-image`| automatically upgrade the node image to the latest version available.| Microsoft provides patches and new images for image nodes frequently (usually weekly), but your running nodes won't get the new images unless you do a node image upgrade. Turning on the node-image channel will automatically update your node images whenever a new version is available. |
236
-
237
-
> [!NOTE]
238
-
> Cluster auto-upgrade only updates to GA versions of Kubernetes and will not update to preview versions.
239
-
240
-
Automatically upgrading a cluster follows the same process as manually upgrading a cluster. For more information, see [Upgrade an AKS cluster][upgrade-cluster].
241
-
242
-
To set the auto-upgrade channel when creating a cluster, use the *auto-upgrade-channel* parameter, similar to the following example.
243
-
244
-
```azurecli-interactive
245
-
az aks create --resource-group myResourceGroup --name myAKSCluster --auto-upgrade-channel stable --generate-ssh-keys
246
-
```
247
-
248
-
To set the auto-upgrade channel on existing cluster, update the *auto-upgrade-channel* parameter, similar to the following example.
249
-
250
-
```azurecli-interactive
251
-
az aks update --resource-group myResourceGroup --name myAKSCluster --auto-upgrade-channel stable
252
-
```
253
-
254
-
## Using Cluster Auto-Upgrade with Planned Maintenance
255
-
256
-
If you’re using Planned Maintenance and Auto-Upgrade, your upgrade will start during your specified maintenance window. For more information on Planned Maintenance, see [Use Planned Maintenance to schedule maintenance windows for your Azure Kubernetes Service (AKS) cluster (preview)][planned-maintenance].
227
+
In addition to manually upgrading a cluster, you can set an auto-upgrade channel on your cluster. For more information, see [Auto-upgrading an AKS cluster][aks-auto-upgrade].
257
228
258
229
## Special considerations for node pools that span multiple Availability Zones
259
230
@@ -289,3 +260,4 @@ This article showed you how to upgrade an existing AKS cluster. To learn more ab
0 commit comments