create_nodegroup
async
¶
create_nodegroup(
cluster_name: String,
nodegroup_name: String,
subnets: StringList,
node_role: String,
*,
config_overrides: Optional[AsyncEKSClientConfig] = None,
scaling_config: Optional[NodegroupScalingConfig] = None,
disk_size: Optional[BoxedInteger] = None,
instance_types: Optional[StringList] = None,
ami_type: Optional[AMITypes] = None,
remote_access: Optional[RemoteAccessConfig] = None,
labels: Optional[labelsMap] = None,
taints: Optional[taintsList] = None,
tags: Optional[TagMap] = None,
client_request_token: Optional[String] = None,
launch_template: Optional[LaunchTemplateSpecification] = None,
update_config: Optional[NodegroupUpdateConfig] = None,
node_repair_config: Optional[NodeRepairConfig] = None,
capacity_type: Optional[CapacityTypes] = None,
version: Optional[String] = None,
release_version: Optional[String] = None,
warm_pool_config: Optional[WarmPoolConfig] = None,
) -> CreateNodegroupResponse
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 Amazon Web Services 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 Amazon Web Services Regions that support Windows on Amazon EKS.
Parameters:
-
cluster_name(String) –The name of your cluster.
-
nodegroup_name(String) –The unique name to give your node group.
-
scaling_config(Optional[NodegroupScalingConfig], default:None) –The scaling configuration details for the Auto Scaling group that is created for your node group.
-
disk_size(Optional[BoxedInteger], default: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. -
subnets(StringList) –The subnets to use for the Auto Scaling group that is created for your node group. If you specify
launchTemplate, then don't specifySubnetIdin 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. -
instance_types(Optional[StringList], default:None) –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
amiTypeparameter. 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.mediumis used, by default. If you specifySpotforcapacityType, 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. -
ami_type(Optional[AMITypes], default:None) –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-windowsto your Windows nodesrolearnin theaws-authConfigMap. For more information about using launch templates with Amazon EKS, see Customizing managed nodes with launch templates in the Amazon EKS User Guide. -
remote_access(Optional[RemoteAccessConfig], default: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. -
node_role(String) –The Amazon Resource Name (ARN) of the IAM role to associate with your node group. The Amazon EKS worker node
kubeletdaemon makes calls to Amazon Web Services 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 specifyIamInstanceProfilein 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. -
labels(Optional[labelsMap], default:None) –The Kubernetes
labelsto apply to the nodes in the node group when they are created. -
taints(Optional[taintsList], default:None) –The Kubernetes taints to be applied to the nodes in the node group. For more information, see Node taints on managed node groups.
-
tags(Optional[TagMap], default:None) –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 Amazon Web Services resources.
-
client_request_token(Optional[String], default:None) –A unique, case-sensitive identifier that you provide to ensure the idempotency of the request.
-
launch_template(Optional[LaunchTemplateSpecification], default: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 in
launchTemplateSpecification. Also refer to Customizing managed nodes with launch templates in the Amazon EKS User Guide. -
update_config(Optional[NodegroupUpdateConfig], default:None) –The node group update configuration.
-
node_repair_config(Optional[NodeRepairConfig], default:None) –The node auto repair configuration for the node group.
-
capacity_type(Optional[CapacityTypes], default:None) –The capacity type for your node group.
-
version(Optional[String], default:None) –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 specify
launchTemplate, 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 Customizing managed nodes with launch templates in the Amazon EKS User Guide. -
release_version(Optional[String], default:None) –The AMI version of the Amazon EKS optimized AMI to use with your node group. By default, the latest available AMI version for the node group's current Kubernetes version is used. For information about Linux versions, see Amazon EKS optimized Amazon Linux AMI versions in the Amazon EKS User Guide. Amazon EKS managed node groups support the November 2022 and later releases of the Windows AMIs. For information about Windows versions, see Amazon EKS optimized Windows AMI versions in the Amazon EKS User Guide.
If you specify
launchTemplate, and your launch template uses a custom AMI, then don't specifyreleaseVersion, 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. -
warm_pool_config(Optional[WarmPoolConfig], default:None) –The warm pool configuration for the node group. Warm pools maintain pre-initialized EC2 instances that can quickly join your cluster during scale-out events, improving application scaling performance and reducing costs.
Raises:
-
ClientException–These errors are usually caused by a client action. Actions can include using an action or resource on behalf of an IAM principal that doesn't have permissions to use the action or resource or specifying an identifier that is not valid.
-
InvalidParameterException–The specified parameter is invalid. Review the available parameters for the API request.
-
InvalidRequestException–The request is invalid given the state of the cluster. Check the state of the cluster and the associated operations.
-
ResourceInUseException–The specified resource is in use.
-
ResourceLimitExceededException–You have encountered a service limit on the specified resource.
-
ServerException–These errors are usually caused by a server-side issue.
-
ServiceUnavailableException–The service is unavailable. Back off and retry the operation.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_eks/_services/async_eks.py
1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341 1342 1343 1344 1345 1346 1347 1348 1349 1350 1351 1352 1353 1354 1355 1356 1357 1358 1359 1360 1361 1362 1363 1364 1365 1366 1367 1368 1369 1370 1371 1372 1373 1374 1375 1376 1377 1378 1379 1380 1381 1382 1383 1384 1385 1386 1387 1388 1389 1390 1391 1392 1393 1394 1395 1396 1397 1398 1399 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1413 1414 1415 1416 1417 1418 1419 1420 1421 1422 1423 1424 1425 1426 1427 1428 1429 1430 1431 1432 1433 | |