Skip to content

Commit c161c9d

Browse files
Merge pull request #272326 from schaffererin/delete-aks-cluster
New article for Delete an AKS cluster
2 parents 5db2899 + 0a2ea6e commit c161c9d

File tree

3 files changed

+69
-6
lines changed

3 files changed

+69
-6
lines changed

.openpublishing.redirection.azure-kubernetes-service.json

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,6 @@
351351
"redirect_url": "/cli/azure/aks#az_aks_create",
352352
"redirect_document_id": false
353353
},
354-
{
355-
"source_path_from_root": "/articles/aks/delete-cluster.md",
356-
"redirect_url": "/cli/azure/aks#az_aks_delete",
357-
"redirect_document_id": false
358-
},
359-
360354
{
361355
"source_path": "articles/aks/view-master-logs.md",
362356
"redirect_url": "/azure/aks/view-control-plane-logs",

articles/aks/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,8 @@
246246
href: scale-cluster.md
247247
- name: Stop and start an AKS cluster
248248
href: start-stop-cluster.md
249+
- name: Delete an AKS cluster
250+
href: delete-cluster.md
249251
- name: Configure private clusters
250252
items:
251253
- name: Create a private cluster

articles/aks/delete-cluster.md

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
---
2+
title: Delete an Azure Kubernetes Service (AKS) cluster
3+
description: Learn about deleting a cluster in Azure Kubernetes Service (AKS).
4+
ms.topic: overview
5+
ms.author: schaffererin
6+
author: schaffererin
7+
ms.date: 04/16/2024
8+
---
9+
10+
# Delete an Azure Kubernetes Service (AKS) cluster
11+
12+
This article outlines cluster deletion in Azure Kubernetes Service (AKS), including what happens when you delete a cluster, alternatives to deleting a cluster, and how to delete a cluster.
13+
14+
## What happens when you delete a cluster?
15+
16+
When you delete a cluster, the following resources are deleted:
17+
18+
* The [node resource group][node-resource-group] and its resources, including:
19+
* The virtual machine scale sets and virtual machines (VMs) for each node in the cluster
20+
* The virtual network and its subnets for the cluster
21+
* The storage for the cluster
22+
* The control plane and its resources
23+
* Any node instances in the cluster along with any pods running on those nodes
24+
25+
## Alternatives to deleting a cluster
26+
27+
Before you delete a cluster, consider **stopping the cluster**. Stopping an AKS cluster stops the control plane and agent nodes, allowing you to save on compute costs while maintaining all objects except standalone pods. When you stop a cluster, its state is saved and you can restart the cluster at any time. For more information, see [Stop an AKS cluster][stop-cluster].
28+
29+
If you want to delete a cluster to change its configuration, you can instead use the [AKS cluster upgrade][upgrade-cluster] feature to upgrade the cluster to a different Kubernetes version or change the node pool configuration. For more information, see [Upgrade an AKS cluster][upgrade-cluster].
30+
31+
## Delete a cluster
32+
33+
> [!IMPORTANT]
34+
> **You can't recover a cluster after it's deleted**. If you need to recover a cluster, you need to create a new cluster and redeploy your applications.
35+
### [Azure CLI](#tab/azure-cli)
36+
37+
Delete a cluster using the [`az aks delete`][az-aks-delete] command. The following example deletes the `myAKSCluster` cluster in the `myResourceGroup` resource group:
38+
39+
```azurecli-interactive
40+
az aks delete --name myAKSCluster --resource-group myResourceGroup
41+
```
42+
43+
### [Azure PowerShell](#tab/azure-powershell)
44+
45+
Delete a cluster using the [`Remove-AzAks`][remove-azaks] command. The following example deletes the `myAKSCluster` cluster in the `myResourceGroup` resource group:
46+
47+
```azurepowershell-interactive
48+
Remove-AzAksCluster -Name myAKSCluster -ResourceGroupName myResourceGroup
49+
```
50+
51+
### [Azure portal](#tab/azure-portal)
52+
53+
You can delete a cluster using the Azure portal. To delete a cluster, navigate to the **Overview** page for the cluster and select **Delete**. You can also delete a cluster from the **Resource group** page by selecting the cluster and then selecting **Delete**.
54+
55+
---
56+
57+
## Next steps
58+
59+
For more information about AKS, see [Core Kubernetes concepts for AKS][core-concepts].
60+
61+
<!-- LINKS -->
62+
[node-resource-group]: ./concepts-clusters-workloads.md#node-resource-group
63+
[stop-cluster]: ./start-stop-cluster.md
64+
[upgrade-cluster]: ./upgrade-cluster.md
65+
[az-aks-delete]: /cli/azure/aks#az_aks_delete
66+
[remove-azaks]: /powershell/module/az.aks/remove-azakscluster
67+
[core-concepts]: ./concepts-clusters-workloads.md

0 commit comments

Comments
 (0)