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
In this tutorial, part three of five, you migrate your existing nodes to Azure Linux. You can migrate your existing nodes to Azure Linux using one of the following methods:
16
16
17
17
* Remove existing node pools and add new Azure Linux node pools.
18
-
* In-place OS SKU migration (preview).
18
+
* In-place OS SKU migration.
19
19
20
20
If you don't have any existing nodes to migrate to Azure Linux, skip to the [next tutorial](./tutorial-azure-linux-telemetry-monitor.md). In later tutorials, you learn how to enable telemetry and monitoring in your clusters and upgrade Azure Linux nodes.
21
21
@@ -42,15 +42,15 @@ If you don't have any existing nodes to migrate to Azure Linux, skip to the [nex
42
42
az aks nodepool delete --resource-group <resource-group-name> --cluster-name <cluster-name> --name <node-pool-name>
43
43
```
44
44
45
-
## In-place OS SKU migration (preview)
45
+
## In-place OS SKU migration
46
46
47
47
You can now migrate your existing Ubuntu node pools to Azure Linux by changing the OS SKU of the node pool, which rolls the cluster through the standard node image upgrade process. This new feature doesn't require the creation of new node pools.
48
48
49
49
### Limitations
50
50
51
51
There are several settings that can block the OS SKU migration request. To ensure a successful migration, review the following guidelines and limitations:
52
52
53
-
* The OS SKU migration feature isn't available through Terraform, PowerShell, or the Azure portal.
53
+
* The OS SKU migration feature isn't available through PowerShell, or the Azure portal.
54
54
* The OS SKU migration feature isn't able to rename existing node pools.
55
55
* Ubuntu and Azure Linux are the only supported Linux OS SKU migration targets.
56
56
* AgentPool `count` field must not change during the migration.
@@ -61,60 +61,15 @@ There are several settings that can block the OS SKU migration request. To ensur
61
61
62
62
### Prerequisites
63
63
64
-
* [Install the `aks-preview` extension](#install-the-aks-preview-extension).
65
-
* [Register the `OSSKUMigrationPreview` feature flag on your subscription](#register-the-osskumigrationpreview-feature-flag).
66
64
* An existing AKS cluster with at least one Ubuntu node pool.
67
65
* We recommend that you ensure your workloads configure and run successfully on the Azure Linux container host before attempting to use the OS SKU migration feature by [deploying an Azure Linux cluster](./quickstart-azure-cli.md) in dev/prod and verifying your service remains healthy.
68
66
* Ensure the migration feature is working for you in test/dev before using the process on a production cluster.
69
67
* Ensure that your pods have enough [Pod Disruption Budget](../aks/operator-best-practices-scheduler.md#plan-for-availability-using-pod-disruption-budgets) to allow AKS to move pods between VMs during the upgrade.
70
-
* You need Azure CLI version 0.5.172 or higher. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
68
+
* You need Azure CLI version [2.61.0](https://learn.microsoft.com/en-us/cli/azure/release-notes-azure-cli#may-21-2024) or higher. Run `az --version` to find the version. If you need to install or upgrade, see [Install Azure CLI](/cli/azure/install-azure-cli).
69
+
* If you are using Terraform, you must have [v3.111.0](https://github.com/hashicorp/terraform-provider-azurerm/releases/tag/v3.111.0) or greater of the AzureRM Terraform module.
71
70
72
71
### [Azure CLI](#tab/azure-cli)
73
72
74
-
#### Install the `aks-preview` extension
75
-
76
-
[!INCLUDE [preview features callout](~/reusable-content/ce-skilling/azure/includes/aks/includes/preview/preview-callout.md)]
77
-
78
-
1. Install the `aks-preview` extension using the `az extension add` command.
79
-
80
-
```azurecli-interactive
81
-
az extension add --name aks-preview
82
-
```
83
-
84
-
2. Update the extension to make sure you have the latest version using the `az extension update` command.
85
-
86
-
```azurecli-interactive
87
-
az extension update --name aks-preview
88
-
```
89
-
90
-
#### Register the `OSSKUMigrationPreview` feature flag
91
-
92
-
1. Register the `OSSKUMigrationPreview` feature flag on your subscription using the `az feature register` command.
93
-
94
-
```azurecli-interactive
95
-
az feature register --namespace Microsoft.ContainerService --name OSSKUMigrationPreview
96
-
```
97
-
98
-
2. Check the registration status using the `az feature list` command.
99
-
100
-
```azurecli-interactive
101
-
az feature list -o table --query "[?contains(name, 'Microsoft.ContainerService/OSSKUMigrationPreview')].{Name:name,State:properties.state}"
102
-
```
103
-
104
-
Your output should look similar to the following example output:
3. Refresh the registration of the `OSSKUMigrationPreview` feature flag using the `az provider register` command.
113
-
114
-
```azurecli-interactive
115
-
az provider register --namespace Microsoft.ContainerService
116
-
```
117
-
118
73
#### Migrate the OS SKU of your Ubuntu node pool
119
74
120
75
* Migrate the OS SKU of your node pool to Azure Linux using the `az aks nodepool update` command. This command updates the OS SKU for your node pool from Ubuntu to Azure Linux. The OS SKU change triggers an immediate upgrade operation, which takes several minutes to complete.
@@ -238,18 +193,123 @@ There are several settings that can block the OS SKU migration request. To ensur
238
193
az deployment group create --resource-group testRG --template-file 0base.json
239
194
```
240
195
241
-
3. Migrate the OS SKU of your system node pool to Azure Linux using the `az deployment group create` command and the ManagedClusters API in the [1mcupdate.json example ARM template](#1mcupdatejson).
196
+
3. Migrate the OS SKU of your system node pool to Azure Linux using the `az deployment group create` command.
242
197
243
198
```azurecli-interactive
244
199
az deployment group create --resource-group testRG --template-file 1mcupdate.json
245
200
```
246
201
247
-
4. Migrate the OS SKU of your system node pool back to Ubuntu using the `az deployment group create` command and the AgentPools API in the [2apupdate.json example ARM template](#2apupdatejson).
202
+
4. Migrate the OS SKU of your system node pool back to Ubuntu using the `az deployment group create` command.
248
203
249
204
```azurecli-interactive
250
205
az deployment group create --resource-group testRG --template-file 2apupdate.json
251
206
```
252
207
208
+
### [Terraform](#tab/terraform)
209
+
210
+
#### Example Terraform template
211
+
212
+
1. Confirm that your `providers.tf` file is updated to pick up the required version of the Azure provider.
213
+
214
+
##### providers.tf
215
+
216
+
```terraform
217
+
terraform {
218
+
required_version = ">=1.0"
219
+
220
+
required_providers {
221
+
azurerm = {
222
+
source = "hashicorp/azurerm"
223
+
version = "~>3.111.0"
224
+
}
225
+
random = {
226
+
source = "hashicorp/random"
227
+
version = "~>3.0"
228
+
}
229
+
}
230
+
}
231
+
232
+
provider "azurerm" {
233
+
features {}
234
+
}
235
+
```
236
+
237
+
2. For brevity, only the snippet of the Terraform template that is of interest is displayed below. In this initial configuration, an AKS cluster with a nodepool of **os_sku** with **Ubuntu** is deployed.
@@ -265,8 +325,8 @@ Once the migration is complete on your test clusters, you should verify the foll
265
325
266
326
### Run the OS SKU migration on your production clusters
267
327
268
-
1. Update your existing templates to set `OSSKU=AzureLinux`. In ARM templates, you use `"OSSKU: "AzureLinux"` in the `agentPoolProfile` section. In Bicep, you use `osSku: "AzureLinux"` in the `agentPoolProfile` section. Make sure that your `apiVersion` is set to `2023-07-01` or later.
269
-
2. Redeploy your ARM template for the cluster to apply the new `OSSKU` setting. During this deploy, your cluster behaves as if it's taking a node image upgrade. Your cluster surges capacity, and then reboots your existing nodes one by one into the latest AKS image from your new OS SKU.
328
+
1. Update your existing templates to set `OSSKU=AzureLinux`. In ARM templates, you use `"OSSKU: "AzureLinux"` in the `agentPoolProfile` section. In Bicep, you use `osSku: "AzureLinux"` in the `agentPoolProfile` section. Lastly, for Terraform, you use `"os_sku = "AzureLinux"` in the `default_node_pool` section. Make sure that your `apiVersion` is set to `2023-07-01` or later.
329
+
2. Redeploy your ARM, Bicep or Terraform template for the cluster to apply the new `OSSKU` setting. During this deploy, your cluster behaves as if it's taking a node image upgrade. Your cluster surges capacity, and then reboots your existing nodes one by one into the latest AKS image from your new OS SKU.
270
330
271
331
### Rollback
272
332
@@ -283,7 +343,7 @@ If you experience issues during the OS SKU migration, you can roll back to your
283
343
In this tutorial, you migrated existing nodes to Azure Linux using one of the following methods:
284
344
285
345
* Remove existing node pools and add new Azure Linux node pools.
286
-
* In-place OS SKU migration (preview).
346
+
* In-place OS SKU migration.
287
347
288
348
In the next tutorial, you learn how to enable telemetry to monitor your clusters.
0 commit comments