You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding TSG for remediating NAKS stuck workloads due to power failure
In the event of power-failure, Undercloud nodes will be powered-off
causing NAKS nodes running on powered-off UC node become not-ready,
which will result in stateful workloads being stuck on those not-ready
nodes. This TSG helps to move those stuck workloads to healthy nodes.
# Troubleshooting stuck (unable to reschedule) workloads in a Nexus Kubernetes Cluster
11
+
# Troubleshooting stuck (unable to reschedule) workloads in a Nexus Kubernetes Cluster due to power failure
12
12
13
-
This guide provides detailed steps for troubleshooting issues related to stuck workloads on Nexus Kubernetes Cluster not-ready nodes. If you're experiencing these issues due to bare-metal node power failure, this guide helps you identify and resolve the problem.
13
+
What is a stuck workload?
14
+
15
+
A stuck workload is a pod that is unable to reschedule to another node in a Kubernetes Cluster due to the node being not-ready. This issue can happen due to many reasons, including node power failure.
16
+
17
+
Kubernetes, by design, doesn't move workloads that are stateful in nature if the node they're running on becomes not-ready (for example, due to power failure). For more information, see [Kubernetes documentation](https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/#non-graceful-node-shutdown).
18
+
19
+
This guide details troubleshooting steps for cases where workloads on a Nexus Kubernetes Cluster become stuck due to bare-metal machine power failures. It also explains how to restart a stuck pod so that it can be rescheduled on a different node.
14
20
15
21
## Prerequisites
16
22
17
23
* Permissions to view Azure resources in the subscription where the Nexus Kubernetes Cluster is deployed
18
-
* Access to Azure monitoring
19
24
* Necessary permissions to make changes using `kubectl` commands in Nexus Kubernetes Cluster (for example, deleting nodes)
20
25
21
-
## Symptoms
26
+
## Diagnosing Stuck Workloads
22
27
23
-
* Nexus Kubernetes Cluster nodes are not-ready
24
-
* Pods that aren't daemon-set pods stuck on the not-ready nodes
28
+
If you observe that your applications aren't responding as expected, your workloads might be stuck on the not-ready nodes. To diagnose stuck workloads on Nexus Kubernetes Cluster not-ready nodes, look for the following symptoms:
25
29
26
-
## Cause
30
+
* To check if Nexus Kubernetes Cluster nodes are not-ready, run the following `kubectl` command in Nexus Kubernetes Cluster:
27
31
28
-
Kubernetes, by design, doesn't move workloads that are stateful in nature if the node they're running on becomes not-ready. For more information, see [Kubernetes documentation](https://kubernetes.io/docs/concepts/cluster-administration/node-shutdown/#non-graceful-node-shutdown).

29
36
30
-
The Nexus Kubernetes Cluster not-ready node could be caused by a power failure on the bare-metal machine in the cluster. You can verify by checking the "Idrac Power On" metric in Azure monitoring. If you have alerts set up for this metric, you might have received an alert indicating that the bare-metal machines are powered off.
37
+
If the command returns no results, then all the nodes are ready. Sometimes, nodes take a few minutes to become not-ready after the power failure, so you might need to run the command again after a few minutes. If nodes continue to show as ready even after reasonable time (5-10 mins) and your applications are still not responding, then the issue might be different, contact support for further assistance.
31
38
32
-
## Warning
39
+
* To list pods stuck on the not-ready nodes, run the following `kubectl` command in Nexus Kubernetes Cluster:
This command returns pods (stateful and daemon-set) that are stuck on the not-ready nodes. Pods status might show `Pending`, `Terminating`, or `Running`.
35
47
36
-
This guide requires deleting nodes from the Nexus Kubernetes Cluster. This action can cause Nexus Kubernetes Cluster nodes Rack Spread to be impacted.
48
+

37
49
38
-
### Host-Path storage
50
+
##Diagnosing Power Failure
39
51
40
-
If the pods are configured to use host-path storage on the node, deleting the node deletes the data too.
52
+
Once you have confirmed that the workloads are stuck on the not-ready nodes, the next step will help you diagnose if Nexus Kubernetes Cluster nodes are not-ready due to power failure of one or more bare-metal machines.
41
53
42
-
## Solution
54
+
To diagnose power failure on the bare-metal machine, look for the following symptoms:
43
55
44
-
To resolve the issue, follow these steps:
56
+
*To list bare-metal machines where not-ready Nexus Kubernetes Cluster nodes are running, run the following `kubectl` command in the Nexus Kubernetes Cluster:
45
57
46
-
1. Check the "Idrac Power On" metric in Azure monitoring to verify that the bare-metal machine is powered off. Following is an example screenshot of the metric in Azure monitoring:
This command returns the list of nodes and the bare-metal machine name where the nodes are running.
47
65
48
-

66
+

49
67
50
-
2. If the "Idrac Power On" metric indicates that the bare-metal machine is powered on (showing a value of 1), **don't proceed with the following steps**.
68
+
* To list bare-metal machines in the cluster that are powered off, run the following command at cluster managed resource group level:
51
69
52
-
3. If the "Idrac Power On" metric indicates that the bare-metal machine is powered off (showing a value of 0), take the following actions on all impacted Nexus Kubernetes Clusters within that environment:
Replace `<subscription-id>` with the subscription ID and `<managed-resource-group>` with the managed resource group of the cluster where bare-metal resources reside.
53
78
54
-
* Note down the name of the bare-metal machine that is powered off and managed-resource-group name. In the example screenshot in step 1, the machine name is `a12345bcde1co1` and managed-resource-group name is `poc02-19cf0b39e1e5-HostedResources-540F8D4E`. If this bare-metal machine is a compute node, then proceed with the following steps.
55
-
* To find out impacted Nexus Kubernetes Clusters due to the powered-off bare-metal machine, run the following `az networkcloud` command:
Replace `<subscription-id>` with the subscription ID and `<managed-resource-group>` where the bare-metal machine is located and `<powered-off-baremetal-machine-name>` with the name of the powered-off bare-metal machine noted earlier.
88
+

89
+
**Note:** This screenshot doesn't show subscription ID since it was already set in the Azure CLI session using `az account set --subscription <subscription-id>` command.
**Note:** The prior command might return Nexus Kubernetes Clusters that aren't impacted by the powered-off bare-metal machine. Further steps help you identify the impacted Nexus Kubernetes Clusters.
73
-
* If there are no Nexus Kubernetes Clusters in the list from prior command, then don't proceed with the next steps. However, if there are Nexus Kubernetes Clusters, run the following steps on each Nexus Kubernetes Cluster.
74
-
* Run following `kubectl`commandin the Nexus Kubernetes Cluster to get the list of all the nodes that are running on powered off bare-metal machines:
91
+
If the command returns no results, rerun the command after a few minutes. If the command still returns no results after a reasonable time (5-10 mins) and your workloads are still stuck, then the issue might be different, contact support for further assistance.
75
92
76
-
```bash
77
-
kubectl get nodes -l topology.kubernetes.io/baremetalmachine=<powered-off-baremetal-machine-name>
78
-
```
79
-
Replace `<powered-off-baremetal-machine-name>` with the name of the powered-off bare-metal machine noted earlier.
93
+
Cross check the powered off bare-metal machines names with the list of bare-metal machines where not-ready nodes are running. If the bare-metal machines where not-ready nodes are running are powered off, then the issue is due to power failure. Now, you can proceed to the next section to resolve the issue.
80
94
81
-
for example:
82
-
```bash
83
-
kubectl get nodes -l topology.kubernetes.io/baremetalmachine=a12345bcde1co1
84
-
```
85
-

If prior command doesn't list any nodes, no further action is needed for the current Nexus Kubernetes Cluster.
99
+
This guide requires deleting nodes from the Nexus Kubernetes Cluster. This action can cause Nexus Kubernetes Cluster VMs rack placement to be impacted. For more information, see [how the Nexus platform schedules a Nexus Kubernetes Cluster VM](./concepts-nexus-kubernetes-placement.md#how-the-nexus-platform-schedules-a-nexus-kubernetes-cluster-vm).
100
+
101
+
### Host-Path storage
102
+
103
+
If the pods are configured to use host-path storage on the node, deleting the node deletes the data too.
104
+
105
+
## Solution
88
106
89
-
Don't proceed with the next steps until all of the nodes statuses are not-ready from prior command. If the nodes are ready, thenwait and run the command again to check the status. When all the nodes statuses are not-ready, proceed to the next step.
107
+
To move the stuck workloads to other nodes in the Nexus Kubernetes Cluster, you need to delete the Nexus Kubernetes Cluster nodes that are not-ready due to power failure. The workloads that are stuck on the not-ready nodes will be rescheduled to other nodes in the Nexus Kubernetes Cluster. Additionally, new nodes are created to replace the deleted nodes automatically if there's enough capacity available in the cluster.
90
108
91
-
*Double check by refreshing the "Idrac Power On" metric in Azure monitoring to verify that the bare-metal machine is still powered off. If the machine is showing as **powered on, don't proceed with the next steps**. If the machine is still showing as powered off, proceed to the next step.
92
-
* To delete the nodes that are not-ready, run following `kubectl` command in the Nexus Kubernetes Cluster:
109
+
*From prior steps, note down the names of the powered-off bare-metal machines where the not-ready nodes are running.
110
+
* To delete the nodes that are not-ready, run the following `kubectl` command in the Nexus Kubernetes Cluster**for each powered-off bare-metal machine**:
* After you deleted the nodes, the workloads that were stuck on the not-ready nodes will be rescheduled to other nodes in the Nexus Kubernetes Cluster. **Note, this process might take upwards of 30 minutes to complete**. Additionally, new nodes are created to replace the deleted nodes automatically if there's enough capacity available in the cluster.
121
+
* After you deleted the nodes, the workloads that were stuck on the not-ready nodes should be rescheduled to other nodes in the Nexus Kubernetes Cluster. Run prior `kubectl`commandfor all remaining powered-off bare-metal machines noted earlier.
0 commit comments