CfnNodegroupPropsMixin
- class aws_cdk.mixins_preview.aws_eks.mixins.CfnNodegroupPropsMixin(props, *, strategy=None)
Bases:
MixinCreates a managed node group for an Amazon EKS cluster.
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 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 . .. epigraph:
Windows AMI types are only supported for commercial AWS Regions that support Windows on Amazon EKS.
- See:
http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-eks-nodegroup.html
- CloudformationResource:
AWS::EKS::Nodegroup
- Mixin:
true
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview import mixins from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins cfn_nodegroup_props_mixin = eks_mixins.CfnNodegroupPropsMixin(eks_mixins.CfnNodegroupMixinProps( ami_type="amiType", capacity_type="capacityType", cluster_name="clusterName", disk_size=123, force_update_enabled=False, instance_types=["instanceTypes"], labels={ "labels_key": "labels" }, launch_template=eks_mixins.CfnNodegroupPropsMixin.LaunchTemplateSpecificationProperty( id="id", name="name", version="version" ), nodegroup_name="nodegroupName", node_repair_config=eks_mixins.CfnNodegroupPropsMixin.NodeRepairConfigProperty( enabled=False, max_parallel_nodes_repaired_count=123, max_parallel_nodes_repaired_percentage=123, max_unhealthy_node_threshold_count=123, max_unhealthy_node_threshold_percentage=123, node_repair_config_overrides=[eks_mixins.CfnNodegroupPropsMixin.NodeRepairConfigOverridesProperty( min_repair_wait_time_mins=123, node_monitoring_condition="nodeMonitoringCondition", node_unhealthy_reason="nodeUnhealthyReason", repair_action="repairAction" )] ), node_role="nodeRole", release_version="releaseVersion", remote_access=eks_mixins.CfnNodegroupPropsMixin.RemoteAccessProperty( ec2_ssh_key="ec2SshKey", source_security_groups=["sourceSecurityGroups"] ), scaling_config=eks_mixins.CfnNodegroupPropsMixin.ScalingConfigProperty( desired_size=123, max_size=123, min_size=123 ), subnets=["subnets"], tags={ "tags_key": "tags" }, taints=[eks_mixins.CfnNodegroupPropsMixin.TaintProperty( effect="effect", key="key", value="value" )], update_config=eks_mixins.CfnNodegroupPropsMixin.UpdateConfigProperty( max_unavailable=123, max_unavailable_percentage=123, update_strategy="updateStrategy" ), version="version" ), strategy=mixins.PropertyMergeStrategy.OVERRIDE )
Create a mixin to apply properties to
AWS::EKS::Nodegroup.- Parameters:
props (
Union[CfnNodegroupMixinProps,Dict[str,Any]]) – L1 properties to apply.strategy (
Optional[PropertyMergeStrategy]) – (experimental) Strategy for merging nested properties. Default: - PropertyMergeStrategy.MERGE
Methods
- apply_to(construct)
Apply the mixin properties to the construct.
- Parameters:
construct (
IConstruct)- Return type:
- supports(construct)
Check if this mixin supports the given construct.
- Parameters:
construct (
IConstruct)- Return type:
bool
Attributes
- CFN_PROPERTY_KEYS = ['amiType', 'capacityType', 'clusterName', 'diskSize', 'forceUpdateEnabled', 'instanceTypes', 'labels', 'launchTemplate', 'nodegroupName', 'nodeRepairConfig', 'nodeRole', 'releaseVersion', 'remoteAccess', 'scalingConfig', 'subnets', 'tags', 'taints', 'updateConfig', 'version']
Static Methods
- classmethod is_mixin(x)
(experimental) Checks if
xis a Mixin.- Parameters:
x (
Any) – Any object.- Return type:
bool- Returns:
true if
xis an object created from a class which extendsMixin.- Stability:
experimental
LaunchTemplateSpecificationProperty
- class CfnNodegroupPropsMixin.LaunchTemplateSpecificationProperty(*, id=None, name=None, version=None)
Bases:
objectAn object representing a node group launch template specification.
The launch template can’t include
`SubnetId<https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html>`_ ,`IamInstanceProfile<https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html>`_ ,`RequestSpotInstances<https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_RequestSpotInstances.html>`_ ,`HibernationOptions<https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_HibernationOptionsRequest.html>`_ , or`TerminateInstances<https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_TerminateInstances.html>`_ , or the node group deployment or update will fail. For more information about launch templates, see`CreateLaunchTemplate<https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateLaunchTemplate.html>`_ in the Amazon EC2 API Reference. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide .You must specify either the launch template ID or the launch template name in the request, but not both.
- Parameters:
id (
Optional[str]) – The ID of the launch template. You must specify either the launch template ID or the launch template name in the request, but not both. After node group creation, you cannot use a different ID.name (
Optional[str]) – The name of the launch template. You must specify either the launch template name or the launch template ID in the request, but not both. After node group creation, you cannot use a different name.version (
Optional[str]) – The version number of the launch template to use. If no version is specified, then the template’s default version is used. You can use a different version for node group updates.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins launch_template_specification_property = eks_mixins.CfnNodegroupPropsMixin.LaunchTemplateSpecificationProperty( id="id", name="name", version="version" )
Attributes
- id
The ID of the launch template.
You must specify either the launch template ID or the launch template name in the request, but not both. After node group creation, you cannot use a different ID.
- name
The name of the launch template.
You must specify either the launch template name or the launch template ID in the request, but not both. After node group creation, you cannot use a different name.
- version
The version number of the launch template to use.
If no version is specified, then the template’s default version is used. You can use a different version for node group updates.
NodeRepairConfigOverridesProperty
- class CfnNodegroupPropsMixin.NodeRepairConfigOverridesProperty(*, min_repair_wait_time_mins=None, node_monitoring_condition=None, node_unhealthy_reason=None, repair_action=None)
Bases:
objectSpecify granular overrides for specific repair actions.
These overrides control the repair action and the repair delay time before a node is considered eligible for repair. If you use this, you must specify all the values.
- Parameters:
min_repair_wait_time_mins (
Union[int,float,None]) – Specify the minimum time in minutes to wait before attempting to repair a node with this specific NodeMonitoringCondition and NodeUnhealthyReason.node_monitoring_condition (
Optional[str]) – Specify an unhealthy condition reported by the node monitoring agent that this override would apply to.node_unhealthy_reason (
Optional[str]) – Specify a reason reported by the node monitoring agent that this override would apply to.repair_action (
Optional[str]) – Specify the repair action to take for nodes when all of the specified conditions are met.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins node_repair_config_overrides_property = eks_mixins.CfnNodegroupPropsMixin.NodeRepairConfigOverridesProperty( min_repair_wait_time_mins=123, node_monitoring_condition="nodeMonitoringCondition", node_unhealthy_reason="nodeUnhealthyReason", repair_action="repairAction" )
Attributes
- min_repair_wait_time_mins
Specify the minimum time in minutes to wait before attempting to repair a node with this specific NodeMonitoringCondition and NodeUnhealthyReason.
- node_monitoring_condition
Specify an unhealthy condition reported by the node monitoring agent that this override would apply to.
- node_unhealthy_reason
Specify a reason reported by the node monitoring agent that this override would apply to.
- repair_action
Specify the repair action to take for nodes when all of the specified conditions are met.
NodeRepairConfigProperty
- class CfnNodegroupPropsMixin.NodeRepairConfigProperty(*, enabled=None, max_parallel_nodes_repaired_count=None, max_parallel_nodes_repaired_percentage=None, max_unhealthy_node_threshold_count=None, max_unhealthy_node_threshold_percentage=None, node_repair_config_overrides=None)
Bases:
objectThe node auto repair configuration for the node group.
- Parameters:
enabled (
Union[bool,IResolvable,None]) – Specifies whether to enable node auto repair for the node group. Node auto repair is disabled by default.max_parallel_nodes_repaired_count (
Union[int,float,None]) – Specify the maximum number of nodes that can be repaired concurrently or in parallel, expressed as a count of unhealthy nodes. This gives you finer-grained control over the pace of node replacements. When using this, you cannot also set MaxParallelNodesRepairedPercentage at the same time.max_parallel_nodes_repaired_percentage (
Union[int,float,None]) – Specify the maximum number of nodes that can be repaired concurrently or in parallel, expressed as a percentage of unhealthy nodes. This gives you finer-grained control over the pace of node replacements. When using this, you cannot also set MaxParallelNodesRepairedCount at the same time.max_unhealthy_node_threshold_count (
Union[int,float,None]) – Specify a count threshold of unhealthy nodes, above which node auto repair actions will stop. When using this, you cannot also set MaxUnhealthyNodeThresholdPercentage at the same time.max_unhealthy_node_threshold_percentage (
Union[int,float,None]) – Specify a percentage threshold of unhealthy nodes, above which node auto repair actions will stop. When using this, you cannot also set MaxUnhealthyNodeThresholdCount at the same time.node_repair_config_overrides (
Union[IResolvable,Sequence[Union[IResolvable,NodeRepairConfigOverridesProperty,Dict[str,Any]]],None]) – Specify granular overrides for specific repair actions. These overrides control the repair action and the repair delay time before a node is considered eligible for repair. If you use this, you must specify all the values.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins node_repair_config_property = eks_mixins.CfnNodegroupPropsMixin.NodeRepairConfigProperty( enabled=False, max_parallel_nodes_repaired_count=123, max_parallel_nodes_repaired_percentage=123, max_unhealthy_node_threshold_count=123, max_unhealthy_node_threshold_percentage=123, node_repair_config_overrides=[eks_mixins.CfnNodegroupPropsMixin.NodeRepairConfigOverridesProperty( min_repair_wait_time_mins=123, node_monitoring_condition="nodeMonitoringCondition", node_unhealthy_reason="nodeUnhealthyReason", repair_action="repairAction" )] )
Attributes
- enabled
Specifies whether to enable node auto repair for the node group.
Node auto repair is disabled by default.
- max_parallel_nodes_repaired_count
Specify the maximum number of nodes that can be repaired concurrently or in parallel, expressed as a count of unhealthy nodes.
This gives you finer-grained control over the pace of node replacements. When using this, you cannot also set MaxParallelNodesRepairedPercentage at the same time.
- max_parallel_nodes_repaired_percentage
Specify the maximum number of nodes that can be repaired concurrently or in parallel, expressed as a percentage of unhealthy nodes.
This gives you finer-grained control over the pace of node replacements. When using this, you cannot also set MaxParallelNodesRepairedCount at the same time.
- max_unhealthy_node_threshold_count
Specify a count threshold of unhealthy nodes, above which node auto repair actions will stop.
When using this, you cannot also set MaxUnhealthyNodeThresholdPercentage at the same time.
- max_unhealthy_node_threshold_percentage
Specify a percentage threshold of unhealthy nodes, above which node auto repair actions will stop.
When using this, you cannot also set MaxUnhealthyNodeThresholdCount at the same time.
- node_repair_config_overrides
Specify granular overrides for specific repair actions.
These overrides control the repair action and the repair delay time before a node is considered eligible for repair. If you use this, you must specify all the values.
RemoteAccessProperty
- class CfnNodegroupPropsMixin.RemoteAccessProperty(*, ec2_ssh_key=None, source_security_groups=None)
Bases:
objectAn object representing the remote access configuration for the managed node group.
- Parameters:
ec2_ssh_key (
Optional[str]) – The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node group. For more information, see Amazon EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances . For Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and Windows instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances .source_security_groups (
Optional[Sequence[str]]) – The security group IDs that are allowed SSH access (port 22) to the nodes. For Windows, the port is 3389. If you specify an Amazon EC2 SSH key but don’t specify a source security group when you create a managed node group, then the port on the nodes is opened to the internet (0.0.0.0/0). For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins remote_access_property = eks_mixins.CfnNodegroupPropsMixin.RemoteAccessProperty( ec2_ssh_key="ec2SshKey", source_security_groups=["sourceSecurityGroups"] )
Attributes
- ec2_ssh_key
The Amazon EC2 SSH key name that provides access for SSH communication with the nodes in the managed node group.
For more information, see Amazon EC2 key pairs and Linux instances in the Amazon Elastic Compute Cloud User Guide for Linux Instances . For Windows, an Amazon EC2 SSH key is used to obtain the RDP password. For more information, see Amazon EC2 key pairs and Windows instances in the Amazon Elastic Compute Cloud User Guide for Windows Instances .
- source_security_groups
The security group IDs that are allowed SSH access (port 22) to the nodes.
For Windows, the port is 3389. If you specify an Amazon EC2 SSH key but don’t specify a source security group when you create a managed node group, then the port on the nodes is opened to the internet (
0.0.0.0/0). For more information, see Security Groups for Your VPC in the Amazon Virtual Private Cloud User Guide .
ScalingConfigProperty
- class CfnNodegroupPropsMixin.ScalingConfigProperty(*, desired_size=None, max_size=None, min_size=None)
Bases:
objectAn object representing the scaling configuration details for the Amazon EC2 Auto Scaling group that is associated with your node group.
When creating a node group, you must specify all or none of the properties. When updating a node group, you can specify any or none of the properties.
- Parameters:
desired_size (
Union[int,float,None]) – The current number of nodes that the managed node group should maintain. .. epigraph:: If you use the Kubernetes Cluster Autoscaler , you shouldn’t change thedesiredSizevalue directly, as this can cause the Cluster Autoscaler to suddenly scale up or scale down. Whenever this parameter changes, the number of worker nodes in the node group is updated to the specified size. If this parameter is given a value that is smaller than the current number of running worker nodes, the necessary number of worker nodes are terminated to match the given value. When using CloudFormation, no action occurs if you remove this parameter from your CFN template. This parameter can be different fromminSizein some cases, such as when starting with extra hosts for testing. This parameter can also be different when you want to start with an estimated number of needed hosts, but let the Cluster Autoscaler reduce the number if there are too many. When the Cluster Autoscaler is used, thedesiredSizeparameter is altered by the Cluster Autoscaler (but can be out-of-date for short periods of time). the Cluster Autoscaler doesn’t scale a managed node group lower thanminSizeor higher thanmaxSize.max_size (
Union[int,float,None]) – The maximum number of nodes that the managed node group can scale out to. For information about the maximum number that you can specify, see Amazon EKS service quotas in the Amazon EKS User Guide .min_size (
Union[int,float,None]) – The minimum number of nodes that the managed node group can scale in to.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins scaling_config_property = eks_mixins.CfnNodegroupPropsMixin.ScalingConfigProperty( desired_size=123, max_size=123, min_size=123 )
Attributes
- desired_size
The current number of nodes that the managed node group should maintain.
If you use the Kubernetes Cluster Autoscaler , you shouldn’t change the
desiredSizevalue directly, as this can cause the Cluster Autoscaler to suddenly scale up or scale down.Whenever this parameter changes, the number of worker nodes in the node group is updated to the specified size. If this parameter is given a value that is smaller than the current number of running worker nodes, the necessary number of worker nodes are terminated to match the given value. When using CloudFormation, no action occurs if you remove this parameter from your CFN template.
This parameter can be different from
minSizein some cases, such as when starting with extra hosts for testing. This parameter can also be different when you want to start with an estimated number of needed hosts, but let the Cluster Autoscaler reduce the number if there are too many. When the Cluster Autoscaler is used, thedesiredSizeparameter is altered by the Cluster Autoscaler (but can be out-of-date for short periods of time). the Cluster Autoscaler doesn’t scale a managed node group lower thanminSizeor higher thanmaxSize.
- max_size
The maximum number of nodes that the managed node group can scale out to.
For information about the maximum number that you can specify, see Amazon EKS service quotas in the Amazon EKS User Guide .
- min_size
The minimum number of nodes that the managed node group can scale in to.
TaintProperty
- class CfnNodegroupPropsMixin.TaintProperty(*, effect=None, key=None, value=None)
Bases:
objectA property that allows a node to repel a
Pod.For more information, see Node taints on managed node groups in the Amazon EKS User Guide .
- Parameters:
effect (
Optional[str]) – The effect of the taint.key (
Optional[str]) – The key of the taint.value (
Optional[str]) – The value of the taint.
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins taint_property = eks_mixins.CfnNodegroupPropsMixin.TaintProperty( effect="effect", key="key", value="value" )
Attributes
- effect
The effect of the taint.
- key
The key of the taint.
- value
The value of the taint.
UpdateConfigProperty
- class CfnNodegroupPropsMixin.UpdateConfigProperty(*, max_unavailable=None, max_unavailable_percentage=None, update_strategy=None)
Bases:
objectThe update configuration for the node group.
- Parameters:
max_unavailable (
Union[int,float,None]) – The maximum number of nodes unavailable at once during a version update. Nodes are updated in parallel. This value ormaxUnavailablePercentageis required to have a value.The maximum number is 100.max_unavailable_percentage (
Union[int,float,None]) – The maximum percentage of nodes unavailable during a version update. This percentage of nodes are updated in parallel, up to 100 nodes at once. This value ormaxUnavailableis required to have a value.update_strategy (
Optional[str]) – The configuration for the behavior to follow during a node group version update of this managed node group. You choose between two possible strategies for replacing nodes during an`UpdateNodegroupVersion<https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateNodegroupVersion.html>`_ action. An Amazon EKS managed node group updates by replacing nodes with new nodes of newer AMI versions in parallel. The update strategy changes the managed node update behavior of the managed node group for each quantity. The default strategy has guardrails to protect you from misconfiguration and launches the new instances first, before terminating the old instances. The minimal strategy removes the guardrails and terminates the old instances before launching the new instances. This minimal strategy is useful in scenarios where you are constrained to resources or costs (for example, with hardware accelerators such as GPUs).
- See:
- ExampleMetadata:
fixture=_generated
Example:
# The code below shows an example of how to instantiate this type. # The values are placeholders you should change. from aws_cdk.mixins_preview.aws_eks import mixins as eks_mixins update_config_property = eks_mixins.CfnNodegroupPropsMixin.UpdateConfigProperty( max_unavailable=123, max_unavailable_percentage=123, update_strategy="updateStrategy" )
Attributes
The maximum number of nodes unavailable at once during a version update.
Nodes are updated in parallel. This value or
maxUnavailablePercentageis required to have a value.The maximum number is 100.
The maximum percentage of nodes unavailable during a version update.
This percentage of nodes are updated in parallel, up to 100 nodes at once. This value or
maxUnavailableis required to have a value.
- update_strategy
The configuration for the behavior to follow during a node group version update of this managed node group.
You choose between two possible strategies for replacing nodes during an
`UpdateNodegroupVersion<https://docs.aws.amazon.com/eks/latest/APIReference/API_UpdateNodegroupVersion.html>`_ action.An Amazon EKS managed node group updates by replacing nodes with new nodes of newer AMI versions in parallel. The update strategy changes the managed node update behavior of the managed node group for each quantity. The default strategy has guardrails to protect you from misconfiguration and launches the new instances first, before terminating the old instances. The minimal strategy removes the guardrails and terminates the old instances before launching the new instances. This minimal strategy is useful in scenarios where you are constrained to resources or costs (for example, with hardware accelerators such as GPUs).