Package org.cdk8s.plus24.k8s
Class HorizontalPodAutoscalerSpec.Builder
- java.lang.Object
-
- org.cdk8s.plus24.k8s.HorizontalPodAutoscalerSpec.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HorizontalPodAutoscalerSpec>
- Enclosing interface:
- HorizontalPodAutoscalerSpec
@Stability(Stable) public static final class HorizontalPodAutoscalerSpec.Builder extends Object implements software.amazon.jsii.Builder<HorizontalPodAutoscalerSpec>
A builder forHorizontalPodAutoscalerSpec
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HorizontalPodAutoscalerSpec
build()
Builds the configured instance.HorizontalPodAutoscalerSpec.Builder
maxReplicas(Number maxReplicas)
Sets the value ofHorizontalPodAutoscalerSpec.getMaxReplicas()
HorizontalPodAutoscalerSpec.Builder
minReplicas(Number minReplicas)
Sets the value ofHorizontalPodAutoscalerSpec.getMinReplicas()
HorizontalPodAutoscalerSpec.Builder
scaleTargetRef(CrossVersionObjectReference scaleTargetRef)
Sets the value ofHorizontalPodAutoscalerSpec.getScaleTargetRef()
HorizontalPodAutoscalerSpec.Builder
targetCpuUtilizationPercentage(Number targetCpuUtilizationPercentage)
Sets the value ofHorizontalPodAutoscalerSpec.getTargetCpuUtilizationPercentage()
-
-
-
Method Detail
-
maxReplicas
@Stability(Stable) public HorizontalPodAutoscalerSpec.Builder maxReplicas(Number maxReplicas)
Sets the value ofHorizontalPodAutoscalerSpec.getMaxReplicas()
- Parameters:
maxReplicas
- upper limit for the number of pods that can be set by the autoscaler;. This parameter is required. cannot be smaller than MinReplicas.- Returns:
this
-
scaleTargetRef
@Stability(Stable) public HorizontalPodAutoscalerSpec.Builder scaleTargetRef(CrossVersionObjectReference scaleTargetRef)
Sets the value ofHorizontalPodAutoscalerSpec.getScaleTargetRef()
- Parameters:
scaleTargetRef
- reference to scaled resource;. This parameter is required. horizontal pod autoscaler will learn the current resource consumption and will set the desired number of pods by using its Scale subresource.- Returns:
this
-
minReplicas
@Stability(Stable) public HorizontalPodAutoscalerSpec.Builder minReplicas(Number minReplicas)
Sets the value ofHorizontalPodAutoscalerSpec.getMinReplicas()
- Parameters:
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
-
targetCpuUtilizationPercentage
@Stability(Stable) public HorizontalPodAutoscalerSpec.Builder targetCpuUtilizationPercentage(Number targetCpuUtilizationPercentage)
Sets the value ofHorizontalPodAutoscalerSpec.getTargetCpuUtilizationPercentage()
- Parameters:
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
@Stability(Stable) public HorizontalPodAutoscalerSpec build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<HorizontalPodAutoscalerSpec>
- Returns:
- a new instance of
HorizontalPodAutoscalerSpec
- Throws:
NullPointerException
- if any required attribute was not provided
-
-