Skip to content

Commit eb3fdab

Browse files
authored
Merge pull request #256645 from syzehra/syzehra/restartAction
[operator-nexus] Syzehra/restart action guide
2 parents 70ba77e + 81446ac commit eb3fdab

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

articles/operator-nexus/TOC.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,8 @@
103103
href: howto-kubernetes-service-load-balancer.md
104104
- name: Disable cgroupsv2 in Nexus Kubernetes 1.27+
105105
href: howto-disable-cgroupsv2.md
106+
- name: Restart Azure Operator Nexus Kubernetes cluster node
107+
href: howto-kubernetes-cluster-action-restart.md
106108
- name: Customize cluster DNS
107109
href: how-to-customize-kubernetes-cluster-dns.md
108110
- name: Nexus Virtual Machine
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
---
2+
title: Restart Azure Operator Nexus Kubernetes cluster node
3+
description: Learn how to restart Azure Operator Nexus Kubernetes cluster node
4+
author: syzehra
5+
ms.author: syzehra
6+
ms.service: azure-operator-nexus
7+
ms.topic: how-to
8+
ms.date: 10/22/2023
9+
ms.custom: template-how-to-pattern, devx-track-azurecli
10+
---
11+
12+
# Restart Azure Operator Nexus Kubernetes cluster node
13+
14+
Occasionally, a Nexus Kubernetes node might become unreachable. This article explains how to restart the node via the `az networkcloud kubernetescluster restart-node` CLI command.
15+
16+
Restarting a Nexus Kubernetes node can take up to 5 minutes to complete. However, if the Virtual Machine is in bad state, the restart action will eventually time out. Open an Azure support ticket for such instances.
17+
18+
## Before you begin
19+
> [!NOTE]
20+
> The approach outlined in this article represents an aggressive method for recovering an unreachable cluster VM. Workloads that are running on the VM will be terminated; therefore, this restart action should be considered a last resort.
21+
> Before performing a restart on a VM, consider first cordoning and draining the node, then gracefully shutting the VM down and bringing it back up.
22+
23+
Make sure you have the latest version of [necessary Azure CLI extensions](./howto-install-cli-extensions.md).
24+
25+
## Restart cluster node
26+
27+
### Get node name
28+
In order to restart the cluster VM, node-name is required, which can be obtained through
29+
- The az CLI command `az networkcloud kubernetescluster show --name "kubernetesClusterName" --resource-group "resourceGroupName" --subscription "subscriptionName` lists the details of the node.
30+
- Alternatively, `kubectl get node` lists the nodes.
31+
32+
### Run the CLI command to restart the Nexus Kubernetes cluster node
33+
34+
To restart a cluster node, run the command as follows:
35+
36+
``` azurecli
37+
az networkcloud kubernetescluster restart-node --node-name "nodeName" --kubernetes-cluster-name "kubernetesClusterName" --resource-group "resourceGroupName" --subscription "subscriptionName"
38+
```
39+
To use this command, you need to understand the various options for specifying the node, Nexus Kubernetes cluster, and resource group. Here are the available options:
40+
41+
- `--node-name` - is a required argument that specifies the name of the node that you want to restart within the Nexus Kubernetes cluster. You must provide the exact name of the node that you want to restart.
42+
- `--kubernetes-cluster-name` - is a required argument that specifies the name of the Nexus Kubernetes cluster that the node is a part of. You must provide the exact name of the cluster.
43+
- `--resource-group` - is a required argument that specifies the name of the resource group that the Nexus Kubernetes cluster is located in. You must provide the exact name of the resource group.
44+
- `--subscription` - is an optional argument that specifies the subscription that the resource group is located in. If you have multiple subscriptions, you have to specify which one to use.
45+
46+
47+
Sample output is as followed:
48+
49+
```json
50+
{
51+
"endTime": "2023-10-20T19:28:31.972299Z",
52+
"id": "/subscriptions/000000000-0000-0000-0000-000000000000/providers/Microsoft.NetworkCloud/locations/<location>/operationStatuses/000000000-0000-0000-0000-000000000000",
53+
"name":"7f835f51-9b85-4607-9be1-41f09c11bc24*B684BCD26460AF4CD9525D5F4FFABA73B623C6A465E9C1E26D7B12EDB3D3EA78",
54+
"resourceId": "/subscriptions/000000000-0000-0000-0000-000000000000/resourceGroups/myResourceGroup/providers/Microsoft.NetworkCloud/kubernetesClusters/myNexusK8sCluster",
55+
"startTime": "2023-10-20T19:27:52.561479Z",
56+
"status": "succeeded"
57+
}
58+
```
59+
60+
61+

0 commit comments

Comments
 (0)