Class CfnNodegroup
- All Implemented Interfaces:
IInspectable
,ITaggable
,software.amazon.jsii.JsiiSerializable
,software.constructs.IConstruct
,software.constructs.IDependable
You can only create a node group for your cluster that is equal to the current Kubernetes version for the cluster. All node groups are created with the latest AMI release version for the respective minor Kubernetes version of the cluster, unless you deploy a custom AMI using a launch template. For more information about using launch templates, see Customizing managed nodes with launch templates .
An Amazon EKS managed node group is an Amazon EC2 Auto Scaling group and associated Amazon EC2 instances that are managed by AWS for an Amazon EKS cluster. For more information, see Managed node groups in the Amazon EKS User Guide .
Windows AMI types are only supported for commercial AWS Regions that support Windows on Amazon EKS.
Example:
// The code below shows an example of how to instantiate this type. // The values are placeholders you should change. import software.amazon.awscdk.services.eks.*; CfnNodegroup cfnNodegroup = CfnNodegroup.Builder.create(this, "MyCfnNodegroup") .clusterName("clusterName") .nodeRole("nodeRole") .subnets(List.of("subnets")) // the properties below are optional .amiType("amiType") .capacityType("capacityType") .diskSize(123) .forceUpdateEnabled(false) .instanceTypes(List.of("instanceTypes")) .labels(Map.of( "labelsKey", "labels")) .launchTemplate(LaunchTemplateSpecificationProperty.builder() .id("id") .name("name") .version("version") .build()) .nodegroupName("nodegroupName") .nodeRepairConfig(NodeRepairConfigProperty.builder() .enabled(false) .build()) .releaseVersion("releaseVersion") .remoteAccess(RemoteAccessProperty.builder() .ec2SshKey("ec2SshKey") // the properties below are optional .sourceSecurityGroups(List.of("sourceSecurityGroups")) .build()) .scalingConfig(ScalingConfigProperty.builder() .desiredSize(123) .maxSize(123) .minSize(123) .build()) .tags(Map.of( "tagsKey", "tags")) .taints(List.of(TaintProperty.builder() .effect("effect") .key("key") .value("value") .build())) .updateConfig(UpdateConfigProperty.builder() .maxUnavailable(123) .maxUnavailablePercentage(123) .build()) .version("version") .build();
- See Also:
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A fluent builder forCfnNodegroup
.static interface
An object representing a node group launch template specification.static interface
The node auto repair configuration for node group.static interface
An object representing the remote access configuration for the managed node group.static interface
An object representing the scaling configuration details for the Auto Scaling group that is associated with your node group.static interface
A property that allows a node to repel aPod
.static interface
The update configuration for the node group.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationMode
Nested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$Default
Nested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$Proxy
Nested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy
-
Field Summary
Modifier and TypeFieldDescriptionstatic final String
The CloudFormation resource type name for this resource class. -
Constructor Summary
ModifierConstructorDescriptionprotected
CfnNodegroup
(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protected
CfnNodegroup
(software.amazon.jsii.JsiiObjectRef objRef) CfnNodegroup
(software.constructs.Construct scope, String id, CfnNodegroupProps props) -
Method Summary
Modifier and TypeMethodDescriptionThe AMI type for your node group.The Amazon Resource Name (ARN) associated with the managed node group.The name of your cluster.The name associated with an Amazon EKS managed node group.The capacity type of your managed node group.The name of your cluster.The root device disk size (in GiB) for your node group instances.Force the update if anyPod
on the existing node group can't be drained due to aPod
disruption budget issue.Specify the instance types for a node group.The Kuberneteslabels
applied to the nodes in the node group.An object representing a node group's launch template specification.The unique name to give your node group.The node auto repair configuration for node group.The Amazon Resource Name (ARN) of the IAM role to associate with your node group.The AMI version of the Amazon EKS optimized AMI to use with your node group (for example,1.14.7- *YYYYMMDD*
).The remote access configuration to use with your node group.The scaling configuration details for the Auto Scaling group that is created for your node group.The subnets to use for the Auto Scaling group that is created for your node group.getTags()
Tag Manager which manages the tags for this resource.Metadata that assists with categorization and organization.The Kubernetes taints to be applied to the nodes in the node group when they are created.The node group update configuration.The Kubernetes version to use for your managed nodes.void
inspect
(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.renderProperties
(Map<String, Object> props) void
setAmiType
(String value) The AMI type for your node group.void
setCapacityType
(String value) The capacity type of your managed node group.void
setClusterName
(String value) The name of your cluster.void
setDiskSize
(Number value) The root device disk size (in GiB) for your node group instances.void
setForceUpdateEnabled
(Boolean value) Force the update if anyPod
on the existing node group can't be drained due to aPod
disruption budget issue.void
setForceUpdateEnabled
(IResolvable value) Force the update if anyPod
on the existing node group can't be drained due to aPod
disruption budget issue.void
setInstanceTypes
(List<String> value) Specify the instance types for a node group.void
The Kuberneteslabels
applied to the nodes in the node group.void
setLabels
(IResolvable value) The Kuberneteslabels
applied to the nodes in the node group.void
setLaunchTemplate
(IResolvable value) An object representing a node group's launch template specification.void
An object representing a node group's launch template specification.void
setNodegroupName
(String value) The unique name to give your node group.void
setNodeRepairConfig
(IResolvable value) The node auto repair configuration for node group.void
The node auto repair configuration for node group.void
setNodeRole
(String value) The Amazon Resource Name (ARN) of the IAM role to associate with your node group.void
setReleaseVersion
(String value) The AMI version of the Amazon EKS optimized AMI to use with your node group (for example,1.14.7- *YYYYMMDD*
).void
setRemoteAccess
(IResolvable value) The remote access configuration to use with your node group.void
The remote access configuration to use with your node group.void
setScalingConfig
(IResolvable value) The scaling configuration details for the Auto Scaling group that is created for your node group.void
The scaling configuration details for the Auto Scaling group that is created for your node group.void
setSubnets
(List<String> value) The subnets to use for the Auto Scaling group that is created for your node group.void
setTagsRaw
(Map<String, String> value) Metadata that assists with categorization and organization.void
The Kubernetes taints to be applied to the nodes in the node group when they are created.void
setTaints
(IResolvable value) The Kubernetes taints to be applied to the nodes in the node group when they are created.void
setUpdateConfig
(IResolvable value) The node group update configuration.void
The node group update configuration.void
setVersion
(String value) The Kubernetes version to use for your managed nodes.Methods inherited from class software.amazon.awscdk.CfnResource
addDeletionOverride, addDependency, addDependsOn, addMetadata, addOverride, addPropertyDeletionOverride, addPropertyOverride, applyRemovalPolicy, applyRemovalPolicy, applyRemovalPolicy, getAtt, getAtt, getCfnOptions, getCfnResourceType, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validateProperties
Methods inherited from class software.amazon.awscdk.CfnRefElement
getRef
Methods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalId
Methods inherited from class software.constructs.Construct
getNode, isConstruct
Methods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSet
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Field Details
-
CFN_RESOURCE_TYPE_NAME
The CloudFormation resource type name for this resource class.
-
-
Constructor Details
-
CfnNodegroup
protected CfnNodegroup(software.amazon.jsii.JsiiObjectRef objRef) -
CfnNodegroup
protected CfnNodegroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) -
CfnNodegroup
@Stability(Stable) public CfnNodegroup(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull CfnNodegroupProps props) - Parameters:
scope
- Scope in which this resource is defined. This parameter is required.id
- Construct identifier for this resource (unique in its scope). This parameter is required.props
- Resource properties. This parameter is required.
-
-
Method Details
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspect
in interfaceIInspectable
- Parameters:
inspector
- tree inspector to collect and process attributes. This parameter is required.
-
renderProperties
@Stability(Stable) @NotNull protected Map<String,Object> renderProperties(@NotNull Map<String, Object> props) - Overrides:
renderProperties
in classCfnResource
- Parameters:
props
- This parameter is required.
-
getAttrArn
The Amazon Resource Name (ARN) associated with the managed node group. -
getAttrClusterName
The name of your cluster. -
getAttrId
-
getAttrNodegroupName
The name associated with an Amazon EKS managed node group. -
getCfnProperties
- Overrides:
getCfnProperties
in classCfnResource
-
getTags
Tag Manager which manages the tags for this resource. -
getClusterName
The name of your cluster. -
setClusterName
The name of your cluster. -
getNodeRole
The Amazon Resource Name (ARN) of the IAM role to associate with your node group. -
setNodeRole
The Amazon Resource Name (ARN) of the IAM role to associate with your node group. -
getSubnets
The subnets to use for the Auto Scaling group that is created for your node group. -
setSubnets
The subnets to use for the Auto Scaling group that is created for your node group. -
getAmiType
The AMI type for your node group. -
setAmiType
The AMI type for your node group. -
getCapacityType
The capacity type of your managed node group. -
setCapacityType
The capacity type of your managed node group. -
getDiskSize
The root device disk size (in GiB) for your node group instances. -
setDiskSize
The root device disk size (in GiB) for your node group instances. -
getForceUpdateEnabled
Force the update if anyPod
on the existing node group can't be drained due to aPod
disruption budget issue. -
setForceUpdateEnabled
Force the update if anyPod
on the existing node group can't be drained due to aPod
disruption budget issue. -
setForceUpdateEnabled
Force the update if anyPod
on the existing node group can't be drained due to aPod
disruption budget issue. -
getInstanceTypes
Specify the instance types for a node group. -
setInstanceTypes
Specify the instance types for a node group. -
getLabels
The Kuberneteslabels
applied to the nodes in the node group. -
setLabels
The Kuberneteslabels
applied to the nodes in the node group. -
setLabels
The Kuberneteslabels
applied to the nodes in the node group. -
getLaunchTemplate
An object representing a node group's launch template specification. -
setLaunchTemplate
An object representing a node group's launch template specification. -
setLaunchTemplate
@Stability(Stable) public void setLaunchTemplate(@Nullable CfnNodegroup.LaunchTemplateSpecificationProperty value) An object representing a node group's launch template specification. -
getNodegroupName
The unique name to give your node group. -
setNodegroupName
The unique name to give your node group. -
getNodeRepairConfig
The node auto repair configuration for node group. -
setNodeRepairConfig
The node auto repair configuration for node group. -
setNodeRepairConfig
@Stability(Stable) public void setNodeRepairConfig(@Nullable CfnNodegroup.NodeRepairConfigProperty value) The node auto repair configuration for node group. -
getReleaseVersion
The AMI version of the Amazon EKS optimized AMI to use with your node group (for example,1.14.7- *YYYYMMDD*
). By default, the latest available AMI version for the node group's current Kubernetes version is used. For more information, see Amazon EKS optimized Linux AMI Versions in the Amazon EKS User Guide . -
setReleaseVersion
The AMI version of the Amazon EKS optimized AMI to use with your node group (for example,1.14.7- *YYYYMMDD*
). By default, the latest available AMI version for the node group's current Kubernetes version is used. For more information, see Amazon EKS optimized Linux AMI Versions in the Amazon EKS User Guide . -
getRemoteAccess
The remote access configuration to use with your node group. -
setRemoteAccess
The remote access configuration to use with your node group. -
setRemoteAccess
The remote access configuration to use with your node group. -
getScalingConfig
The scaling configuration details for the Auto Scaling group that is created for your node group. -
setScalingConfig
The scaling configuration details for the Auto Scaling group that is created for your node group. -
setScalingConfig
The scaling configuration details for the Auto Scaling group that is created for your node group. -
getTagsRaw
Metadata that assists with categorization and organization. -
setTagsRaw
Metadata that assists with categorization and organization. -
getTaints
The Kubernetes taints to be applied to the nodes in the node group when they are created. -
setTaints
The Kubernetes taints to be applied to the nodes in the node group when they are created. -
setTaints
The Kubernetes taints to be applied to the nodes in the node group when they are created. -
getUpdateConfig
The node group update configuration. -
setUpdateConfig
The node group update configuration. -
setUpdateConfig
The node group update configuration. -
getVersion
The Kubernetes version to use for your managed nodes. -
setVersion
The Kubernetes version to use for your managed nodes.
-