Class HorizontalPodAutoscalerSpec
- java.lang.Object
-
- io.fabric8.kubernetes.api.model.autoscaling.v2.HorizontalPodAutoscalerSpec
-
- All Implemented Interfaces:
io.fabric8.kubernetes.api.builder.Editable<HorizontalPodAutoscalerSpecBuilder>,io.fabric8.kubernetes.api.model.KubernetesResource,Serializable
@Generated("io.fabric8.kubernetes.schema.generator.model.ModelGenerator") public class HorizontalPodAutoscalerSpec extends Object implements io.fabric8.kubernetes.api.builder.Editable<HorizontalPodAutoscalerSpecBuilder>, io.fabric8.kubernetes.api.model.KubernetesResource
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description HorizontalPodAutoscalerSpec()No args constructor for use in serializationHorizontalPodAutoscalerSpec(HorizontalPodAutoscalerBehavior behavior, Integer maxReplicas, List<MetricSpec> metrics, Integer minReplicas, CrossVersionObjectReference scaleTargetRef)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HorizontalPodAutoscalerSpecBuilderedit()Map<String,Object>getAdditionalProperties()HorizontalPodAutoscalerBehaviorgetBehavior()HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.IntegergetMaxReplicas()maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.List<MetricSpec>getMetrics()metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used).IntegergetMinReplicas()minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.CrossVersionObjectReferencegetScaleTargetRef()HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.voidsetAdditionalProperties(Map<String,Object> additionalProperties)voidsetAdditionalProperty(String name, Object value)voidsetBehavior(HorizontalPodAutoscalerBehavior behavior)HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.voidsetMaxReplicas(Integer maxReplicas)maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.voidsetMetrics(List<MetricSpec> metrics)metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used).voidsetMinReplicas(Integer minReplicas)minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.voidsetScaleTargetRef(CrossVersionObjectReference scaleTargetRef)HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.HorizontalPodAutoscalerSpecBuildertoBuilder()
-
-
-
Constructor Detail
-
HorizontalPodAutoscalerSpec
public HorizontalPodAutoscalerSpec()
No args constructor for use in serialization
-
HorizontalPodAutoscalerSpec
public HorizontalPodAutoscalerSpec(HorizontalPodAutoscalerBehavior behavior, Integer maxReplicas, List<MetricSpec> metrics, Integer minReplicas, CrossVersionObjectReference scaleTargetRef)
-
-
Method Detail
-
getBehavior
public HorizontalPodAutoscalerBehavior getBehavior()
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
-
setBehavior
public void setBehavior(HorizontalPodAutoscalerBehavior behavior)
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
-
getMaxReplicas
public Integer getMaxReplicas()
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
-
setMaxReplicas
public void setMaxReplicas(Integer maxReplicas)
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
-
getMetrics
public List<MetricSpec> getMetrics()
metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.
-
setMetrics
public void setMetrics(List<MetricSpec> metrics)
metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used). The desired replica count is calculated multiplying the ratio between the target value and the current value by the current number of pods. Ergo, metrics used must decrease as the pod count is increased, and vice-versa. See the individual metric source types for more information about how each type of metric must respond. If not set, the default metric will be set to 80% average CPU utilization.
-
getMinReplicas
public Integer getMinReplicas()
minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.
-
setMinReplicas
public void setMinReplicas(Integer minReplicas)
minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down. It defaults to 1 pod. minReplicas is allowed to be 0 if the alpha feature gate HPAScaleToZero is enabled and at least one Object or External metric is configured. Scaling is active as long as at least one metric value is available.
-
getScaleTargetRef
public CrossVersionObjectReference getScaleTargetRef()
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
-
setScaleTargetRef
public void setScaleTargetRef(CrossVersionObjectReference scaleTargetRef)
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
-
edit
public HorizontalPodAutoscalerSpecBuilder edit()
- Specified by:
editin interfaceio.fabric8.kubernetes.api.builder.Editable<HorizontalPodAutoscalerSpecBuilder>
-
toBuilder
public HorizontalPodAutoscalerSpecBuilder toBuilder()
-
-