Open NShaforostov opened 2 years ago
From the technical point of view we would like to achieve the following goals:
I suggest using an additional autoscaling service which can horizontally autoscale both kubernetes deployments and kubernetes nodes in order to achieve some predefined target utilization. The following key points give more in-depth understanding of the approach.
The following autoscaling algorithm can be used by the autoscaling service.
The following settings shall be configured for the autoscaling service to work:
The follow autoscaler parameters were checked:
trigger
:
cluster_nodes_per_target_replicas
,target_replicas_per_target_nodes
,cpu_utilization
: max
, monitoring_period
memory_utilization
: max
, monitoring_period
rules
:
on_threshold_trigger
: extra_replicas
, extra_nodes
limit
:
min_nodes_number
,max_nodes_number
, min_replicas_number
,max_replicas_number
,min_scale_interval
,min_triggers_duration
Cherry-picked to release/0.16
via 46ba80cb3ead2e43721a502404b1e3e4949255cf, 4eb26dbcef6227f133d534736054136fd623a82d, a19e73fbee597f09321d7981809ccbcfbc461835, e60fbcded01ef44c52b070e331177936c6f7a5f8 and 90e593c422d65d58d2d6fe2bdec38861e2a3d157.
Background
As separate Cloud Pipeline deployments may face periodically with large workload peaks, it would be useful to implement an autoscaling of the system nodes (HA service) - to allow scaling up and down of the service according to the actual workload.
Approach
We shall monitor the state of the system API instances (at least, their RAM and/or CPUs consumption). HA service shall have the minimum limit of instances to run itself. If the consumption exceeds some predefined threshold during some time - new instances on the system needs shall be launched (i.e. HA service shall be scaled up). If the workload is subsided, then additional instances shall be stopped (i.e. HA service shall be scaled down - but to not less than predefined minimal limit of instances).
I suppose that described behavior shall be managed by some new system preferences, e.g.:
Additionally