When you launch a Containership cluster you will notice Cerebral as an option at the Select Plugins step of the process. If the plugin was not included during initial launch, be sure to install the plugin before moving forward in this guide.
Cerebral autoscaling can be setup on any of the worker pools within your CKE cluster. To get started, select the worker pool you wish to enable a policy on. Once there, navigate to the Autoscale section on the left hand navigation pane.
Select the Edit button:
From the drop down, select Enable and then press OK. This will enable Cerebral on your cluster.
Next step is to configure your autoscaling settings. The following defaults will be set, but feel free to adjust them to meet your specific use case. When satisfied select OK.
Here is a breakdown of what each setting is:
Cooldown Period (Seconds): The duration after an autoscaling event occurs until additional scaling events can occur.
Minimum Size (Nodes): The minimum amount of nodes allowed, even if the threshold is reached.
Maximum Size (Nodes): The maximum amount of nodes allowed, even if the threshold is reached.
Now determine what metric(s) you want to base your autoscaling policies on. There are three options exposed in the UI, each with similar settings once selected.
Once you select a metric type, you can configure your Autoscaling Policy. The values will be filled in by default but be sure to adjust them to meet your specific requirements if necessary.
Here is a breakdown on each option:
Autoscaling Metric - Select a metric you want to scale by (CPU or Memory).
Metric Type: Utilization versus Allocation
Sample Period: The duration over which the metric is measured before an autoscaling event occurs.
Poll Interval: Interval upon which metrics are scraped from the metrics source.
Scale Up Threshold - Add nodes when your node pool metric exceeds this threshold.
Scale Up Amount - Select how many nodes you want to add when the threshold is reached.
Scale Down Threshold: Remove nodes when your node pool drops below this threshold
Scale Down Amount: Number of nodes to remove once threshold is reached
Once your policy is in place, you will see the threshold amounts overlaid on the selected worker nodes current metrics.
Looking for more info on Cerebral, want to tie in a different metric from Prometheus or have a suggestion? The project is open source and open to your contributions. Check out the repo here: https://github.com/containership/cerebral