Skip to content

Commit e1ab00a

Browse files
author
Jill Grant
authored
Merge pull request #280976 from suhuruli/suhuruli/aks-ossku-migration-ga
OS SKU migration GA docs
2 parents d955480 + 72d4522 commit e1ab00a

File tree

2 files changed

+116
-57
lines changed

2 files changed

+116
-57
lines changed

articles/aks/create-node-pools.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ The Azure Linux container host for AKS is an open-source Linux distribution avai
163163
You can migrate your existing Ubuntu nodes to Azure Linux using one of the following methods:
164164
165165
* [Remove existing node pools and add new Azure Linux node pools](../azure-linux/tutorial-azure-linux-migration.md#add-azure-linux-node-pools-and-remove-existing-node-pools).
166-
* [In-place OS SKU migration (preview)](../azure-linux/tutorial-azure-linux-migration.md#in-place-os-sku-migration-preview).
166+
* [In-place OS SKU migration (preview)](../azure-linux/tutorial-azure-linux-migration.md#in-place-os-sku-migration).
167167
168168
## Node pools with unique subnets
169169

articles/azure-linux/tutorial-azure-linux-migration.md

Lines changed: 115 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ ms.date: 01/19/2024
1515
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:
1616

1717
* Remove existing node pools and add new Azure Linux node pools.
18-
* In-place OS SKU migration (preview).
18+
* In-place OS SKU migration.
1919

2020
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.
2121

@@ -42,79 +42,33 @@ If you don't have any existing nodes to migrate to Azure Linux, skip to the [nex
4242
az aks nodepool delete --resource-group <resource-group-name> --cluster-name <cluster-name> --name <node-pool-name>
4343
```
4444
45-
## In-place OS SKU migration (preview)
45+
## In-place OS SKU migration
4646
4747
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.
4848
4949
### Limitations
5050
5151
There are several settings that can block the OS SKU migration request. To ensure a successful migration, review the following guidelines and limitations:
5252
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.
5454
* The OS SKU migration feature isn't able to rename existing node pools.
5555
* Ubuntu and Azure Linux are the only supported Linux OS SKU migration targets.
56-
* AgentPool `count` field must not change during the migration.
5756
* An Ubuntu OS SKU with `UseGPUDedicatedVHD` enabled can't perform an OS SKU migration.
5857
* An Ubuntu OS SKU with CVM 20.04 enabled can't perform an OS SKU migration.
5958
* Node pools with Kata enabled can't perform an OS SKU migration.
6059
* Windows OS SKU migration isn't supported.
6160
6261
### Prerequisites
6362
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).
6663
* An existing AKS cluster with at least one Ubuntu node pool.
6764
* 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.
6865
* Ensure the migration feature is working for you in test/dev before using the process on a production cluster.
6966
* 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).
67+
* You need Azure CLI version [2.61.0](https://learn.microsoft.com/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).
68+
* 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.
7169
7270
### [Azure CLI](#tab/azure-cli)
7371
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:
105-
106-
```output
107-
Name State
108-
---------------------------------------------- -------
109-
Microsoft.ContainerService/OSSKUMigrationPreview Registered
110-
```
111-
112-
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-
11872
#### Migrate the OS SKU of your Ubuntu node pool
11973
12074
* 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 +192,123 @@ There are several settings that can block the OS SKU migration request. To ensur
238192
az deployment group create --resource-group testRG --template-file 0base.json
239193
```
240194
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).
195+
3. Migrate the OS SKU of your system node pool to Azure Linux using the `az deployment group create` command.
242196
243197
```azurecli-interactive
244198
az deployment group create --resource-group testRG --template-file 1mcupdate.json
245199
```
246200
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).
201+
4. Migrate the OS SKU of your system node pool back to Ubuntu using the `az deployment group create` command.
248202
249203
```azurecli-interactive
250204
az deployment group create --resource-group testRG --template-file 2apupdate.json
251205
```
252206
207+
### [Terraform](#tab/terraform)
208+
209+
#### Example Terraform template
210+
211+
1. Confirm that your `providers.tf` file is updated to pick up the required version of the Azure provider.
212+
213+
##### providers.tf
214+
215+
```terraform
216+
terraform {
217+
required_version = ">=1.0"
218+
219+
required_providers {
220+
azurerm = {
221+
source = "hashicorp/azurerm"
222+
version = "~>3.111.0"
223+
}
224+
random = {
225+
source = "hashicorp/random"
226+
version = "~>3.0"
227+
}
228+
}
229+
}
230+
231+
provider "azurerm" {
232+
features {}
233+
}
234+
```
235+
236+
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.
237+
238+
##### base.tf
239+
240+
```terraform
241+
resource "azurerm_kubernetes_cluster" "k8s" {
242+
location = azurerm_resource_group.rg.location
243+
name = var.cluster_name
244+
resource_group_name = azurerm_resource_group.rg.name
245+
dns_prefix = var.dns_prefix
246+
tags = {
247+
Environment = "Development"
248+
}
249+
250+
default_node_pool {
251+
name = "azurelinuxpool"
252+
vm_size = "Standard_D2_v2"
253+
node_count = var.agent_count
254+
os_sku = "Ubuntu"
255+
}
256+
linux_profile {
257+
admin_username = "azurelinux"
258+
259+
ssh_key {
260+
key_data = file(var.ssh_public_key)
261+
}
262+
}
263+
network_profile {
264+
network_plugin = "kubenet"
265+
load_balancer_sku = "standard"
266+
}
267+
service_principal {
268+
client_id = var.aks_service_principal_app_id
269+
client_secret = var.aks_service_principal_client_secret
270+
}
271+
}
272+
```
273+
274+
3. To run an in-place OS SKU migration, just replace the **os_sku** to **AzureLinux** and re-apply the Terraform plan.
275+
276+
##### update.tf
277+
278+
```terraform
279+
resource "azurerm_kubernetes_cluster" "k8s" {
280+
location = azurerm_resource_group.rg.location
281+
name = var.cluster_name
282+
resource_group_name = azurerm_resource_group.rg.name
283+
dns_prefix = var.dns_prefix
284+
tags = {
285+
Environment = "Development"
286+
}
287+
288+
default_node_pool {
289+
name = "azurelinuxpool"
290+
vm_size = "Standard_D2_v2"
291+
node_count = var.agent_count
292+
os_sku = "AzureLinux"
293+
}
294+
linux_profile {
295+
admin_username = "azurelinux"
296+
297+
ssh_key {
298+
key_data = file(var.ssh_public_key)
299+
}
300+
}
301+
network_profile {
302+
network_plugin = "kubenet"
303+
load_balancer_sku = "standard"
304+
}
305+
service_principal {
306+
client_id = var.aks_service_principal_app_id
307+
client_secret = var.aks_service_principal_client_secret
308+
}
309+
}
310+
```
311+
253312
---
254313

255314
### Verify the OS SKU migration
@@ -265,8 +324,8 @@ Once the migration is complete on your test clusters, you should verify the foll
265324
266325
### Run the OS SKU migration on your production clusters
267326

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.
327+
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.
328+
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.
270329

271330
### Rollback
272331

@@ -283,7 +342,7 @@ If you experience issues during the OS SKU migration, you can roll back to your
283342
In this tutorial, you migrated existing nodes to Azure Linux using one of the following methods:
284343
285344
* Remove existing node pools and add new Azure Linux node pools.
286-
* In-place OS SKU migration (preview).
345+
* In-place OS SKU migration.
287346
288347
In the next tutorial, you learn how to enable telemetry to monitor your clusters.
289348

0 commit comments

Comments
 (0)