Auto scaling nodes using the linode API/cli

Hi,

This is my first post here!

We have a couple of linodes, and we are very happy with them.

We are looking into adding a load balancer in front of them, and being able to add an extra node in case of extra traffic coming to our websites. I know it is possible to do create or remove nodes using the API or the CLI, but I can't find any resource to be able to do that automatically.

Here is a list of things I can't find yet:

  • How to get system usage (cpu, memory) of a linode using the API/CLI?

  • How to configure private IP address using a linode? (this will be needed to connect it to the noad balancer)

  • How to get the node balancer status if we go over the concurrency limit (unlikely, but we never know)?

Thanks!

3 Replies

Hi Noel, and welcome to the forums! I'd be glad to try and help you out with your inquiries.

Unfortunately you can't get the CPU and Memory usage from our APIs, but you should be able to set up your own code to read that from your server, which would also be more reliable (reading from your server directly, instead of reading from our stats boxes that read from your server, takes one step and potential point of failure out of the procedure).

You can get the Private IP of a Linode through the API when you add one, which is found here: https://www.linode.com/api/linode/linode.ip.addprivate

There is also no way to grab your current connections from the NodeBalancer API. I would suggest setting up a script that checks to see if all aspects are still up and running every x minutes/seconds, and you can use the API to programmatically list out your NodeBalancers and connected Nodes to check each one.

@mkorsak:

Unfortunately you can't get the CPU and Memory usage from our APIs.

Is there a reason this information isn't included in the API in something like the linode.list action? Historical data would be cool but I could live with instantaneous.

I don't have a reasoning for why it isn't included now, but I agree that it would be great to have. I'll pass this request on to see if it can be included in a future update.

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct