digitalocean / doctl

The official command line interface for the DigitalOcean API.
https://docs.digitalocean.com/reference/doctl/
Apache License 2.0
3.25k stars 394 forks source link

How do I check droplets in a load-balancer are registered and in healthy state using the CLI? #1335

Open ktalebian opened 1 year ago

ktalebian commented 1 year ago

What is the problem this feature would solve? Please describe.

On the UI, when you add a droplet, you can check it status and it tells you if the box is healthy or not. However, I cannot figure how to find this information out via the CLI.

The command doctl compute load-balancer get <id> -o json does not have any information about the droplets other than their ID of them.

I have a deploy script and I want to swap old boxes with the new boxes. When the new boxes are brought into the load-balancer, I need to wait until the health check registers, and the LB deems them healthy before I take old boxes out of the LB. At the moment, my deploy script pauses, and I manually check the UI, and when the new boxes are healthy, I prompt it to continue.

danaelhe commented 1 year ago

Hi @ktalebian Thanks for the write up! This is currently not supported in doctl. I've talked to our internal Load Balance team and they've given us some direction on implementing it into doctl. I've created a ticket for the work and added it to our backlog and we will get to it as soon as we can. In the meantime, you could look into creating an alert policy to automate your process a bit. You can read about alert policies either via our API doc here or via doctl: doctl monitoring alert create [flags]