Skip to content

Commit e6dbd42

Browse files
author
naman-msft
committed
added 2 new aks docs
1 parent 387002b commit e6dbd42

File tree

2 files changed

+178
-6
lines changed

2 files changed

+178
-6
lines changed

tools/abc_converted.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -206,12 +206,12 @@ Use the Deploy to Azure button or CLI commands to create an IoT Edge device base
206206

207207
```azurecli-interactive
208208
az vm create \
209-
--resource-group $RESOURCE_GROUP \
210-
--name $VM_NAME \
211-
--image Ubuntu2204 \
212-
--admin-username azureuser \
213-
--generate-ssh-keys \
214-
--custom-data cloud-init.txt
209+
--resource-group $RESOURCE_GROUP \
210+
--name $VM_NAME \
211+
--image Ubuntu2204 \
212+
--admin-username azureuser \
213+
--generate-ssh-keys \
214+
--custom-data cloud-init.txt
215215
```
216216

217217
* For PowerShell users, copy the following command into your PowerShell window, then replace the placeholder text with your own information:

tools/def.md

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
---
2+
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+
ms.topic: how-to
5+
ms.author: nickoman
6+
author: nickomang
7+
ms.subservice: aks-upgrade
8+
ms.date: 05/01/2023
9+
ms.custom: aks-upgrade, automation, innovation-engine
10+
---
11+
12+
# Automatically upgrade an Azure Kubernetes Service (AKS) cluster
13+
14+
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 the [AKS cluster upgrade fundamentals][upgrade-aks-cluster].
15+
16+
> [!NOTE]
17+
> Any upgrade operation, whether performed manually or automatically, upgrades the node image version if it's not already on the latest version. The latest version is contingent on a full AKS release and can be determined by visiting the [AKS release tracker][release-tracker].
18+
>
19+
> Auto-upgrade first upgrades the control plane, and then upgrades agent pools one by one.
20+
21+
## Why use cluster auto-upgrade
22+
23+
Cluster auto-upgrade provides a "set once and forget" mechanism that yields tangible time and operational cost benefits. You don't need to stop your workloads, redeploy your workloads, or create a new AKS cluster. By enabling auto-upgrade, you can ensure your clusters are up to date and don't miss the latest features or patches from AKS and upstream Kubernetes.
24+
25+
AKS follows a strict supportability versioning window. 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].
26+
27+
## Customer versus AKS-initiated auto-upgrades
28+
29+
You can specify cluster auto-upgrade specifics using the following guidance. The upgrades occur based on your specified cadence and are recommended to remain on supported Kubernetes versions.
30+
31+
AKS also initiates auto-upgrades for unsupported clusters. When a cluster in an n-3 version (where n is the latest supported AKS GA minor version) is about to drop to n-4, AKS automatically upgrades the cluster to n-2 to remain in an AKS support [policy][supported-kubernetes-versions]. Automatically upgrading a platform supported cluster to a supported version is enabled by default. Stopped node pools are upgraded during an auto-upgrade operation. The upgrade applies to nodes when the node pool is started. To minimize disruptions, set up [maintenance windows][planned-maintenance].
32+
33+
## Cluster auto-upgrade limitations
34+
35+
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 always upgrades the control plane and the node pools together. You can't upgrade the control plane only. Running the `az aks upgrade --control-plane-only` command raises the following 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.`
36+
37+
If using the `node-image` (legacy and not to be used) cluster auto-upgrade channel or the `NodeImage` node image auto-upgrade channel, Linux [unattended upgrades][unattended-upgrades] are disabled by default.
38+
39+
## Cluster auto-upgrade channels
40+
41+
Automatically completed upgrades are functionally the same as manual upgrades. The [selected auto-upgrade channel][planned-maintenance] determines the timing of upgrades. When making changes to auto-upgrade, allow 24 hours for the changes to take effect. Automatically upgrading a cluster follows the same process as manually upgrading a cluster. For more information, see [Upgrade an AKS cluster][upgrade-aks-cluster].
42+
43+
The following upgrade channels are available:
44+
45+
|Channel| Action | Example
46+
|---|---|---|
47+
| `none`| disables auto-upgrades and keeps the cluster at its current version of Kubernetes.| Default setting if left unchanged.|
48+
| `patch`| automatically upgrades the cluster to the latest supported patch version when it becomes available while keeping the minor version the same.| For example, if a cluster runs version *1.17.7*, and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, the cluster upgrades to *1.17.9*.|
49+
| `stable`| automatically upgrades 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 runs version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, the cluster upgrades to *1.18.6*.|
50+
| `rapid`| automatically upgrades the cluster to the latest supported patch release on the latest supported minor version.| In cases where the cluster's Kubernetes version is 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 runs version *1.17.7* and versions *1.17.9*, *1.18.4*, *1.18.6*, and *1.19.1* are available, the cluster first upgrades to *1.18.6*, then upgrades to *1.19.1*.|
51+
| `node-image`(legacy)| automatically upgrades the node image to the latest version available.| Microsoft provides patches and new images for image nodes frequently (usually weekly), but your running nodes don't get the new images unless you do a node image upgrade. Turning on the node-image channel automatically updates your node images whenever a new version is available. If you use this channel, Linux [unattended upgrades] are disabled by default. Node image upgrades work on patch versions that are deprecated, so long as the minor Kubernetes version is still supported. This channel is no longer recommended and is planned for deprecation in future. For an option that can automatically upgrade node images, see the `NodeImage` channel in [node image auto-upgrade][node-image-auto-upgrade]. |
52+
53+
> [!NOTE]
54+
>
55+
> Keep the following information in mind when using cluster auto-upgrade:
56+
>
57+
> * Cluster auto-upgrade only updates to GA versions of Kubernetes and doesn't update to preview versions.
58+
>
59+
> * With AKS, you can create a cluster without specifying the exact patch version. When you create a cluster without designating a patch, the cluster runs the minor version's latest GA patch. To learn more, see [AKS support window][supported-kubernetes-versions].
60+
>
61+
> * 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.
62+
>
63+
> * If you're using the preview API `11-02-preview` or later, and you select the `node-image` cluster auto-upgrade channel, the [node image auto-upgrade channel][node-image-auto-upgrade] automatically sets to `NodeImage`.
64+
>
65+
> * Each cluster can only be associated with a single auto-upgrade channel. This is because your specified channel determines the Kubernetes version that runs on the cluster.
66+
>
67+
> * If your cluster has no auto-upgrade channel and you enable it for LTS *(Long-Term Support)*, it will default to a `patch` auto-upgrade channel.
68+
69+
## Use cluster auto-upgrade with a new AKS cluster
70+
71+
### [Azure CLI](#tab/azure-cli)
72+
73+
* Set the auto-upgrade channel when creating a new cluster using the [`az aks create`][az-aks-create] command and the `auto-upgrade-channel` parameter.
74+
75+
```text
76+
export RANDOM_SUFFIX=$(openssl rand -hex 3)
77+
export RESOURCE_GROUP="myResourceGroup$RANDOM_SUFFIX"
78+
export AKS_CLUSTER_NAME="myAKSCluster"
79+
az aks create --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER_NAME --auto-upgrade-channel stable --generate-ssh-keys
80+
```
81+
82+
### [Azure portal](#tab/azure-portal)
83+
84+
1. In the Azure portal, select **Create a resource** > **Containers** > **Azure Kubernetes Service (AKS)**.
85+
2. In the **Basics** tab, under **Cluster details**, select the desired auto-upgrade channel from the **Automatic upgrade** dropdown. We recommend selecting the **Enabled with patch (recommended)** option.
86+
87+
:::image type="content" source="./media/auto-upgrade-cluster/portal-autoupgrade-new-cluster.png" alt-text="The screenshot of the create blade for an AKS cluster in the Azure portal. The automatic upgrade field shows 'Enabled with patch (recommended)' selected.":::
88+
89+
3. Complete the remaining steps to create the cluster.
90+
91+
---
92+
93+
## Use cluster auto-upgrade with an existing AKS cluster
94+
95+
### [Azure CLI](#tab/azure-cli)
96+
97+
* Set the auto-upgrade channel on an existing cluster using the [`az aks update`][az-aks-update] command with the `auto-upgrade-channel` parameter.
98+
99+
```azurecli-interactive
100+
export RESOURCE_GROUP="apache-airflow-rg"
101+
export AKS_CLUSTER_NAME="apache-airflow-aks"
102+
az aks update --resource-group $RESOURCE_GROUP --name $AKS_CLUSTER_NAME --auto-upgrade-channel stable
103+
```
104+
105+
Results:
106+
107+
<!-- expected_similarity=0.3 -->
108+
109+
```JSON
110+
{
111+
"id": "/subscriptions/xxxxx-xxxxx-xxxxx-xxxxx/resourceGroups/myResourceGroupabc123/providers/Microsoft.ContainerService/managedClusters/myAKSCluster",
112+
"properties": {
113+
"autoUpgradeChannel": "stable",
114+
"provisioningState": "Succeeded"
115+
}
116+
}
117+
```
118+
119+
### [Azure portal](#tab/azure-portal)
120+
121+
1. In the Azure portal, navigate to your AKS cluster.
122+
2. In the service menu, under **Settings**, select **Cluster configuration**.
123+
3. Under **Upgrade** > **Kubernetes version**, select **Upgrade version**.
124+
125+
:::image type="content" source="./media/auto-upgrade-cluster/portal-autoupgrade-existing-cluster.png" alt-text="The screenshot of the upgrade blade for an AKS cluster in the Azure portal.":::
126+
127+
4. On the **Upgrade Kubernetes version** page, select the desired auto-upgrade channel from the **Automatic upgrade** dropdown. We recommend selecting the **Enabled with patch (recommended)** option.
128+
129+
:::image type="content" source="./media/auto-upgrade-cluster/portal-autoupgrade-upgrade-page-existing-cluster.png" alt-text="The screenshot of the Upgrade Kubernetes page for an AKS cluster in the Azure portal.":::
130+
131+
5. Select **Save**.
132+
133+
---
134+
135+
## Use auto-upgrade with Planned Maintenance
136+
137+
If using Planned Maintenance and cluster auto-upgrade, your upgrade starts during your specified maintenance window.
138+
139+
> [!NOTE]
140+
> To ensure proper functionality, use a maintenance window of *four hours or more*.
141+
142+
For more information on how to set a maintenance window with Planned Maintenance, see [Use Planned Maintenance to schedule maintenance windows for your Azure Kubernetes Service (AKS) cluster][planned-maintenance].
143+
144+
## Best practices for cluster auto-upgrade
145+
146+
Use the following best practices to help maximize your success when using auto-upgrade:
147+
148+
* To ensure your cluster is always in a supported version (i.e within the N-2 rule), choose either `stable` or `rapid` channels.
149+
* 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 run the most recent node images.
150+
* 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.
151+
* Follow [Operator best practices][operator-best-practices-scheduler].
152+
* Follow [PDB best practices][pdb-best-practices].
153+
* For upgrade troubleshooting information, see the [AKS troubleshooting documentation][aks-troubleshoot-docs].
154+
155+
For a detailed discussion of upgrade best practices and other considerations, see [AKS patch and upgrade guidance][upgrade-operators-guide].
156+
157+
<!-- INTERNAL LINKS -->
158+
[supported-kubernetes-versions]: ./supported-kubernetes-versions.md
159+
[upgrade-aks-cluster]: ./upgrade-cluster.md
160+
[planned-maintenance]: ./planned-maintenance.md
161+
[operator-best-practices-scheduler]: operator-best-practices-scheduler.md#plan-for-availability-using-pod-disruption-budgets
162+
[node-image-auto-upgrade]: auto-upgrade-node-image.md
163+
[az-aks-create]: /cli/azure/aks#az_aks_create
164+
[az-aks-update]: /cli/azure/aks#az_aks_update
165+
[aks-troubleshoot-docs]: /support/azure/azure-kubernetes/welcome-azure-kubernetes
166+
[upgrade-operators-guide]: /azure/architecture/operator-guides/aks/aks-upgrade-practices
167+
168+
<!-- EXTERNAL LINKS -->
169+
[pdb-best-practices]: https://kubernetes.io/docs/tasks/run-application/configure-pdb/
170+
[release-tracker]: release-tracker.md
171+
[k8s-deprecation]: https://kubernetes.io/blog/2022/11/18/upcoming-changes-in-kubernetes-1-26/#:~:text=A%20deprecated%20API%20is%20one%20that%20has%20been,point%20you%20must%20migrate%20to%20using%20the%20replacement
172+
[unattended-upgrades]: https://help.ubuntu.com/community/AutomaticSecurityUpdates

0 commit comments

Comments
 (0)