Add Spot managed node group

This workshop has been deprecated and archived. The new Amazon EKS Workshop is now available at

We have our EKS cluster and nodes already, but we need some Spot Instances configured to run the workload. We will be creating a Spot managed node group to utilize Spot Instances. Managed node groups automatically create a label - - to identify which nodes are Spot Instances and which are On-Demand Instances so that we can schedule the appropriate workloads to run on Spot Instances. We will use eksctl to launch new nodes running on Spot Instances that will connect to the EKS cluster.

First, we can check that the current nodes are running On-Demand by checking the label is set to ON_DEMAND. The output of the command shows the CAPACITYTYPE for the current nodes is set to ON_DEMAND.

kubectl get nodes \ \

OnDemand Output

Create Spot managed node group

We will now create the a Spot managed node group using the –spot option in eksctl create nodegroup command.

eksctl create nodegroup \
  --cluster=eksworkshop-eksctl --region=${AWS_REGION} \
  --managed --spot --name=ng-spot \

Note, the instances above might not be present in your region. To select instances that meet that criteria in your region, you could install and execute the command ec2-instance-selector --base-instance-type m5.large --flexible to get a diversified selection of instances available in your region of choice that meet the criteria of being similar to m4.large (in vCPU and memory terms)

Spot managed node group creates a label and sets it to SPOT for the nodes.

The Spot managed node group created follows Spot best practices including using capacity-optimized as the spotAllocationStrategy, which will launch instances from the Spot Instance pools with the most available capacity (when EC2 needs the capacity back), aiming to decrease the number of Spot interruptions in our cluster.

The creation of the nodes will take about 3 minutes.

Confirm the Nodes

Confirm that the new nodes joined the cluster correctly. You should see 2 more nodes added to the cluster.

kubectl get nodes --sort-by=.metadata.creationTimestamp

All Nodes You can use the to identify the lifecycle of the nodes. The output of this command should return 2 nodes with the CAPACITYTYPE set to SPOT.

kubectl get nodes \ \

Spot Output