Delete Kubernetes Cluster Node
DELETE https://infrahub-api.nexgencloud.com/v1/core/clusters/{id}/nodes/{node_id}
Removes a node from a specified Kubernetes cluster. Provide the cluster ID and node ID in the path to delete the specified node. You can obtain the node_id
by calling the Retrieve Node Details API.
Before deleting a node using the Infrahub API, remove it from Kubernetes to prevent orphaned resources:
kubectl drain <node-name> --ignore-daemonsets --delete-emptydir-data # Remove running workloads from the node
kubectl delete node <node-name> # Remove node from Kubernetes API
Once completed, you can proceed with deleting the node using this API.
Note: Any data stored on a deleted node will be permanently lost and cannot be recovered.
Path parameters
id integer
Required
The ID of the cluster from which a node is being removed.
node_id integer
Required
The ID of the node being deleted.
Attributes
status boolean
Indicates the result of the request to delete the cluster. true
signifies success, while false
indicates an error.
message string
A description of the status of the request to delete the cluster.
curl -X DELETE "https://infrahub-api.nexgencloud.com/v1/core/clusters/{id}/nodes/{node_id}"" \
-H "accept: application/json"\
-H "api_key: YOUR API KEY"
- To authenticate Infrahub API requests, add an
api_key
header to your API request that contains an API Key.
{
"status": true,
"message": "Cluster example-cluster is being deleted"
}
Returns
Returns the status of the request to delete a cluster. A true
status indicates successful deletion, otherwise an error has occurred.