Skip to content

Commit 43c63a7

Browse files
authored
Merge pull request #226276 from Nickomang/aks-nodeosupgrade
Node OS upgrade channel and planned maintenance schedule type
2 parents a8851dc + a9230c1 commit 43c63a7

File tree

3 files changed

+137
-24
lines changed

3 files changed

+137
-24
lines changed

articles/aks/auto-upgrade-cluster.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,16 +17,17 @@ Part of the AKS cluster lifecycle involves performing periodic upgrades to the l
1717
>
1818
> Auto-upgrade will first upgrade the control plane, and then proceed to upgrade agent pools one by one.
1919
20-
## Why use auto-upgrade
20+
## Why use cluster auto-upgrade
2121

22-
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.
22+
Cluster 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.
2323

2424
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 [Alias minor versions][supported-kubernetes-versions].
2525

26+
## Cluster auto-upgrade limitations
2627

27-
Even if using node image auto upgrade (which won't change the Kubernetes version), it still requires MC to be in a supported version
28+
If you’re using cluster auto-upgrade, you can no longer upgrade the control plane first and then upgrade the individual node pools. Cluster auto-upgrade will always upgrade the control plane and the node pools together. There is no ability of upgrading the control plane only, and trying to run the command `az aks upgrade --control-plane-only` will raise the error: `NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged: Using managed cluster api, all Agent pools' OrchestratorVersion must be all specified or all unspecified. If all specified, they must be stay unchanged or the same with control plane.`
2829

29-
## Using auto-upgrade
30+
## Using cluster auto-upgrade
3031

3132
Automatically completed upgrades are functionally the same as manual upgrades. The timing of upgrades is determined by the selected channel. When making changes to auto-upgrade, allow 24 hours for the changes to take effect.
3233

@@ -49,6 +50,9 @@ The following upgrade channels are available:
4950
> [!NOTE]
5051
> Auto-upgrade requires the cluster's Kubernetes version to be within the [AKS support window][supported-kubernetes-versions], even if using the `node-image` channel.
5152
53+
> [!NOTE]
54+
> If using the preview API `11-02-preview` or later, if you select the `node-image` cluster auto-upgrade channel the [node image auto-upgrade channel][node-image-auto-upgrade] will automatically be set to `NodeImage`.
55+
5256
Automatically upgrading a cluster follows the same process as manually upgrading a cluster. For more information, see [Upgrade an AKS cluster][upgrade-aks-cluster].
5357

5458
To set the auto-upgrade channel when creating a cluster, use the *auto-upgrade-channel* parameter, similar to the following example.
@@ -73,23 +77,20 @@ The Azure portal also highlights all the deprecated APIs between your current ve
7377

7478
## Using auto-upgrade with Planned Maintenance
7579

76-
If you’re using Planned Maintenance and Auto-Upgrade, your upgrade will start during your specified maintenance window.
80+
If you’re using Planned Maintenance and cluster auto-upgrade, your upgrade will start during your specified maintenance window.
7781

7882
> [!NOTE]
7983
> To ensure proper functionality, use a maintenance window of four hours or more.
8084
8185
For more information on Planned Maintenance, see [Use Planned Maintenance to schedule maintenance windows for your Azure Kubernetes Service (AKS) cluster][planned-maintenance].
8286

83-
## Auto upgrade limitations
84-
85-
If you’re using Auto-Upgrade you cannot anymore upgrade the control plane first, and then upgrade the individual node pools. Auto-Upgrade will always upgrade the control plane and the node pools together. In Auto-Upgrade there is no concept of upgrading the control plane only, and trying to run the command `az aks upgrade --control-plane-only` will raise the error: `NotAllAgentPoolOrchestratorVersionSpecifiedAndUnchanged: Using managed cluster api, all Agent pools' OrchestratorVersion must be all specified or all unspecified. If all specified, they must be stay unchanged or the same with control plane.`
86-
87-
## Best practices for auto-upgrade
87+
## Best practices for cluster auto-upgrade
8888

8989
The following best practices will help maximize your success when using auto-upgrade:
9090

9191
- In order to keep your cluster always in a supported version (i.e within the N-2 rule), choose either `stable` or `rapid` channels.
9292
- 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.
93+
- To automatically upgrade node images while using a different cluster upgrade channel, consider using the [node image auto-upgrade][node-image-auto-upgrade] `NodeImage` channel.
9394
- Follow [Operator best practices][operator-best-practices-scheduler].
9495
- Follow [PDB best practices][pdb-best-practices].
9596

@@ -98,7 +99,7 @@ The following best practices will help maximize your success when using auto-upg
9899
[upgrade-aks-cluster]: upgrade-cluster.md
99100
[planned-maintenance]: planned-maintenance.md
100101
[operator-best-practices-scheduler]: operator-best-practices-scheduler.md#plan-for-availability-using-pod-disruption-budgets
101-
102+
[node-image-auto-upgrade]: auto-upgrade-node-image.md
102103

103104
<!-- EXTERNAL LINKS -->
104105
[pdb-best-practices]: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
---
2+
title: Automatically upgrade Azure Kubernetes Service (AKS) cluster node operating system images
3+
description: Learn how to automatically upgrade Azure Kubernetes Service (AKS) cluster node operating system images.
4+
services: container-service
5+
ms.topic: article
6+
ms.author: nickoman
7+
author: nickomang
8+
ms.date: 02/03/2023
9+
---
10+
11+
# Automatically upgrade Azure Kubernetes Service cluster node operating system images
12+
13+
AKS supports upgrading the images on a node so your cluster is up to date with the newest operating system (OS) and runtime updates. AKS regularly provides new node OS images with the latest updates, so it's beneficial to upgrade your node's images regularly for the latest AKS features and to maintain security. Before learning about auto-upgrade, make sure you understand upgrade fundamentals by reading [Upgrade an AKS cluster][upgrade-aks-cluster].
14+
15+
The latest AKS node image information can be found by visiting the [AKS release tracker][release-tracker].
16+
17+
## Why use node OS auto-upgrade
18+
19+
Node OS 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.
20+
21+
## Prerequisites
22+
23+
- Must be using API version `11-02-preview` or later
24+
25+
- If using Azure CLI, the `aks-preview` CLI extension version `0.5.127` or later must be installed
26+
27+
- If using the `SecurityPatch` channel, the `NodeOsUpgradeChannelPreview` feature flag must be enabled on your subscription
28+
29+
### Register the 'NodeOsUpgradeChannelPreview' feature flag
30+
31+
Register the `NodeOsUpgradeChannelPreview` feature flag by using the [az feature register][az-feature-register] command, as shown in the following example:
32+
33+
```azurecli-interactive
34+
az feature register --namespace "Microsoft.ContainerService" --name "NodeOsUpgradeChannelPreview"
35+
```
36+
37+
It takes a few minutes for the status to show *Registered*. Verify the registration status by using the [az feature show][az-feature-show] command:
38+
39+
```azurecli-interactive
40+
az feature show --namespace "Microsoft.ContainerService" --name "NodeOsUpgradeChannelPreview"
41+
```
42+
43+
When the status reflects *Registered*, refresh the registration of the *Microsoft.ContainerService* resource provider by using the [az provider register][az-provider-register] command:
44+
45+
```azurecli-interactive
46+
az provider register --namespace Microsoft.ContainerService
47+
```
48+
49+
## Using node OS auto-upgrade
50+
51+
Automatically completed upgrades are functionally the same as manual upgrades. The timing of upgrades is determined by the selected channel. When making changes to auto-upgrade, allow 24 hours for the changes to take effect. By default, a cluster's node OS auto-upgrade channel is set to `Unmanaged`.
52+
53+
> [!NOTE]
54+
> Node OS image auto-upgrade won't affect the cluster's Kubernetes version, but it still still requires the cluster to be in a supported version to function properly.
55+
56+
The following upgrade channels are available:
57+
58+
|Channel|Description|OS-specific behavior|
59+
|---|---|
60+
| `None`| Your nodes will not have security updates applied automatically. This means you are solely responsible for your security updates|N/A|
61+
| `Unmanaged`|OS updates will be applied automatically through the OS built-in patching infrastructure. Newly allocated machines will be unpatched initially and will be patched at some point by the OS's infrastructure|Ubuntu applies security patches through unattended upgrade roughly once a day around 06:00 UTC. Windows and Mariner do not apply security patches automatically, so this option behaves equivalently to `None`|
62+
| `SecurityPatch`|AKS will update the node's virtual hard disk (VHD) with patches from the image maintainer labeled "security only" on a regular basis. Where possible, patches will also be applied without disruption to existing nodes. Some patches, such as kernel patches, cannot be applied to existing nodes without disruption. For such patches, the VHD will be updated and existing machines will be upgraded to that VHD following maintenance windows and surge settings. This option incurs the extra cost of hosting the VHDs in your node resource group.|N/A|
63+
| `NodeImage`|AKS will update the nodes with a newly patched VHD containing security fixes and bug fixes on a weekly cadence. The update to the new VHD is disruptive, following maintenance windows and surge settings. No extra VHD cost is incurred when choosing this option.|
64+
65+
To set the node OS auto-upgrade channel when creating a cluster, use the *node-os-upgrade-channel* parameter, similar to the following example.
66+
67+
```azurecli-interactive
68+
az aks create --resource-group myResourceGroup --name myAKSCluster --node-os-upgrade-channel SecurityPatch
69+
```
70+
71+
To set the auto-upgrade channel on existing cluster, update the *node-os-upgrade-channel* parameter, similar to the following example.
72+
73+
```azurecli-interactive
74+
az aks update --resource-group myResourceGroup --name myAKSCluster --node-os-upgrade-channel SecurityPatch
75+
```
76+
77+
## Using node OS auto-upgrade with Planned Maintenance
78+
79+
If you’re using Planned Maintenance and node OS auto-upgrade, your upgrade will start during your specified maintenance window.
80+
81+
> [!NOTE]
82+
> To ensure proper functionality, use a maintenance window of four hours or more.
83+
84+
For more information on Planned Maintenance, see [Use Planned Maintenance to schedule maintenance windows for your Azure Kubernetes Service (AKS) cluster][planned-maintenance].
85+
86+
<!-- LINKS -->
87+
[planned-maintenance]: planned-maintenance.md
88+
[release-tracker]: release-tracker.md
89+
[az-provider-register]: /cli/azure/provider#az-provider-register
90+
[az-feature-register]: /cli/azure/feature#az-feature-register
91+
[az-feature-show]: /cli/azure/feature#az-feature-show
92+
[upgrade-aks-cluster]: upgrade-cluster.md

0 commit comments

Comments
 (0)