Class V2HorizontalPodAutoscalerSpec
java.lang.Object
io.micronaut.kubernetes.client.openapi.model.V2HorizontalPodAutoscalerSpec
@Generated("io.micronaut.openapi.generator.JavaMicronautClientCodegen")
public class V2HorizontalPodAutoscalerSpec
extends Object
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionV2HorizontalPodAutoscalerSpec
(Integer maxReplicas, V2CrossVersionObjectReference scaleTargetRef) -
Method Summary
Modifier and TypeMethodDescriptionaddmetricsItem
(V2MetricSpec metricsItem) Add an item to the metrics property in a chainable fashion.behavior
(V2HorizontalPodAutoscalerBehavior behavior) Set behavior in a chainable fashion.boolean
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.List<@Valid V2MetricSpec>
metrics contains the specifications for which to use to calculate the desired replica count (the maximum replica count across all metrics will be used).minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.int
hashCode()
maxReplicas
(Integer maxReplicas) Set maxReplicas in a chainable fashion.metrics
(List<@Valid V2MetricSpec> metrics) Set metrics in a chainable fashion.minReplicas
(Integer minReplicas) Set minReplicas in a chainable fashion.scaleTargetRef
(V2CrossVersionObjectReference scaleTargetRef) Set scaleTargetRef in a chainable fashion.void
setBehavior
(V2HorizontalPodAutoscalerBehavior behavior) Set the behavior property valuevoid
setMaxReplicas
(Integer maxReplicas) Set the maxReplicas property valuevoid
setMetrics
(List<@Valid V2MetricSpec> metrics) Set the metrics property valuevoid
setMinReplicas
(Integer minReplicas) Set the minReplicas property valuevoid
setScaleTargetRef
(V2CrossVersionObjectReference scaleTargetRef) Set the scaleTargetRef property valuetoString()
-
Field Details
-
JSON_PROPERTY_BEHAVIOR
- See Also:
-
JSON_PROPERTY_MAX_REPLICAS
- See Also:
-
JSON_PROPERTY_METRICS
- See Also:
-
JSON_PROPERTY_MIN_REPLICAS
- See Also:
-
JSON_PROPERTY_SCALE_TARGET_REF
- See Also:
-
-
Constructor Details
-
V2HorizontalPodAutoscalerSpec
public V2HorizontalPodAutoscalerSpec(Integer maxReplicas, V2CrossVersionObjectReference scaleTargetRef)
-
-
Method Details
-
getBehavior
- Returns:
- the behavior property value
-
setBehavior
Set the behavior property value -
behavior
Set behavior in a chainable fashion.- Returns:
- The same instance of V2HorizontalPodAutoscalerSpec for chaining.
-
getMaxReplicas
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.- Returns:
- the maxReplicas property value
-
setMaxReplicas
Set the maxReplicas property value -
maxReplicas
Set maxReplicas in a chainable fashion.- Returns:
- The same instance of V2HorizontalPodAutoscalerSpec for chaining.
-
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.- Returns:
- the metrics property value
-
setMetrics
Set the metrics property value -
metrics
Set metrics in a chainable fashion.- Returns:
- The same instance of V2HorizontalPodAutoscalerSpec for chaining.
-
addmetricsItem
Add an item to the metrics property in a chainable fashion.- Returns:
- The same instance of V2HorizontalPodAutoscalerSpec for chaining.
-
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.- Returns:
- the minReplicas property value
-
setMinReplicas
Set the minReplicas property value -
minReplicas
Set minReplicas in a chainable fashion.- Returns:
- The same instance of V2HorizontalPodAutoscalerSpec for chaining.
-
getScaleTargetRef
- Returns:
- the scaleTargetRef property value
-
setScaleTargetRef
Set the scaleTargetRef property value -
scaleTargetRef
Set scaleTargetRef in a chainable fashion.- Returns:
- The same instance of V2HorizontalPodAutoscalerSpec for chaining.
-
equals
-
hashCode
public int hashCode() -
toString
-