Package org.cdk8s.plus24.k8s
Class HorizontalPodAutoscalerSpecV2Beta1.Builder
- java.lang.Object
-
- org.cdk8s.plus24.k8s.HorizontalPodAutoscalerSpecV2Beta1.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HorizontalPodAutoscalerSpecV2Beta1>
- Enclosing interface:
- HorizontalPodAutoscalerSpecV2Beta1
@Stability(Stable) public static final class HorizontalPodAutoscalerSpecV2Beta1.Builder extends Object implements software.amazon.jsii.Builder<HorizontalPodAutoscalerSpecV2Beta1>
A builder forHorizontalPodAutoscalerSpecV2Beta1
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HorizontalPodAutoscalerSpecV2Beta1
build()
Builds the configured instance.HorizontalPodAutoscalerSpecV2Beta1.Builder
maxReplicas(Number maxReplicas)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getMaxReplicas()
HorizontalPodAutoscalerSpecV2Beta1.Builder
metrics(List<? extends MetricSpecV2Beta1> metrics)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getMetrics()
HorizontalPodAutoscalerSpecV2Beta1.Builder
minReplicas(Number minReplicas)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getMinReplicas()
HorizontalPodAutoscalerSpecV2Beta1.Builder
scaleTargetRef(CrossVersionObjectReferenceV2Beta1 scaleTargetRef)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getScaleTargetRef()
-
-
-
Method Detail
-
maxReplicas
@Stability(Stable) public HorizontalPodAutoscalerSpecV2Beta1.Builder maxReplicas(Number maxReplicas)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getMaxReplicas()
- Parameters:
maxReplicas
- maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up. This parameter is required. It cannot be less that minReplicas.- Returns:
this
-
scaleTargetRef
@Stability(Stable) public HorizontalPodAutoscalerSpecV2Beta1.Builder scaleTargetRef(CrossVersionObjectReferenceV2Beta1 scaleTargetRef)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getScaleTargetRef()
- Parameters:
scaleTargetRef
- scaleTargetRef points to the target resource to scale, and is used to the pods for which metrics should be collected, as well as to actually change the replica count. This parameter is required.- Returns:
this
-
metrics
@Stability(Stable) public HorizontalPodAutoscalerSpecV2Beta1.Builder metrics(List<? extends MetricSpecV2Beta1> metrics)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.getMetrics()
- Parameters:
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.- Returns:
this
-
minReplicas
@Stability(Stable) public HorizontalPodAutoscalerSpecV2Beta1.Builder minReplicas(Number minReplicas)
Sets the value ofHorizontalPodAutoscalerSpecV2Beta1.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
-
build
@Stability(Stable) public HorizontalPodAutoscalerSpecV2Beta1 build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<HorizontalPodAutoscalerSpecV2Beta1>
- Returns:
- a new instance of
HorizontalPodAutoscalerSpecV2Beta1
- Throws:
NullPointerException
- if any required attribute was not provided
-
-