Help improve this page
To contribute to this user guide, choose the Edit this page on GitHub link that is located in the right pane of every page.
Choose an optimal Amazon EC2 node instance type
Amazon EC2 provides a wide selection of instance types for worker nodes. Each instance type offers different compute, memory, storage, and network capabilities. Each instance is also grouped in an instance family based on these capabilities. For a list, see Available instance types in the Amazon EC2 User Guide. Amazon EKS releases several variations of Amazon EC2 AMIs to enable support. To make sure that the instance type you select is compatible with Amazon EKS, consider the following criteria.
-
All Amazon EKS AMIs don’t currently support the
macfamily. -
Arm and non-accelerated Amazon EKS AMIs don’t support the
g3,g4,inf, andpfamilies. -
Accelerated Amazon EKS AMIs don’t support the
a,c,hpc,m, andtfamilies. -
For Arm-based instances, Amazon Linux 2023 (AL2023) only supports instance types that use Graviton2 or later processors. AL2023 doesn’t support
A1instances.
When choosing between instance types that are supported by Amazon EKS, consider the following capabilities of each type.
- Number of instances in a node group
-
In general, fewer, larger instances are better, especially if you have a lot of Daemonsets. Each instance requires API calls to the API server, so the more instances you have, the more load on the API server.
- Operating system
-
Review the supported instance types for Linux, Windows, and Bottlerocket
. Before creating Windows instances, review Deploy Windows nodes on EKS clusters. - Hardware architecture
-
Do you need x86 or Arm? Before deploying Arm instances, review Amazon EKS optimized Arm Amazon Linux AMIs. Do you need instances built on the Nitro System ( Linux or Windows) or that have Accelerated capabilities? If you need accelerated capabilities, you can only use Linux with Amazon EKS.
- Maximum number of Pods
-
Since each Pod is assigned its own IP address, the number of IP addresses supported by an instance type is a factor in determining the number of Pods that can run on the instance. To manually determine how many Pods an instance type supports, see .
Note
If you’re using an Amazon EKS optimized Amazon Linux 2 AMI that’s
v20220406or newer, you can use a new instance type without upgrading to the latest AMI. For these AMIs, the AMI auto-calculates the necessarymax-podsvalue if it isn’t listed in the eni-max-pods.txtfile. Instance types that are currently in preview may not be supported by Amazon EKS by default. Values for max-podsfor such types still need to be added toeni-max-pods.txtin our AMI.AWS Nitro System
instance types optionally support significantly more IP addresses than non-Nitro System instance types. However, not all IP addresses assigned for an instance are available to Pods. To assign a significantly larger number of IP addresses to your instances, you must have version 1.9.0or later of the Amazon VPC CNI add-on installed in your cluster and configured appropriately. For more information, see Assign more IP addresses to Amazon EKS nodes with prefixes. To assign the largest number of IP addresses to your instances, you must have version1.10.1or later of the Amazon VPC CNI add-on installed in your cluster and deploy the cluster with theIPv6family. - IP family
-
You can use any supported instance type when using the
IPv4family for a cluster, which allows your cluster to assign privateIPv4addresses to your Pods and Services. But if you want to use theIPv6family for your cluster, then you must use AWS Nitro Systeminstance types or bare metal instance types. Only IPv4is supported for Windows instances. Your cluster must be running version1.10.1or later of the Amazon VPC CNI add-on. For more information about usingIPv6, see Learn about IPv6 addresses to clusters, Pods, and services. - Version of the Amazon VPC CNI add-on that you’re running
-
The latest version of the Amazon VPC CNI plugin for Kubernetes
supports these instance types . You may need to update your Amazon VPC CNI add-on version to take advantage of the latest supported instance types. For more information, see Assign IPs to Pods with the Amazon VPC CNI. The latest version supports the latest features for use with Amazon EKS. Earlier versions don’t support all features. You can view features supported by different versions in the Changelog on GitHub. - AWS Region that you’re creating your nodes in
-
Not all instance types are available in all AWS Regions.
- Whether you’re using security groups for Pods
-
If you’re using security groups for Pods, only specific instance types are supported. For more information, see Assign security groups to individual Pods.
How maxPods is determined
The final maxPods value applied to a node depends on several components that interact in a specific order of precedence. Understanding this order helps you avoid unexpected behavior when customizing maxPods.
Order of precedence (highest to lowest):
-
Managed node group enforcement – When you use a managed node group without a custom AMI, Amazon EKS enforces a cap on
maxPodsin the node’s user data. For instances with less than 30 vCPUs, the cap is110. For instances with greater than 30 vCPUs, the cap is250. This value takes precedence over any othermaxPodsconfiguration, includingmaxPodsExpression. -
kubelet
maxPodsconfiguration – If you setmaxPodsdirectly in the kubelet configuration (for example, through a launch template with a custom AMI), this value takes precedence overmaxPodsExpression. -
nodeadm
maxPodsExpression– If you usemaxPodsExpressionin your NodeConfig, nodeadm evaluates the expression to calculatemaxPods. This is only effective when the value is not already set by a higher-precedence source. -
Default ENI-based calculation – If no other value is set, the AMI calculates
maxPodsbased on the number of elastic network interfaces and IP addresses supported by the instance type. This is equivalent to the formula(number of ENIs × (IPs per ENI − 1)) + 2. The+ 2accounts for the Amazon VPC CNI andkube-proxyrunning on every node, which don’t consume a Pod IP address.
Important
If you use a managed node group and set maxPodsExpression in your NodeConfig, the managed node group’s enforcement overrides your expression. To use a custom maxPods value with managed node groups, you must specify a custom AMI in your launch template and set maxPods directly. For more information, see Customize managed nodes with launch templates.
Managed node groups vs. self-managed nodes
With managed node groups (without a custom AMI), Amazon EKS injects the maxPods value into the node’s bootstrap user data. This means:
-
The
maxPodsvalue is always capped at110or250depending on instance size. -
Any
maxPodsExpressionyou configure is overridden by this injected value. -
To use a different
maxPodsvalue, specify a custom AMI in your launch template and pass--use-max-pods falsealong with--kubelet-extra-args '--max-pods=to themy-value'bootstrap.shscript. For examples, see Customize managed nodes with launch templates.
With self-managed nodes, you have full control over the bootstrap process. You can use maxPodsExpression in your NodeConfig or pass --max-pods directly to bootstrap.sh.
Considerations for EKS Auto Mode
EKS Auto Mode limits the number of pods on nodes to the lower of:
-
110 pods hard cap
-
The result of the max pods calculation described above.