Skip to content

Commit 4e49bd1

Browse files
authored
Merge pull request #209797 from MGoedtel/task1932328
new abort operation draft article
2 parents ae723ea + 05c5727 commit 4e49bd1

File tree

2 files changed

+84
-8
lines changed

2 files changed

+84
-8
lines changed

articles/aks/TOC.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,16 @@
172172
items:
173173
- name: Cluster operations
174174
items:
175+
- name: Abort long running operations
176+
href: manage-abort-operations.md
177+
- name: Automatically upgrade an AKS cluster
178+
href: auto-upgrade-cluster.md
179+
- name: Configure an AKS cluster
180+
href: cluster-configuration.md
181+
- name: Custom node configuration
182+
href: custom-node-configuration.md
183+
- name: Integrate ACR with an AKS cluster
184+
href: cluster-container-registry-integration.md
175185
- name: Scale an AKS cluster
176186
href: scale-cluster.md
177187
- name: Stop/Deallocate nodes with Scale-down Mode
@@ -184,8 +194,6 @@
184194
href: out-of-tree.md
185195
- name: Upgrade an AKS cluster
186196
href: upgrade-cluster.md
187-
- name: Automatically upgrade an AKS cluster
188-
href: auto-upgrade-cluster.md
189197
- name: Use Uptime SLA
190198
href: uptime-sla.md
191199
- name: Use Draft (preview)
@@ -198,12 +206,6 @@
198206
href: node-upgrade-github-actions.md
199207
- name: Process node OS updates
200208
href: node-updates-kured.md
201-
- name: Configure an AKS cluster
202-
href: cluster-configuration.md
203-
- name: Custom node configuration
204-
href: custom-node-configuration.md
205-
- name: Integrate ACR with an AKS cluster
206-
href: cluster-container-registry-integration.md
207209
- name: Create virtual nodes
208210
items:
209211
- name: Use virtual nodes
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
---
2+
title: Abort an Azure Kubernetes Service (AKS) long running operation
3+
description: Learn how to terminate a long running operation on an Azure Kubernetes Service cluster at the node pool or cluster level.
4+
services: container-service
5+
ms.topic: article
6+
ms.date: 09/06/2022
7+
8+
---
9+
10+
# Terminate a long running operation on an Azure Kubernetes Service (AKS) cluster
11+
12+
Sometimes deployment or other processes running within pods on nodes in a cluster can run for periods of time longer than expected due to various reasons. While it's important to allow those processes to gracefully terminate when they're no longer needed, there are circumstances where you need to release control of node pools and clusters with long running operations using an *abort* command.
13+
14+
AKS now supports aborting a long running operation, allowing you to take back control and run another operation seamlessly. This design is supported using the [Azure REST API](/rest/api/azure/) or the [Azure CLI](/cli/azure/).
15+
16+
The abort operation supports the following scenarios:
17+
18+
- If a long running operation is stuck or suspected to be in a bad state or failing, the operation can be aborted provided it's the last running operation on the Managed Cluster or agent pool.
19+
- If a long running operation is stuck or failing, that operation can be aborted.
20+
- An operation that was triggered in error can be aborted as long as the operation doesn't reach a terminal state first.
21+
22+
## Before you begin
23+
24+
This article assumes that you have an existing AKS cluster. If you need an AKS cluster, start with reviewing our guidance on how to design, secure, and operate an AKS cluster to support your production-ready workloads. For more information, see [AKS architecture guidance](/azure/architecture/reference-architectures/containers/aks-start-here).
25+
26+
## Abort a long running operation
27+
28+
### [Azure REST API](#tab/azure-rest)
29+
30+
You can use the Azure REST API [Abort](/rest/api/aks/managed-clusters) operation to stop an operation against the Managed Cluster.
31+
32+
The following example terminates a process for a specified agent pool.
33+
34+
```rest
35+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/agentPools/{agentPoolName}/abort
36+
```
37+
38+
The following example terminates a process for a specified managed cluster.
39+
40+
```rest
41+
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerService/managedclusters/{resourceName}/abort
42+
```
43+
44+
In the response, an HTTP status code of 204 is returned.
45+
46+
### [Azure CLI](#tab/azure-cli)
47+
48+
You can use the [az aks nodepool](/cli/azure/aks/nodepool) command with the `operation-abort` argument to abort an operation on a node pool or a managed cluster.
49+
50+
The following example terminates an operation on a node pool on a specified cluster by its name and resource group that holds the cluster.
51+
52+
```azurecli-interactive
53+
az aks nodepool operation-abort\
54+
55+
--resource-group myResourceGroup \
56+
57+
--cluster-name myAKSCluster \
58+
```
59+
60+
The following example terminates an operation against a specified managed cluster its name and resource group that holds the cluster.
61+
62+
```azurecli-interactive
63+
az aks operation-abort --name myAKSCluster --resource-group myResourceGroup
64+
```
65+
66+
In the response, an HTTP status code of 204 is returned.
67+
68+
---
69+
70+
The provisioning state on the managed cluster or agent pool should be **Canceled**. Use the REST API [Get Managed Clusters](/rest/api/aks/managed-clusters/get) or [Get Agent Pools](/rest/api/aks/agent-pools/get) to verify the operation. The provisioning state should update to **Canceled** within a few seconds of the abort request being accepted. Operation status of last running operation ID on the managed cluster/agent pool, which can be retrieved by performing a GET operation against the Managed Cluster or agent pool, should show a status of **Canceling**.
71+
72+
## Next steps
73+
74+
Learn more about [Container insights](../azure-monitor/containers/container-insights-overview.md) to understand how it helps you monitor the performance and health of your Kubernetes cluster and container workloads.

0 commit comments

Comments
 (0)