feat: add hpa configuration
Description
This MR adds HPA configuration and sensible defaults for scaling. The scaling is turned on by default, though it can be turned off on cluster or instance level. The configuration can be adjusted per instance, based on the needs.
The config allows memory and/or CPU based scaling, though -- for now -- we only use CPU based scaling. The current default settings were assigned based on quick measurements visible below.
Supporting information
This MR is related to grove!95 (merged) and https://github.com/overhangio/tutor/pull/677
Testing instructions
Steps to test the changes:
- Run
./kubectl -n tutor14 get hpa
and validate that the number of replicas are1
for every pod - Run
./kubectl -n tutor14 get hpa --watch
to see the changes - Install
hey
- Run
hey -disable-keepalive -n 1000 -c 10 'https://tutor14.staging.do.opencraft.hosting/heartbeat?extended'
-- this will put "some" load on the cluster - Validate that the replicas will increase in a bit -- note: it will take time to cool down after the pressure
Dependencies
N/A
Screenshots
before scaling
after scaling
memory usage
Edited by Boros Gábor