0

currently I'm trying to create a managed node group on EKS using eksctl. Here is my script:

eksctl create nodegroup \                                                     
--cluster=my-cluster \
--region ap-southeast-1 \
--name=spot-instances-nodes \
--nodes 1 \
--nodes-min 1 \
--nodes-max 10 \
--spot \
--asg-access \
--instance-types=t3.medium,t3a.medium

Everything is okay, but when I check in the Auto Scaling groups, Launch Template tab, the "Request Spot Instances" is NO. I don't know whether it is right or wrong?

Furthermore, I want to apply MixInstancesPolicies for this group? I tried to search on Google but there are not much documents. So I wonder if it is applied by default or if there are any ways to apply the policy when creating a node group.

Any kind of help is appreciated, a link or a comment is also helpful. Many thanks.

Nguyen Hoang Vu
  • 751
  • 2
  • 14
  • 35

1 Answers1

0

You can use the following template: my-cluster.yaml

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: spot-cluster
  region: ap-southeast-1
  

managedNodeGroups:
# Spot intances
- name: spot
  instanceTypes: ["t3.medium","t3a.medium"]
  spot: true
  launchTemplate:
    id: lt-12345
    version: "1"
  minSize: 1
  desiredCapacity: 1
  maxSize: 10

# On-Demand instances
- name: on-demand
  instanceTypes: ["t3.medium","t3a.medium"]
  launchTemplate:
    id: lt-12345
    version: "1"

eksctl create cluster -f my-cluster.yaml --asg-access

To enable cluster autoscaler, see this