Class CfnNodegroup
- All Implemented Interfaces:
IInspectable,INodegroupRef,IEnvironmentAware,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 later updates, you will only be able to update a node group using a launch template only if it was originally deployed with a launch template. Additionally, the launch template ID or name must match what was used when the node group was created. You can update the launch template version with necessary changes. 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)
.maxParallelNodesRepairedCount(123)
.maxParallelNodesRepairedPercentage(123)
.maxUnhealthyNodeThresholdCount(123)
.maxUnhealthyNodeThresholdPercentage(123)
.nodeRepairConfigOverrides(List.of(NodeRepairConfigOverridesProperty.builder()
.minRepairWaitTimeMins(123)
.nodeMonitoringCondition("nodeMonitoringCondition")
.nodeUnhealthyReason("nodeUnhealthyReason")
.repairAction("repairAction")
.build()))
.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)
.updateStrategy("updateStrategy")
.build())
.version("version")
.build();
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classA fluent builder forCfnNodegroup.static interfaceAn object representing a node group launch template specification.static interfaceSpecify granular overrides for specific repair actions.static interfaceThe node auto repair configuration for the node group.static interfaceAn object representing the remote access configuration for the managed node group.static interfaceAn object representing the scaling configuration details for the Auto Scaling group that is associated with your node group.static interfaceA property that allows a node to repel aPod.static interfaceThe update configuration for the node group.Nested classes/interfaces inherited from class software.amazon.jsii.JsiiObject
software.amazon.jsii.JsiiObject.InitializationModeNested classes/interfaces inherited from interface software.constructs.IConstruct
software.constructs.IConstruct.Jsii$DefaultNested classes/interfaces inherited from interface software.amazon.awscdk.IInspectable
IInspectable.Jsii$Default, IInspectable.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.interfaces.eks.INodegroupRef
INodegroupRef.Jsii$Default, INodegroupRef.Jsii$ProxyNested classes/interfaces inherited from interface software.amazon.awscdk.ITaggable
ITaggable.Jsii$Default, ITaggable.Jsii$Proxy -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe CloudFormation resource type name for this resource class. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCfnNodegroup(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) protectedCfnNodegroup(software.amazon.jsii.JsiiObjectRef objRef) CfnNodegroup(software.constructs.Construct scope, String id, CfnNodegroupProps props) Create a newAWS::EKS::Nodegroup. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringarnForNodegroup(INodegroupRef resource) The 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 anyPodon the existing node group can't be drained due to aPoddisruption budget issue.Specify the instance types for a node group.The Kuberneteslabelsapplied 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.A reference to a Nodegroup resource.The node auto repair configuration for the 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.voidinspect(TreeInspector inspector) Examines the CloudFormation resource and discloses attributes.static BooleanChecks whether the given object is a CfnNodegroup.renderProperties(Map<String, Object> props) voidsetAmiType(String value) The AMI type for your node group.voidsetCapacityType(String value) The capacity type of your managed node group.voidsetClusterName(String value) The name of your cluster.voidsetDiskSize(Number value) The root device disk size (in GiB) for your node group instances.voidsetForceUpdateEnabled(Boolean value) Force the update if anyPodon the existing node group can't be drained due to aPoddisruption budget issue.voidsetForceUpdateEnabled(IResolvable value) Force the update if anyPodon the existing node group can't be drained due to aPoddisruption budget issue.voidsetInstanceTypes(List<String> value) Specify the instance types for a node group.voidThe Kuberneteslabelsapplied to the nodes in the node group.voidsetLabels(IResolvable value) The Kuberneteslabelsapplied to the nodes in the node group.voidsetLaunchTemplate(IResolvable value) An object representing a node group's launch template specification.voidAn object representing a node group's launch template specification.voidsetNodegroupName(String value) The unique name to give your node group.voidsetNodeRepairConfig(IResolvable value) The node auto repair configuration for the node group.voidThe node auto repair configuration for the node group.voidsetNodeRole(String value) The Amazon Resource Name (ARN) of the IAM role to associate with your node group.voidsetReleaseVersion(String value) The AMI version of the Amazon EKS optimized AMI to use with your node group (for example,1.14.7- *YYYYMMDD*).voidsetRemoteAccess(IResolvable value) The remote access configuration to use with your node group.voidThe remote access configuration to use with your node group.voidsetScalingConfig(IResolvable value) The scaling configuration details for the Auto Scaling group that is created for your node group.voidThe scaling configuration details for the Auto Scaling group that is created for your node group.voidsetSubnets(List<String> value) The subnets to use for the Auto Scaling group that is created for your node group.voidsetTagsRaw(Map<String, String> value) Metadata that assists with categorization and organization.voidThe Kubernetes taints to be applied to the nodes in the node group when they are created.voidsetTaints(IResolvable value) The Kubernetes taints to be applied to the nodes in the node group when they are created.voidsetUpdateConfig(IResolvable value) The node group update configuration.voidThe node group update configuration.voidsetVersion(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, getEnv, getMetadata, getUpdatedProperites, getUpdatedProperties, isCfnResource, obtainDependencies, obtainResourceDependencies, removeDependency, replaceDependency, shouldSynthesize, toString, validatePropertiesMethods inherited from class software.amazon.awscdk.CfnRefElement
getRefMethods inherited from class software.amazon.awscdk.CfnElement
getCreationStack, getLogicalId, getStack, isCfnElement, overrideLogicalIdMethods inherited from class software.constructs.Construct
getNode, isConstructMethods inherited from class software.amazon.jsii.JsiiObject
jsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.constructs.IConstruct
getNodeMethods inherited from interface software.amazon.awscdk.interfaces.IEnvironmentAware
getEnvMethods 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) Create a newAWS::EKS::Nodegroup.- 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
-
arnForNodegroup
- Parameters:
resource- This parameter is required.
-
isCfnNodegroup
Checks whether the given object is a CfnNodegroup.- Parameters:
x- This parameter is required.
-
inspect
Examines the CloudFormation resource and discloses attributes.- Specified by:
inspectin 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:
renderPropertiesin 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:
getCfnPropertiesin classCfnResource
-
getNodegroupRef
A reference to a Nodegroup resource.- Specified by:
getNodegroupRefin interfaceINodegroupRef
-
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 anyPodon the existing node group can't be drained due to aPoddisruption budget issue.Returns union: either
BooleanorIResolvable -
setForceUpdateEnabled
Force the update if anyPodon the existing node group can't be drained due to aPoddisruption budget issue. -
setForceUpdateEnabled
Force the update if anyPodon the existing node group can't be drained due to aPoddisruption budget issue. -
getInstanceTypes
Specify the instance types for a node group. -
setInstanceTypes
Specify the instance types for a node group. -
getLabels
The Kuberneteslabelsapplied to the nodes in the node group.Returns union: either Mapinvalid input: '<'String,
String> orIResolvable -
setLabels
The Kuberneteslabelsapplied to the nodes in the node group. -
setLabels
The Kuberneteslabelsapplied to the nodes in the node group. -
getLaunchTemplate
An object representing a node group's launch template specification.Returns union: either
IResolvableorCfnNodegroup.LaunchTemplateSpecificationProperty -
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 the node group.Returns union: either
IResolvableorCfnNodegroup.NodeRepairConfigProperty -
setNodeRepairConfig
The node auto repair configuration for the node group. -
setNodeRepairConfig
@Stability(Stable) public void setNodeRepairConfig(@Nullable CfnNodegroup.NodeRepairConfigProperty value) The node auto repair configuration for the 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.Returns union: either
IResolvableorCfnNodegroup.RemoteAccessProperty -
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.Returns union: either
IResolvableorCfnNodegroup.ScalingConfigProperty -
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.Returns union: either
IResolvableor Listinvalid input: '<'eitherIResolvableorCfnNodegroup.TaintProperty> -
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.Returns union: either
IResolvableorCfnNodegroup.UpdateConfigProperty -
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.
-