# Deleting Nodes from Cluster

The steps to delete nodes from Kubernetes cluster are:

* Before you delete the node, make sure the **PodDisruptionBudget** is set to "**0**" on deleting node. Click [here](https://kubernetes.io/docs/tasks/run-application/configure-pdb/) for more information.
* To drain the node from the cluster, run the command below.

  ```
  kubectl drain <nodename> --ignore-daemonsets --delete-emptydir-data
  ```
* Once done draining the node, run the command below to delete it from the cluster.

  ```
  kubectl delete node <nodename>
  ```
* After deleting the node, check your Kubernetes cluster to ensure the node has been deleted.
* Make sure the node IP is removed from the LoadBalancer/NGINX to avoid intermittent issues in the environment.

{% hint style="info" %}
After removing a node from the cluster, ensure that the node IP is removed from the Nginx configuration.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.openg2p.org/operations/deployment/scaling/base-infrastructure/openg2p-cluster/cluster-setup/deleting-nodes-from-cluster.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
