Package org.cdk8s.plus25.k8s
Class DeploymentSpec.Builder
- java.lang.Object
-
- org.cdk8s.plus25.k8s.DeploymentSpec.Builder
-
- All Implemented Interfaces:
software.amazon.jsii.Builder<DeploymentSpec>
- Enclosing interface:
- DeploymentSpec
@Stability(Stable) public static final class DeploymentSpec.Builder extends Object implements software.amazon.jsii.Builder<DeploymentSpec>
A builder forDeploymentSpec
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
-
-
-
Method Detail
-
selector
@Stability(Stable) public DeploymentSpec.Builder selector(LabelSelector selector)
Sets the value ofDeploymentSpec.getSelector()- Parameters:
selector- Label selector for pods. This parameter is required. Existing ReplicaSets whose pods are selected by this will be the ones affected by this deployment. It must match the pod template's labels.- Returns:
this
-
template
@Stability(Stable) public DeploymentSpec.Builder template(PodTemplateSpec template)
Sets the value ofDeploymentSpec.getTemplate()- Parameters:
template- Template describes the pods that will be created. This parameter is required.- Returns:
this
-
minReadySeconds
@Stability(Stable) public DeploymentSpec.Builder minReadySeconds(Number minReadySeconds)
Sets the value ofDeploymentSpec.getMinReadySeconds()- Parameters:
minReadySeconds- Minimum number of seconds for which a newly created pod should be ready without any of its container crashing, for it to be considered available. Defaults to 0 (pod will be considered available as soon as it is ready)- Returns:
this
-
paused
@Stability(Stable) public DeploymentSpec.Builder paused(Boolean paused)
Sets the value ofDeploymentSpec.getPaused()- Parameters:
paused- Indicates that the deployment is paused.- Returns:
this
-
progressDeadlineSeconds
@Stability(Stable) public DeploymentSpec.Builder progressDeadlineSeconds(Number progressDeadlineSeconds)
Sets the value ofDeploymentSpec.getProgressDeadlineSeconds()- Parameters:
progressDeadlineSeconds- The maximum time in seconds for a deployment to make progress before it is considered to be failed. The deployment controller will continue to process failed deployments and a condition with a ProgressDeadlineExceeded reason will be surfaced in the deployment status. Note that progress will not be estimated during the time a deployment is paused. Defaults to 600s.- Returns:
this
-
replicas
@Stability(Stable) public DeploymentSpec.Builder replicas(Number replicas)
Sets the value ofDeploymentSpec.getReplicas()- Parameters:
replicas- Number of desired pods. This is a pointer to distinguish between explicit zero and not specified. Defaults to 1.- Returns:
this
-
revisionHistoryLimit
@Stability(Stable) public DeploymentSpec.Builder revisionHistoryLimit(Number revisionHistoryLimit)
Sets the value ofDeploymentSpec.getRevisionHistoryLimit()- Parameters:
revisionHistoryLimit- The number of old ReplicaSets to retain to allow rollback. This is a pointer to distinguish between explicit zero and not specified. Defaults to 10.- Returns:
this
-
strategy
@Stability(Stable) public DeploymentSpec.Builder strategy(DeploymentStrategy strategy)
Sets the value ofDeploymentSpec.getStrategy()- Parameters:
strategy- The deployment strategy to use to replace existing pods with new ones.- Returns:
this
-
build
@Stability(Stable) public DeploymentSpec build()
Builds the configured instance.- Specified by:
buildin interfacesoftware.amazon.jsii.Builder<DeploymentSpec>- Returns:
- a new instance of
DeploymentSpec - Throws:
NullPointerException- if any required attribute was not provided
-
-