awslabs / ec2-spot-labs

Collection of tools and code examples to demonstrate best practices in using Amazon EC2 Spot Instances.
https://aws.amazon.com/ec2/spot/
Other
935 stars 319 forks source link

Encountered non numeric value for property VolumeSize #20

Open rabejens opened 5 years ago

rabejens commented 5 years ago

I tried to use the amazon-eks-nodegroup-with-spot.yaml to provision some EKS nodes. I entered all parameters correctly, but cluster creation fails with:

Encountered non numeric value for property VolumeSize

and

Encountered non numeric value for property MinSize

I quadruple-checked all values entered ARE indeed numeric.

What am I missing?

ruecarlo commented 5 years ago

Hi Jens,

I'd suggest taking a look at the spot workers section at https://eksworkshop.com/spotworkers/. The cfn provided in that lab is an updated version, that uses Launch Templates and supports mixed instance policies.

Also, if you are using eksctl, starting from eksctl 1.35, mixed instance policies are supported as well, so you can do something like eksctl create nodegroup -f my_config.yml

Where the cluster config could look something like the following:

---
apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
    name: my-cluster
    region: eu-west-1
nodeGroups:
    - name: mixed-eksctl-spot
      minSize: 1
      maxSize: 10
      instancesDistribution:
        maxPrice: 2
        instanceTypes: ["c4.xlarge", "c5.xlarge", "c5d.xlarge"] 
        onDemandBaseCapacity: 0
        onDemandPercentageAboveBaseCapacity: 0
        spotInstancePools: 3
      labels:
        lifecycle: Ec2Spot
        myMixedInstanceGroup: clusterAutoScaler
      taints:
        spotInstance: "true:PreferNoSchedule"
      availabilityZones: ["us-west-2a","us-west-2b","us-west-2c"]
      iam:
        withAddonPolicies:
          autoScaler: true
          cloudWatch: true
          albIngress: true
          appMesh: true
          xRay: true

Finally if you are considering using EC2 Spot on EKS/K8s, I'd recommend taking a look at this blog post, were Ran, from our team does a good summary of things to consider.

On the back of this, I'll leave this issue open and we will review and update the reference materials in this repo!