Skip to main content

nodes

Creates, updates, deletes, gets or lists a nodes resource.

Overview

Namenodes
TypeResource
Iddigitalocean.kubernetes.nodes

Fields

The following fields are returned by SELECT queries:

SELECT not supported for this resource, use SHOW METHODS to view available operations for the resource.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
kubernetes_delete_nodedeletecluster_id, node_pool_id, node_idskip_drain, replaceTo delete a single node in a pool, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID.

Appending the skip_drain=1 query parameter to the request causes node
draining to be skipped. Omitting the query parameter or setting its value to
0 carries out draining prior to deletion.

Appending the replace=1 query parameter to the request causes the node to
be replaced by a new one after deletion. Omitting the query parameter or
setting its value to 0 deletes without replacement.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
cluster_idstring (uuid)A unique ID that can be used to reference a Kubernetes cluster. (example: bd5f5959-5e1e-4205-a714-a914373942af)
node_idstring (uuid)A unique ID that can be used to reference a node in a Kubernetes node pool. (example: 478247f8-b1bb-4f7a-8db9-2a5f8d4b8f8f)
node_pool_idstring (uuid)A unique ID that can be used to reference a Kubernetes node pool. (example: cdda885e-7663-40c8-bc74-3a036c66545d)
replaceintegerSpecifies whether or not to replace a node after it has been deleted. Setting it to 1 causes the node to be replaced by a new one after deletion. Omitting the query parameter or setting its value to 0 deletes without replacement. (example: 1)
skip_drainintegerSpecifies whether or not to drain workloads from a node before it is deleted. Setting it to 1 causes node draining to be skipped. Omitting the query parameter or setting its value to 0 carries out draining prior to deletion. (example: 1)

DELETE examples

To delete a single node in a pool, send a DELETE request to
/v2/kubernetes/clusters/$K8S_CLUSTER_ID/node_pools/$NODE_POOL_ID/nodes/$NODE_ID.

Appending the skip_drain=1 query parameter to the request causes node
draining to be skipped. Omitting the query parameter or setting its value to
0 carries out draining prior to deletion.

Appending the replace=1 query parameter to the request causes the node to
be replaced by a new one after deletion. Omitting the query parameter or
setting its value to 0 deletes without replacement.

DELETE FROM digitalocean.kubernetes.nodes
WHERE cluster_id = '{{ cluster_id }}' --required
AND node_pool_id = '{{ node_pool_id }}' --required
AND node_id = '{{ node_id }}' --required
AND skip_drain = '{{ skip_drain }}'
AND replace = '{{ replace }}';