Some built-in policies have been provided to support some most common use cases, like autoscaling, loadbalancing or high availability. Users are also allowed to define their own policies to meet some special requirements.
Scaling In/Out Policy
ScalingInPolicy and ScalingOutPolicy are used to support basic autoscaling scenario. A typical spec definition of Scaling In/Out Policy is as followed:
# Sample scaling policy that can be attached to a cluster adjustment: # Adjustment type, valid values include: # EXACT_CAPACITY, CHANGE_IN_CAPACITY, CHANGE_IN_PERCENTAGE type: CHANGE_IN_CAPACITY # A number that will be interpreted based on the type setting # Define negative number for scaling in policy and positive # number for scaling out policy. number: 1 # When type is set CHNAGE_IN_PERCENTAGE, min_step specifies # that the cluster size will be changed by at least the number # of nodes specified here. min_step: 1 # When scaling operation will break the size limitation of # cluster, whether to do best effort scaling, e.g. decrease # cluster size to min_size or increase cluster size to max_size # Default False means reject scaling request directly. best_effort: True
The design of Scaling In/Out Policy are compatible with current ScalingPolicy design in Heat. User can define the adjustment type, number, min_step to describe the behavior of cluster resizing when a webhook bonded to CLUSTER_SCALE_IN/OUT action is triggered. Another parameter best_effort is used to decide whether cluster size will be adjusted as much as possible when the scaling operation will break the size limitation of cluster which is defined as followed:
min_size <= new_desired_capacity <= max_size
For more complicated autoscaling use cases, please refer to ScalingPolicy(WIP) for support.