Class HorizontalPodAutoscalerSpec
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.autoscaling.v2beta1.HorizontalPodAutoscalerSpec
-
- All Implemented Interfaces:
com.marcnuri.yakc.model.Model
public class HorizontalPodAutoscalerSpec extends java.lang.Object implements com.marcnuri.yakc.model.Model
HorizontalPodAutoscalerSpec describes the desired functionality of the HorizontalPodAutoscaler.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
HorizontalPodAutoscalerSpec.Builder
-
Constructor Summary
Constructors Constructor Description HorizontalPodAutoscalerSpec()
HorizontalPodAutoscalerSpec(@NonNull java.lang.Number maxReplicas, java.util.List<MetricSpec> metrics, java.lang.Number minReplicas, @NonNull CrossVersionObjectReference scaleTargetRef)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static HorizontalPodAutoscalerSpec.Builder
builder()
protected boolean
canEqual(java.lang.Object other)
boolean
equals(java.lang.Object o)
@NonNull java.lang.Number
getMaxReplicas()
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.java.util.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).java.lang.Number
getMinReplicas()
minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.@NonNull CrossVersionObjectReference
getScaleTargetRef()
int
hashCode()
void
setMaxReplicas(@NonNull java.lang.Number maxReplicas)
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.void
setMetrics(java.util.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).void
setMinReplicas(java.lang.Number minReplicas)
minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.void
setScaleTargetRef(@NonNull CrossVersionObjectReference scaleTargetRef)
HorizontalPodAutoscalerSpec.Builder
toBuilder()
java.lang.String
toString()
-
-
-
Constructor Detail
-
HorizontalPodAutoscalerSpec
public HorizontalPodAutoscalerSpec(@NonNull @NonNull java.lang.Number maxReplicas, java.util.List<MetricSpec> metrics, java.lang.Number minReplicas, @NonNull @NonNull CrossVersionObjectReference scaleTargetRef)
-
HorizontalPodAutoscalerSpec
public HorizontalPodAutoscalerSpec()
-
-
Method Detail
-
builder
public static HorizontalPodAutoscalerSpec.Builder builder()
-
toBuilder
public HorizontalPodAutoscalerSpec.Builder toBuilder()
-
getMaxReplicas
@NonNull public @NonNull java.lang.Number getMaxReplicas()
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 java.util.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.
-
getMinReplicas
public java.lang.Number 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.
-
getScaleTargetRef
@NonNull public @NonNull CrossVersionObjectReference getScaleTargetRef()
-
setMaxReplicas
public void setMaxReplicas(@NonNull @NonNull java.lang.Number maxReplicas)
maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. It cannot be less that minReplicas.
-
setMetrics
public void setMetrics(java.util.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.
-
setMinReplicas
public void setMinReplicas(java.lang.Number 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.
-
setScaleTargetRef
public void setScaleTargetRef(@NonNull @NonNull CrossVersionObjectReference scaleTargetRef)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
canEqual
protected boolean canEqual(java.lang.Object other)
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-