Class HorizontalPodAutoscalerSpec.Builder
- java.lang.Object
-
- com.marcnuri.yakc.model.io.k8s.api.autoscaling.v1.HorizontalPodAutoscalerSpec.Builder
-
- Enclosing class:
- HorizontalPodAutoscalerSpec
public static class HorizontalPodAutoscalerSpec.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HorizontalPodAutoscalerSpec
build()
HorizontalPodAutoscalerSpec.Builder
maxReplicas(@NonNull java.lang.Number maxReplicas)
upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.HorizontalPodAutoscalerSpec.Builder
minReplicas(java.lang.Number minReplicas)
minReplicas is the lower limit for the number of replicas to which the autoscaler can scale down.HorizontalPodAutoscalerSpec.Builder
scaleTargetRef(@NonNull CrossVersionObjectReference scaleTargetRef)
HorizontalPodAutoscalerSpec.Builder
targetCPUUtilizationPercentage(java.lang.Number targetCPUUtilizationPercentage)
target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.java.lang.String
toString()
-
-
-
Method Detail
-
maxReplicas
public HorizontalPodAutoscalerSpec.Builder maxReplicas(@NonNull @NonNull java.lang.Number maxReplicas)
upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas.- Returns:
this
.
-
minReplicas
public HorizontalPodAutoscalerSpec.Builder minReplicas(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.- Returns:
this
.
-
scaleTargetRef
public HorizontalPodAutoscalerSpec.Builder scaleTargetRef(@NonNull @NonNull CrossVersionObjectReference scaleTargetRef)
-
targetCPUUtilizationPercentage
public HorizontalPodAutoscalerSpec.Builder targetCPUUtilizationPercentage(java.lang.Number targetCPUUtilizationPercentage)
target average CPU utilization (represented as a percentage of requested CPU) over all the pods; if not specified the default autoscaling policy will be used.- Returns:
this
.
-
build
public HorizontalPodAutoscalerSpec build()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-