Question

How to get node-id (for delete-node)?

Posted March 1, 2021 399 views
Kubernetes

https://www.digitalocean.com/docs/apis-clis/doctl/reference/kubernetes/cluster/node-pool/delete-node/

doctl kubernetes cluster node-pool delete-node <cluster-id|cluster-name> <pool-id|pool-name> <node-id> [flags]
(Please scroll left and right if the command is too long)

Please note how we have the option to use name instead of id for cluster and pool. However, for node, we must use id. Where can we find this id?

I could only find the name of the node (using node-pool list), but passing the name results in 404 could not find worker node

Thank you for your time and help!

1 comment
  • The UID output by doctl compute droplet list also returns 404 could not find worker node when passed into doctl kubernetes cluster node-pool delete-node..

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
Submit an Answer
2 answers

One potential solution: doctl kubernetes cluster node-pool list <cluster-id|cluster-name> [flags] outputs <node-id>, but -o json must be used

Hi there,

You can use the below options to list the ID of the worker nodes:

  1. doctl kubernetes cluster node-pool list <cluster-id|cluster-name> -o json
  2. doctl kubernetes cluster get <cluster-id|cluster-name> -o json
  3. doctl kubernetes cluster node-pool get <cluster-id|cluster-name> <pool-id|pool-name> -o json
  4. doctl compute droplet list | grep k8s:worker

Note :: Worker nodes come with the “k8s:worker” tag

I hope this helps!

Best Regards,
Purnima Kumari