Class HPAScalingRules
- java.lang.Object
-
- io.fabric8.kubernetes.api.model.autoscaling.v2.HPAScalingRules
-
- All Implemented Interfaces:
io.fabric8.kubernetes.api.builder.Editable<HPAScalingRulesBuilder>,io.fabric8.kubernetes.api.model.KubernetesResource,Serializable
@Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator") public class HPAScalingRules extends Object implements io.fabric8.kubernetes.api.builder.Editable<HPAScalingRulesBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.)
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HPAScalingRules()No args constructor for use in serializationHPAScalingRules(List<HPAScalingPolicy> policies, String selectPolicy, Integer stabilizationWindowSeconds, io.fabric8.kubernetes.api.model.Quantity tolerance)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HPAScalingRulesBuilderedit()Map<String,Object>getAdditionalProperties()List<HPAScalingPolicy>getPolicies()policies is a list of potential scaling polices which can be used during scaling.StringgetSelectPolicy()selectPolicy is used to specify which policy should be used.IntegergetStabilizationWindowSeconds()stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down.io.fabric8.kubernetes.api.model.QuantitygetTolerance()HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.voidsetAdditionalProperties(Map<String,Object> additionalProperties)voidsetAdditionalProperty(String name, Object value)voidsetPolicies(List<HPAScalingPolicy> policies)policies is a list of potential scaling polices which can be used during scaling.voidsetSelectPolicy(String selectPolicy)selectPolicy is used to specify which policy should be used.voidsetStabilizationWindowSeconds(Integer stabilizationWindowSeconds)stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down.voidsetTolerance(io.fabric8.kubernetes.api.model.Quantity tolerance)HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.HPAScalingRulesBuildertoBuilder()
-
-
-
Constructor Detail
-
HPAScalingRules
public HPAScalingRules()
No args constructor for use in serialization
-
HPAScalingRules
public HPAScalingRules(List<HPAScalingPolicy> policies, String selectPolicy, Integer stabilizationWindowSeconds, io.fabric8.kubernetes.api.model.Quantity tolerance)
-
-
Method Detail
-
getPolicies
public List<HPAScalingPolicy> getPolicies()
policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.
-
setPolicies
public void setPolicies(List<HPAScalingPolicy> policies)
policies is a list of potential scaling polices which can be used during scaling. If not set, use the default values: - For scale up: allow doubling the number of pods, or an absolute change of 4 pods in a 15s window. - For scale down: allow all pods to be removed in a 15s window.
-
getSelectPolicy
public String getSelectPolicy()
selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.
-
setSelectPolicy
public void setSelectPolicy(String selectPolicy)
selectPolicy is used to specify which policy should be used. If not set, the default value Max is used.
-
getStabilizationWindowSeconds
public Integer getStabilizationWindowSeconds()
stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
-
setStabilizationWindowSeconds
public void setStabilizationWindowSeconds(Integer stabilizationWindowSeconds)
stabilizationWindowSeconds is the number of seconds for which past recommendations should be considered while scaling up or scaling down. StabilizationWindowSeconds must be greater than or equal to zero and less than or equal to 3600 (one hour). If not set, use the default values: - For scale up: 0 (i.e. no stabilization is done). - For scale down: 300 (i.e. the stabilization window is 300 seconds long).
-
getTolerance
public io.fabric8.kubernetes.api.model.Quantity getTolerance()
HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.)
-
setTolerance
public void setTolerance(io.fabric8.kubernetes.api.model.Quantity tolerance)
HPAScalingRules configures the scaling behavior for one direction via scaling Policy Rules and a configurable metric tolerance.Scaling Policy Rules are applied after calculating DesiredReplicas from metrics for the HPA. They can limit the scaling velocity by specifying scaling policies. They can prevent flapping by specifying the stabilization window, so that the number of replicas is not set instantly, instead, the safest value from the stabilization window is chosen.
The tolerance is applied to the metric values and prevents scaling too eagerly for small metric variations. (Note that setting a tolerance requires enabling the alpha HPAConfigurableTolerance feature gate.)
-
edit
public HPAScalingRulesBuilder edit()
- Specified by:
editin interfaceio.fabric8.kubernetes.api.builder.Editable<HPAScalingRulesBuilder>
-
toBuilder
public HPAScalingRulesBuilder toBuilder()
-
-