Auto Scaling with Kubernetes

Auto-Scale Policy

The auto-scale policy governs scaling up or down the number of nodes of a Kubernetes cluster to provide more or fewer compute resources respectively for your application. By optionally defining the target CPU load, Memory load, and/or number of Active Connections, the Auto-Scale policy will automatically add or remove nodes within the Kubernetes cluster so that the average value per node is approximately equal to the target. Once the auto-scale policy is created, it can be referenced when creating a new cluster from the cluster instance page.

Add Auto Scale Policy to Cluster

When creating a Kubernetes App Definition, under Advanced Settings, ScaleWithCluster should be set to true to have Kubernetes scale your app across all nodes within the cluster. Otherwise, your app will only run on one node in the cluster. As a result of that, auto-scale will not trigger, and you won't be unable to take advantage of an auto-scaled cluster.

Note: Auto-scale only supports Kubernetes deployments at this time.

Create An Auto-Scale Policy

1. Expand the Policies menu.

2. Select Auto-Scale Policy and click the + sign,

3. From the Create Auto Scale Policy screen, enter all required fields.

  • For the Minimum Nodes, set the minimum number of cluster nodes for your application

  • For the Maximum Nodes, set the maximum number of cluster nodes for your application

  • For Stabilization Window, enter the time, in seconds, that the monitored field should be sampled before triggering an auto-scale action. Setting larger values helps to stabilize scaling, while smaller values will allow your application to be more responsive to traffic.

4. Enter the parameter(s) you would like your application to scale on. You must choose to use at least one parameter from this list. In other words, at least one value must be non-zero.

  • Target CPU : The target average CPU load per node to maintain. Set to 0 to be disabled.

  • Target Memory : The target average memory utilization load per node to maintain. Set to 0 to be disabled.

  • Target Active Connections : The target number of active TCP connections per node to maintain. Set to 0 to be disabled.

5. Once your auto-scale policy is created, attach it to your Kubernetes cluster.

Auto-Scale Policy