Search code examples
amazon-web-serviceskubernetesamazon-ec2amazon-ekseksctl

How to configure max price for managed node group for spot instances while creating AWS EKS cluster using eksctl config schema?


I'm creating EKS cluster using the eksctl. While developing the yaml configurations for the underlying resources, I came to know that spot instance is also supported with AWS EKS cluster(here). However while referring the documentation/schema, I didn't find anything to limit the bidding price for spot instance. So by default, it will bid with on demand pricing which is not ideal. Am I missing anything here or it's just not possible at the moment?

Sample yaml config for spot(cluster-config-spot.yaml) -

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
  name: spot-cluster
  region: us-east-2
  version: "1.23"
managedNodeGroups :
  - name: spot-managed-node-group-1
    instanceType: ["c7g.xlarge","c6g.xlarge"]
    minSize: 1
    maxSize: 10
    spot: true

AWS EKS cluster creation command -

eksctl create cluster -f cluster-config-spot.yaml

Solution

  • maxPrice can be set for self-managed node group this way; but this is not supported for managed node group. You can upvote the feature here.