Skip to content

Commit 4c8634d

Browse files
authored
OS SKU migration GA docs
1 parent c7533f7 commit 4c8634d

File tree

1 file changed

+115
-55
lines changed

1 file changed

+115
-55
lines changed

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

Lines changed: 115 additions & 55 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,15 +42,15 @@ 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.
5656
* 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
6161
6262
### Prerequisites
6363
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).
6664
* An existing AKS cluster with at least one Ubuntu node pool.
6765
* 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.
6866
* Ensure the migration feature is working for you in test/dev before using the process on a production cluster.
6967
* 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.
7170
7271
### [Azure CLI](#tab/azure-cli)
7372
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-
11873
#### Migrate the OS SKU of your Ubuntu node pool
11974
12075
* 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
238193
az deployment group create --resource-group testRG --template-file 0base.json
239194
```
240195
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.
242197
243198
```azurecli-interactive
244199
az deployment group create --resource-group testRG --template-file 1mcupdate.json
245200
```
246201
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.
248203
249204
```azurecli-interactive
250205
az deployment group create --resource-group testRG --template-file 2apupdate.json
251206
```
252207
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.
238+
239+
##### base.tf
240+
241+
```terraform
242+
resource "azurerm_kubernetes_cluster" "k8s" {
243+
location = azurerm_resource_group.rg.location
244+
name = var.cluster_name
245+
resource_group_name = azurerm_resource_group.rg.name
246+
dns_prefix = var.dns_prefix
247+
tags = {
248+
Environment = "Development"
249+
}
250+
251+
default_node_pool {
252+
name = "azurelinuxpool"
253+
vm_size = "Standard_D2_v2"
254+
node_count = var.agent_count
255+
os_sku = "Ubuntu"
256+
}
257+
linux_profile {
258+
admin_username = "azurelinux"
259+
260+
ssh_key {
261+
key_data = file(var.ssh_public_key)
262+
}
263+
}
264+
network_profile {
265+
network_plugin = "kubenet"
266+
load_balancer_sku = "standard"
267+
}
268+
service_principal {
269+
client_id = var.aks_service_principal_app_id
270+
client_secret = var.aks_service_principal_client_secret
271+
}
272+
}
273+
```
274+
275+
3. To run an in-place OS SKU migraiton, just replace the **os_sku** to **AzureLinux** and re-apply the Terraform plan.
276+
277+
##### update.tf
278+
279+
```terraform
280+
resource "azurerm_kubernetes_cluster" "k8s" {
281+
location = azurerm_resource_group.rg.location
282+
name = var.cluster_name
283+
resource_group_name = azurerm_resource_group.rg.name
284+
dns_prefix = var.dns_prefix
285+
tags = {
286+
Environment = "Development"
287+
}
288+
289+
default_node_pool {
290+
name = "azurelinuxpool"
291+
vm_size = "Standard_D2_v2"
292+
node_count = var.agent_count
293+
os_sku = "AzureLinux"
294+
}
295+
linux_profile {
296+
admin_username = "azurelinux"
297+
298+
ssh_key {
299+
key_data = file(var.ssh_public_key)
300+
}
301+
}
302+
network_profile {
303+
network_plugin = "kubenet"
304+
load_balancer_sku = "standard"
305+
}
306+
service_principal {
307+
client_id = var.aks_service_principal_app_id
308+
client_secret = var.aks_service_principal_client_secret
309+
}
310+
}
311+
```
312+
253313
---
254314

255315
### Verify the OS SKU migration
@@ -265,8 +325,8 @@ Once the migration is complete on your test clusters, you should verify the foll
265325
266326
### Run the OS SKU migration on your production clusters
267327

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.
270330

271331
### Rollback
272332

@@ -283,7 +343,7 @@ If you experience issues during the OS SKU migration, you can roll back to your
283343
In this tutorial, you migrated existing nodes to Azure Linux using one of the following methods:
284344
285345
* Remove existing node pools and add new Azure Linux node pools.
286-
* In-place OS SKU migration (preview).
346+
* In-place OS SKU migration.
287347
288348
In the next tutorial, you learn how to enable telemetry to monitor your clusters.
289349

0 commit comments

Comments
 (0)