Aller au contenu

Pod autoscaling#

Autoscaling by Horizontal Pod Autoscaling (HPA)#

Note: "metrics-server" add-on must be installed to use pod-autoscaling Ressource request must be configure on the desired ressource (deployment, replica set,...)

Policy Name Name of the policy to be created.
Set this parameter as required.
Default values
Associated Workload Workload with which the HPA policy is associated.
Cluster Name Cluster to which the workload belongs.
Cooldown Period Set a cooldown period, within which scaling will not be triggered again when a policy is triggered. For scale-down = 5m
For scale-up = 3m
Namespace Namespace to which the workload belongs.
Pod Range Enter the minimum and maximum numbers of pods. When a policy is triggered, the workload pods are scaled within this range.
Rules Metric: You can select CPU usage or Memory usage. Usage = CPUs or memory used by pods/Requested CPUs or memory.
Expected Value: Enter an expected value. The expected value of the selected metric works with the threshold. The actual number of pods to be scaled is calculated using the following formula: Expected Value/Threshold x Number of current pods
Threshold: When the metric value is less than the scale-in threshold, scale-in is triggered. When the metric value is greater than the scale-out threshold, scale-out is triggered. You can click
 Add Rule again to add more scaling policies.

Basic template:#

Policy Name: mem-cpu

Cluster Name: < cluster-name >

Namespace: < namespace >

Associated Workload: < deployment, replica set,... >

Pod Range: 1 to 10 (must be adapted to the needs)

Cooldown Period: scale-down = 5m, scale-up = 5m

Rules:

Metric Expected Value Threshold
CPU usage 50% Scale down 33% Scale up 80%
Memory usage 50% Scale down 33% Scale up 80%

Autoscaling by AOM (Not tested for the moment)#

Metric-based policy#

Parameter Description
Policy Name Enter the name of the scaling policy.
Policy Type Set this parameter to Metric-based policy.
Metric Set the metrics that describe the resource performance data or status.
CPU Usage: indicates the CPU usage of the measured object, that is, the percentage of the CPU cores actually used by the measured object to the total CPU cores that the measured object has requested. 
Physical Memory Usage: indicates the percentage of the physical memory size used by the measured object to the physical memory size that the measured object has applied for.
Trigger Condition You can set this parameter based on CPU Usage or Physical Memory Usage.
If you set this parameter to the average physical memory usage > 70%, the scaling policy will be triggered when the average memory usage exceeds 70%.
Monitoring window Metric statistics period. Select a value from the drop-down list box.
If the parameter is set to 20s, metric statistics is collected every 20 seconds.
Threshold Crossings If the parameter is set to 3, the action is triggered if threshold is reached for three consecutive measurement periods.
Action Action executed after a policy is triggered. Two actions are available: add or reduce pods.

Scheduled policy#

Parameter Description
Policy Name Enter the name of the scaling policy.
Policy Type Set this parameter to Scheduled policy.
Trigger Time Time at which the policy is enforced.
Action Action executed after a policy is triggered. Three actions are available: add pods, reduce pods, and set the number of pods.

Periodic policy#

Parameter Description
Policy Name Enter the name of the scaling policy.
Policy Type Set this parameter to Periodic policy.
Time Range Specify the time for triggering the policy.
Action Action executed after a policy is triggered. Three actions are available: add pods, reduce pods, and set the number of pods.