CfnNodegroup
- class aws_cdk.aws_eks.CfnNodegroup(scope, id, *, cluster_name, node_role, subnets, ami_type=None, capacity_type=None, disk_size=None, force_update_enabled=None, instance_types=None, labels=None, launch_template=None, nodegroup_name=None, node_repair_config=None, release_version=None, remote_access=None, scaling_config=None, tags=None, taints=None, update_config=None, version=None)
Bases:
CfnResource
Creates 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 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
- 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 import aws_eks as eks cfn_nodegroup = eks.CfnNodegroup(self, "MyCfnNodegroup", cluster_name="clusterName", node_role="nodeRole", subnets=["subnets"], # the properties below are optional ami_type="amiType", capacity_type="capacityType", disk_size=123, force_update_enabled=False, instance_types=["instanceTypes"], labels={ "labels_key": "labels" }, launch_template=eks.CfnNodegroup.LaunchTemplateSpecificationProperty( id="id", name="name", version="version" ), nodegroup_name="nodegroupName", node_repair_config=eks.CfnNodegroup.NodeRepairConfigProperty( enabled=False ), release_version="releaseVersion", remote_access=eks.CfnNodegroup.RemoteAccessProperty( ec2_ssh_key="ec2SshKey", # the properties below are optional source_security_groups=["sourceSecurityGroups"] ), scaling_config=eks.CfnNodegroup.ScalingConfigProperty( desired_size=123, max_size=123, min_size=123 ), tags={ "tags_key": "tags" }, taints=[eks.CfnNodegroup.TaintProperty( effect="effect", key="key", value="value" )], update_config=eks.CfnNodegroup.UpdateConfigProperty( max_unavailable=123, max_unavailable_percentage=123, update_strategy="updateStrategy" ), version="version" )
- Parameters:
scope (
Construct
) – Scope in which this resource is defined.id (
str
) – Construct identifier for this resource (unique in its scope).cluster_name (
str
) – The name of your cluster.node_role (
str
) –The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker node
kubelet
daemon makes calls to AWS APIs on your behalf. Nodes receive permissions for these API calls through an IAM instance profile and associated policies. Before you can launch nodes and register them into a cluster, you must create an IAM role for those nodes to use when they are launched. For more information, see Amazon EKS node IAM role in the Amazon EKS User Guide . If you specifylaunchTemplate
, then don’t specify[IamInstanceProfile](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_IamInstanceProfile.html)
in your launch template, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide .subnets (
Sequence
[str
]) –The subnets to use for the Auto Scaling group that is created for your node group. If you specify
launchTemplate
, then don’t specify[SubnetId](https://docs.aws.amazon.com/AWSEC2/latest/APIReference/API_CreateNetworkInterface.html)
in your launch template, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide .ami_type (
Optional
[str
]) –The AMI type for your node group. If you specify
launchTemplate
, and your launch template uses a custom AMI, then don’t specifyamiType
, or the node group deployment will fail. If your launch template uses a Windows custom AMI, then addeks:kube-proxy-windows
to your Windows nodesrolearn
in theaws-auth
ConfigMap
. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide .capacity_type (
Optional
[str
]) – The capacity type of your managed node group.disk_size (
Union
[int
,float
,None
]) –The root device disk size (in GiB) for your node group instances. The default disk size is 20 GiB for Linux and Bottlerocket. The default disk size is 50 GiB for Windows. If you specify
launchTemplate
, then don’t specifydiskSize
, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide .force_update_enabled (
Union
[bool
,IResolvable
,None
]) – Force the update if anyPod
on the existing node group can’t be drained due to aPod
disruption budget issue. If an update fails because all Pods can’t be drained, you can force the update after it fails to terminate the old node whether or not anyPod
is running on the node. Default: - falseinstance_types (
Optional
[Sequence
[str
]]) –Specify the instance types for a node group. If you specify a GPU instance type, make sure to also specify an applicable GPU AMI type with the
amiType
parameter. If you specifylaunchTemplate
, then you can specify zero or one instance type in your launch template or you can specify 0-20 instance types forinstanceTypes
. If however, you specify an instance type in your launch template and specify anyinstanceTypes
, the node group deployment will fail. If you don’t specify an instance type in a launch template or forinstanceTypes
, thent3.medium
is used, by default. If you specifySpot
forcapacityType
, then we recommend specifying multiple values forinstanceTypes
. For more information, see Managed node group capacity types and Customizing managed nodes with launch templates in the Amazon EKS User Guide .labels (
Union
[Mapping
[str
,str
],IResolvable
,None
]) – The Kuberneteslabels
applied to the nodes in the node group. .. epigraph:: Onlylabels
that are applied with the Amazon EKS API are shown here. There may be other Kuberneteslabels
applied to the nodes in this group.launch_template (
Union
[IResolvable
,LaunchTemplateSpecificationProperty
,Dict
[str
,Any
],None
]) –An object representing a node group’s launch template specification. When using this object, don’t directly specify
instanceTypes
,diskSize
, orremoteAccess
. You cannot later specify a different launch template ID or name than what was used to create the node group. Make sure that the launch template meets the requirements inlaunchTemplateSpecification
. Also refer to Customizing managed nodes with launch templates in the Amazon EKS User Guide .nodegroup_name (
Optional
[str
]) – The unique name to give your node group.node_repair_config (
Union
[IResolvable
,NodeRepairConfigProperty
,Dict
[str
,Any
],None
]) – The node auto repair configuration for the node group.release_version (
Optional
[str
]) – 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 . .. epigraph:: Changing this value triggers an update of the node group if one is available. You can’t update other properties at the same time as updatingRelease Version
.remote_access (
Union
[IResolvable
,RemoteAccessProperty
,Dict
[str
,Any
],None
]) –The remote access configuration to use with your node group. For Linux, the protocol is SSH. For Windows, the protocol is RDP. If you specify
launchTemplate
, then don’t specifyremoteAccess
, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide .scaling_config (
Union
[IResolvable
,ScalingConfigProperty
,Dict
[str
,Any
],None
]) – The scaling configuration details for the Auto Scaling group that is created for your node group.tags (
Optional
[Mapping
[str
,str
]]) – Metadata that assists with categorization and organization. Each tag consists of a key and an optional value. You define both. Tags don’t propagate to any other cluster or AWS resources.taints (
Union
[IResolvable
,Sequence
[Union
[IResolvable
,TaintProperty
,Dict
[str
,Any
]]],None
]) – The Kubernetes taints to be applied to the nodes in the node group when they are created. Effect is one ofNo_Schedule
,Prefer_No_Schedule
, orNo_Execute
. Kubernetes taints can be used together with tolerations to control how workloads are scheduled to your nodes. For more information, see Node taints on managed node groups .update_config (
Union
[IResolvable
,UpdateConfigProperty
,Dict
[str
,Any
],None
]) – The node group update configuration.version (
Optional
[str
]) – The Kubernetes version to use for your managed nodes. By default, the Kubernetes version of the cluster is used, and this is the only accepted specified value. If you specifylaunchTemplate
, and your launch template uses a custom AMI, then don’t specifyversion
, or the node group deployment will fail. For more information about using launch templates with Amazon EKS, see Launch template support in the Amazon EKS User Guide . .. epigraph:: You can’t update other properties at the same time as updatingVersion
.
Methods
- add_deletion_override(path)
Syntactic sugar for
addOverride(path, undefined)
.- Parameters:
path (
str
) – The path of the value to delete.- Return type:
None
- add_dependency(target)
Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
This can be used for resources across stacks (or nested stack) boundaries and the dependency will automatically be transferred to the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- add_depends_on(target)
(deprecated) Indicates that this resource depends on another resource and cannot be provisioned unless the other resource has been successfully provisioned.
- Parameters:
target (
CfnResource
) –- Deprecated:
use addDependency
- Stability:
deprecated
- Return type:
None
- add_metadata(key, value)
Add a value to the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –value (
Any
) –
- See:
- Return type:
None
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- add_override(path, value)
Adds an override to the synthesized CloudFormation resource.
To add a property override, either use
addPropertyOverride
or prefixpath
with “Properties.” (i.e.Properties.TopicName
).If the override is nested, separate each nested level using a dot (.) in the path parameter. If there is an array as part of the nesting, specify the index in the path.
To include a literal
.
in the property name, prefix with a\
. In most programming languages you will need to write this as"\\."
because the\
itself will need to be escaped.For example:
cfn_resource.add_override("Properties.GlobalSecondaryIndexes.0.Projection.NonKeyAttributes", ["myattribute"]) cfn_resource.add_override("Properties.GlobalSecondaryIndexes.1.ProjectionType", "INCLUDE")
would add the overrides Example:
"Properties": { "GlobalSecondaryIndexes": [ { "Projection": { "NonKeyAttributes": [ "myattribute" ] ... } ... }, { "ProjectionType": "INCLUDE" ... }, ] ... }
The
value
argument toaddOverride
will not be processed or translated in any way. Pass raw JSON values in here with the correct capitalization for CloudFormation. If you pass CDK classes or structs, they will be rendered with lowercased key names, and CloudFormation will reject the template.- Parameters:
path (
str
) –The path of the property, you can use dot notation to override values in complex types. Any intermediate keys will be created as needed.
value (
Any
) –The value. Could be primitive or complex.
- Return type:
None
- add_property_deletion_override(property_path)
Adds an override that deletes the value of a property from the resource definition.
- Parameters:
property_path (
str
) – The path to the property.- Return type:
None
- add_property_override(property_path, value)
Adds an override to a resource property.
Syntactic sugar for
addOverride("Properties.<...>", value)
.- Parameters:
property_path (
str
) – The path of the property.value (
Any
) – The value.
- Return type:
None
- apply_removal_policy(policy=None, *, apply_to_update_replace_policy=None, default=None)
Sets the deletion policy of the resource based on the removal policy specified.
The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.
The resource can be deleted (
RemovalPolicy.DESTROY
), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN
). In some cases, a snapshot can be taken of the resource prior to deletion (RemovalPolicy.SNAPSHOT
). A list of resources that support this policy can be found in the following link:- Parameters:
policy (
Optional
[RemovalPolicy
]) –apply_to_update_replace_policy (
Optional
[bool
]) – Apply the same deletion policy to the resource’s “UpdateReplacePolicy”. Default: truedefault (
Optional
[RemovalPolicy
]) – The default policy to apply in case the removal policy is not defined. Default: - Default value is resource specific. To determine the default value for a resource, please consult that specific resource’s documentation.
- See:
- Return type:
None
- get_att(attribute_name, type_hint=None)
Returns a token for an runtime attribute of this resource.
Ideally, use generated attribute accessors (e.g.
resource.arn
), but this can be used for future compatibility in case there is no generated attribute.- Parameters:
attribute_name (
str
) – The name of the attribute.type_hint (
Optional
[ResolutionTypeHint
]) –
- Return type:
- get_metadata(key)
Retrieve a value value from the CloudFormation Resource Metadata.
- Parameters:
key (
str
) –- See:
- Return type:
Any
Note that this is a different set of metadata from CDK node metadata; this metadata ends up in the stack template under the resource, whereas CDK node metadata ends up in the Cloud Assembly.
- inspect(inspector)
Examines the CloudFormation resource and discloses attributes.
- Parameters:
inspector (
TreeInspector
) – tree inspector to collect and process attributes.- Return type:
None
- obtain_dependencies()
Retrieves an array of resources this resource depends on.
This assembles dependencies on resources across stacks (including nested stacks) automatically.
- Return type:
List
[Union
[Stack
,CfnResource
]]
- obtain_resource_dependencies()
Get a shallow copy of dependencies between this resource and other resources in the same stack.
- Return type:
List
[CfnResource
]
- override_logical_id(new_logical_id)
Overrides the auto-generated logical ID with a specific ID.
- Parameters:
new_logical_id (
str
) – The new logical ID to use for this stack element.- Return type:
None
- remove_dependency(target)
Indicates that this resource no longer depends on another resource.
This can be used for resources across stacks (including nested stacks) and the dependency will automatically be removed from the relevant scope.
- Parameters:
target (
CfnResource
) –- Return type:
None
- replace_dependency(target, new_target)
Replaces one dependency with another.
- Parameters:
target (
CfnResource
) – The dependency to replace.new_target (
CfnResource
) – The new dependency to add.
- Return type:
None
- to_string()
Returns a string representation of this construct.
- Return type:
str
- Returns:
a string representation of this resource
Attributes
- CFN_RESOURCE_TYPE_NAME = 'AWS::EKS::Nodegroup'
- ami_type
The AMI type for your node group.
- attr_arn
The Amazon Resource Name (ARN) associated with the managed node group.
- CloudformationAttribute:
Arn
- attr_cluster_name
The name of your cluster.
- CloudformationAttribute:
ClusterName
- attr_id
Id
- Type:
cloudformationAttribute
- attr_nodegroup_name
The name associated with an Amazon EKS managed node group.
- CloudformationAttribute:
NodegroupName
- capacity_type
The capacity type of your managed node group.
- cfn_options
Options for this resource, such as condition, update policy etc.
- cfn_resource_type
AWS resource type.
- cluster_name
The name of your cluster.
- creation_stack
return:
the stack trace of the point where this Resource was created from, sourced from the +metadata+ entry typed +aws:cdk:logicalId+, and with the bottom-most node +internal+ entries filtered.
- disk_size
The root device disk size (in GiB) for your node group instances.
- force_update_enabled
Force the update if any
Pod
on the existing node group can’t be drained due to aPod
disruption budget issue.
- instance_types
Specify the instance types for a node group.
- labels
The Kubernetes
labels
applied to the nodes in the node group.
- launch_template
An object representing a node group’s launch template specification.
- logical_id
The logical ID for this CloudFormation stack element.
The logical ID of the element is calculated from the path of the resource node in the construct tree.
To override this value, use
overrideLogicalId(newLogicalId)
.- Returns:
the logical ID as a stringified token. This value will only get resolved during synthesis.
- node
The tree node.
- node_repair_config
The node auto repair configuration for the node group.
- node_role
The Amazon Resource Name (ARN) of the IAM role to associate with your node group.
- nodegroup_name
The unique name to give your node group.
- ref
Return a string that will be resolved to a CloudFormation
{ Ref }
for this element.If, by any chance, the intrinsic reference of a resource is not a string, you could coerce it to an IResolvable through
Lazy.any({ produce: resource.ref })
.
- release_version
//docs.aws.amazon.com/eks/latest/userguide/eks-linux-ami-versions.html>`_ in the Amazon EKS User Guide .
- Type:
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 <https
- remote_access
The remote access configuration to use with your node group.
- scaling_config
The scaling configuration details for the Auto Scaling group that is created for your node group.
- stack
The stack in which this element is defined.
CfnElements must be defined within a stack scope (directly or indirectly).
- subnets
The subnets to use for the Auto Scaling group that is created for your node group.
- tags
Tag Manager which manages the tags for this resource.
- tags_raw
Metadata that assists with categorization and organization.
- taints
The Kubernetes taints to be applied to the nodes in the node group when they are created.
- update_config
The node group update configuration.
- version
The Kubernetes version to use for your managed nodes.
Static Methods
- classmethod is_cfn_element(x)
Returns
true
if a construct is a stack element (i.e. part of the synthesized cloudformation template).Uses duck-typing instead of
instanceof
to allow stack elements from different versions of this library to be included in the same stack.- Parameters:
x (
Any
) –- Return type:
bool
- Returns:
The construct as a stack element or undefined if it is not a stack element.
- classmethod is_cfn_resource(x)
Check whether the given object is a CfnResource.
- Parameters:
x (
Any
) –- Return type:
bool
- classmethod is_construct(x)
Checks if
x
is a construct.Use this method instead of
instanceof
to properly detectConstruct
instances, even when the construct library is symlinked.Explanation: in JavaScript, multiple copies of the
constructs
library on disk are seen as independent, completely different libraries. As a consequence, the classConstruct
in each copy of theconstructs
library is seen as a different class, and an instance of one class will not test asinstanceof
the other class.npm install
will not create installations like this, but users may manually symlink construct libraries together or use a monorepo tool: in those cases, multiple copies of theconstructs
library can be accidentally installed, andinstanceof
will behave unpredictably. It is safest to avoid usinginstanceof
, and using this type-testing method instead.- Parameters:
x (
Any
) – Any object.- Return type:
bool
- Returns:
true if
x
is an object created from a class which extendsConstruct
.
LaunchTemplateSpecificationProperty
- class CfnNodegroup.LaunchTemplateSpecificationProperty(*, id=None, name=None, version=None)
Bases:
object
An 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 import aws_eks as eks launch_template_specification_property = eks.CfnNodegroup.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.
NodeRepairConfigProperty
- class CfnNodegroup.NodeRepairConfigProperty(*, enabled=None)
Bases:
object
The 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.- 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 import aws_eks as eks node_repair_config_property = eks.CfnNodegroup.NodeRepairConfigProperty( enabled=False )
Attributes
- enabled
Specifies whether to enable node auto repair for the node group.
Node auto repair is disabled by default.
RemoteAccessProperty
- class CfnNodegroup.RemoteAccessProperty(*, ec2_ssh_key, source_security_groups=None)
Bases:
object
An object representing the remote access configuration for the managed node group.
- Parameters:
ec2_ssh_key (
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 import aws_eks as eks remote_access_property = eks.CfnNodegroup.RemoteAccessProperty( ec2_ssh_key="ec2SshKey", # the properties below are optional 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 CfnNodegroup.ScalingConfigProperty(*, desired_size=None, max_size=None, min_size=None)
Bases:
object
An object representing the scaling configuration details for the 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 thedesiredSize
value 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 fromminSize
in 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, thedesiredSize
parameter 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 thanminSize
or 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 import aws_eks as eks scaling_config_property = eks.CfnNodegroup.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
desiredSize
value 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
minSize
in 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, thedesiredSize
parameter 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 thanminSize
or 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 CfnNodegroup.TaintProperty(*, effect=None, key=None, value=None)
Bases:
object
A 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 import aws_eks as eks taint_property = eks.CfnNodegroup.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 CfnNodegroup.UpdateConfigProperty(*, max_unavailable=None, max_unavailable_percentage=None, update_strategy=None)
Bases:
object
The 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 ormaxUnavailablePercentage
is 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 ormaxUnavailable
is 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 import aws_eks as eks update_config_property = eks.CfnNodegroup.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
maxUnavailablePercentage
is 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
maxUnavailable
is 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).