Package org.cdk8s.plus24
Class HorizontalPodAutoscalerProps.Builder
- java.lang.Object
-
- org.cdk8s.plus24.HorizontalPodAutoscalerProps.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<HorizontalPodAutoscalerProps>
- Enclosing interface:
- HorizontalPodAutoscalerProps
@Stability(Stable) public static final class HorizontalPodAutoscalerProps.Builder extends Object implements software.amazon.jsii.Builder<HorizontalPodAutoscalerProps>
A builder forHorizontalPodAutoscalerProps
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
maxReplicas
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder maxReplicas(Number maxReplicas)
Sets the value ofHorizontalPodAutoscalerProps.getMaxReplicas()
- Parameters:
maxReplicas
- The maximum number of replicas that can be scaled up to. This parameter is required.- Returns:
this
-
target
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder target(IScalable target)
Sets the value ofHorizontalPodAutoscalerProps.getTarget()
- Parameters:
target
- The workload to scale up or down. This parameter is required. Scalable workload types:- Deployment
- StatefulSet
- Returns:
this
-
metrics
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder metrics(List<? extends Metric> metrics)
Sets the value ofHorizontalPodAutoscalerProps.getMetrics()
- Parameters:
metrics
- The metric conditions that trigger a scale up or scale down.- Returns:
this
-
minReplicas
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder minReplicas(Number minReplicas)
Sets the value ofHorizontalPodAutoscalerProps.getMinReplicas()
- Parameters:
minReplicas
- The minimum number of replicas that can be scaled down to. Can be set to 0 if the alpha feature gateHPAScaleToZero
is enabled and at least one Object or External metric is configured.- Returns:
this
-
scaleDown
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder scaleDown(ScalingRules scaleDown)
Sets the value ofHorizontalPodAutoscalerProps.getScaleDown()
- Parameters:
scaleDown
- The scaling behavior when scaling down.- Returns:
this
-
scaleUp
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder scaleUp(ScalingRules scaleUp)
Sets the value ofHorizontalPodAutoscalerProps.getScaleUp()
- Parameters:
scaleUp
- The scaling behavior when scaling up.- Returns:
this
-
metadata
@Stability(Stable) public HorizontalPodAutoscalerProps.Builder metadata(org.cdk8s.ApiObjectMetadata metadata)
Sets the value ofResourceProps.getMetadata()
- Parameters:
metadata
- Metadata that all persisted resources must have, which includes all objects users must create.- Returns:
this
-
build
@Stability(Stable) public HorizontalPodAutoscalerProps build()
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<HorizontalPodAutoscalerProps>
- Returns:
- a new instance of
HorizontalPodAutoscalerProps
- Throws:
NullPointerException
- if any required attribute was not provided
-
-