nodes
Creates, updates, deletes, gets or lists a nodes resource.
Overview
| Name | nodes |
| Type | Resource |
| Id | digitalocean.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:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
kubernetes_delete_node | delete | cluster_id, node_pool_id, node_id | skip_drain, replace | 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 nodedraining 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 tobe 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.
| Name | Datatype | Description |
|---|---|---|
cluster_id | string (uuid) | A unique ID that can be used to reference a Kubernetes cluster. (example: bd5f5959-5e1e-4205-a714-a914373942af) |
node_id | string (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_id | string (uuid) | A unique ID that can be used to reference a Kubernetes node pool. (example: cdda885e-7663-40c8-bc74-3a036c66545d) |
replace | integer | Specifies 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_drain | integer | Specifies 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
- kubernetes_delete_node
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 to0 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 }}'
;