Help improve this page
Want to contribute to this user guide? Choose the Edit this page on GitHub link that is located in the right pane of every page. Your contributions will help make our user guide better for everyone.
Control if a workload is deployed on EKS Auto Mode nodes
When running workloads in an EKS cluster with EKS Auto Mode, you might need to control whether specific workloads run on EKS Auto Mode nodes or other compute types. This topic describes how to use node selectors and affinity rules to ensure your workloads are scheduled on the intended compute infrastructure.
The examples in this topic demonstrate how to use the eks.amazonaws.com/compute-type
label to either require or prevent workload deployment on EKS Auto Mode nodes. This is particularly useful in mixed-mode clusters where you’re running both EKS Auto Mode and other compute types, such as self-managed Karpenter provisioners or EKS Managed Node Groups.
EKS Auto Mode nodes have set the value of the label eks.amazonaws.com/compute-type
to auto
. You can use this label to control if a workload is deployed to nodes managed by EKS Auto Mode.
Require a workload is deployed to EKS Auto Mode nodes
Note
This nodeSelector
value is not required for EKS Auto Mode. This nodeSelector
value is only relevant if you are running a cluster in a mixed mode, node types not managed by EKS Auto Mode. For example, you may have static compute capacity deployed to your cluster with EKS Managed Node Groups, and have dynamic compute capacity managed by EKS Auto Mode.
You can add this nodeSelector
to Deployments or other workloads to require Kubernetes schedule them onto EKS Auto Mode nodes.
apiVersion: apps/v1 kind: Deployment spec: nodeSelector: eks.amazonaws.com/compute-type: auto
Require a workload is not deployed to EKS Auto Mode nodes
You can add this nodeAffinity
to Deployments or other workloads to require Kubernetes not schedule them onto EKS Auto Mode nodes.
affinity: nodeAffinity: requiredDuringSchedulingIgnoredDuringExecution: nodeSelectorTerms: - matchExpressions: - key: eks.amazonaws.com/compute-type operator: NotIn values: - auto