Class NodegroupProps.Builder
java.lang.Object
software.amazon.awscdk.services.eks.NodegroupProps.Builder
- All Implemented Interfaces:
software.amazon.jsii.Builder<NodegroupProps>
- Enclosing interface:
NodegroupProps
@Stability(Stable)
public static final class NodegroupProps.Builder
extends Object
implements software.amazon.jsii.Builder<NodegroupProps>
A builder for
NodegroupProps
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionamiType
(NodegroupAmiType amiType) Sets the value ofNodegroupOptions.getAmiType()
build()
Builds the configured instance.capacityType
(CapacityType capacityType) Sets the value ofNodegroupOptions.getCapacityType()
Sets the value ofNodegroupProps.getCluster()
desiredSize
(Number desiredSize) Sets the value ofNodegroupOptions.getDesiredSize()
Sets the value ofNodegroupOptions.getDiskSize()
forceUpdate
(Boolean forceUpdate) Sets the value ofNodegroupOptions.getForceUpdate()
instanceTypes
(List<? extends InstanceType> instanceTypes) Sets the value ofNodegroupOptions.getInstanceTypes()
Sets the value ofNodegroupOptions.getLabels()
launchTemplateSpec
(LaunchTemplateSpec launchTemplateSpec) Sets the value ofNodegroupOptions.getLaunchTemplateSpec()
Sets the value ofNodegroupOptions.getMaxSize()
maxUnavailable
(Number maxUnavailable) Sets the value ofNodegroupOptions.getMaxUnavailable()
maxUnavailablePercentage
(Number maxUnavailablePercentage) Sets the value ofNodegroupOptions.getMaxUnavailablePercentage()
Sets the value ofNodegroupOptions.getMinSize()
nodegroupName
(String nodegroupName) Sets the value ofNodegroupOptions.getNodegroupName()
Sets the value ofNodegroupOptions.getNodeRole()
releaseVersion
(String releaseVersion) Sets the value ofNodegroupOptions.getReleaseVersion()
remoteAccess
(NodegroupRemoteAccess remoteAccess) Sets the value ofNodegroupOptions.getRemoteAccess()
subnets
(SubnetSelection subnets) Sets the value ofNodegroupOptions.getSubnets()
Sets the value ofNodegroupOptions.getTags()
Sets the value ofNodegroupOptions.getTaints()
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
cluster
Sets the value ofNodegroupProps.getCluster()
- Parameters:
cluster
- Cluster resource. This parameter is required.- Returns:
this
-
amiType
Sets the value ofNodegroupOptions.getAmiType()
- Parameters:
amiType
- The AMI type for your node group. If you explicitly specify the launchTemplate with custom AMI, do not specify this property, or the node group deployment will fail. In other cases, you will need to specify correct amiType for the nodegroup.- Returns:
this
-
capacityType
Sets the value ofNodegroupOptions.getCapacityType()
- Parameters:
capacityType
- The capacity type of the nodegroup.- Returns:
this
-
desiredSize
Sets the value ofNodegroupOptions.getDesiredSize()
- Parameters:
desiredSize
- The current number of worker nodes that the managed node group should maintain. If not specified, the nodewgroup will initially createminSize
instances.- Returns:
this
-
diskSize
Sets the value ofNodegroupOptions.getDiskSize()
- Parameters:
diskSize
- The root device disk size (in GiB) for your node group instances.- Returns:
this
-
forceUpdate
Sets the value ofNodegroupOptions.getForceUpdate()
- Parameters:
forceUpdate
- Force the update if the existing node group's pods are unable to be drained due to a pod disruption budget issue. If an update fails because pods could not be drained, you can force the update after it fails to terminate the old node whether or not any pods are running on the node.- Returns:
this
-
instanceTypes
@Stability(Stable) public NodegroupProps.Builder instanceTypes(List<? extends InstanceType> instanceTypes) Sets the value ofNodegroupOptions.getInstanceTypes()
- Parameters:
instanceTypes
- The instance types to use for your node group.- Returns:
this
-
labels
Sets the value ofNodegroupOptions.getLabels()
- Parameters:
labels
- The Kubernetes labels to be applied to the nodes in the node group when they are created.- Returns:
this
-
launchTemplateSpec
@Stability(Stable) public NodegroupProps.Builder launchTemplateSpec(LaunchTemplateSpec launchTemplateSpec) Sets the value ofNodegroupOptions.getLaunchTemplateSpec()
- Parameters:
launchTemplateSpec
- Launch template specification used for the nodegroup.- Returns:
this
-
maxSize
Sets the value ofNodegroupOptions.getMaxSize()
- Parameters:
maxSize
- The maximum number of worker nodes that the managed node group can scale out to. Managed node groups can support up to 100 nodes by default.- Returns:
this
-
minSize
Sets the value ofNodegroupOptions.getMinSize()
- Parameters:
minSize
- The minimum number of worker nodes that the managed node group can scale in to. This number must be greater than or equal to zero.- Returns:
this
-
nodegroupName
Sets the value ofNodegroupOptions.getNodegroupName()
- Parameters:
nodegroupName
- Name of the Nodegroup.- Returns:
this
-
nodeRole
Sets the value ofNodegroupOptions.getNodeRole()
- Parameters:
nodeRole
- The IAM role to associate with your node group. The Amazon EKS worker node kubelet daemon makes calls to AWS APIs on your behalf. Worker nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch worker nodes and register them into a cluster, you must create an IAM role for those worker nodes to use when they are launched.- Returns:
this
-
releaseVersion
Sets the value ofNodegroupOptions.getReleaseVersion()
- Parameters:
releaseVersion
- The AMI version of the Amazon EKS-optimized AMI to use with your node group (for example,1.14.7-YYYYMMDD
).- Returns:
this
-
remoteAccess
Sets the value ofNodegroupOptions.getRemoteAccess()
- Parameters:
remoteAccess
- The remote access (SSH) configuration to use with your node group. Disabled by default, however, if you specify an Amazon EC2 SSH key but do not specify a source security group when you create a managed node group, then port 22 on the worker nodes is opened to the internet (0.0.0.0/0)- Returns:
this
-
subnets
Sets the value ofNodegroupOptions.getSubnets()
- Parameters:
subnets
- The subnets to use for the Auto Scaling group that is created for your node group. By specifying the SubnetSelection, the selected subnets will automatically apply required tags i.e.kubernetes.io/cluster/CLUSTER_NAME
with a value ofshared
, whereCLUSTER_NAME
is replaced with the name of your cluster.- Returns:
this
-
tags
Sets the value ofNodegroupOptions.getTags()
- Parameters:
tags
- The metadata to apply to the node group to assist with categorization and organization. Each tag consists of a key and an optional value, both of which you define. Node group tags do not propagate to any other resources associated with the node group, such as the Amazon EC2 instances or subnets.- Returns:
this
-
taints
Sets the value ofNodegroupOptions.getTaints()
- Parameters:
taints
- The Kubernetes taints to be applied to the nodes in the node group when they are created.- Returns:
this
-
build
Builds the configured instance.- Specified by:
build
in interfacesoftware.amazon.jsii.Builder<NodegroupProps>
- Returns:
- a new instance of
NodegroupProps
- Throws:
NullPointerException
- if any required attribute was not provided
-