7
votes

When creating a cluster using eksctl on the command line, one can specify availability zones using the "zones" flag, like so:

eksctl create cluster \
--name example \
--version 1.16 \
--region us-east-1 \
--zones us-east-1a,us-east-1b,us-east-1c

In the eksctl documentation, it is noted that configuration files are more flexible than flags. However, eksctl configuration file options are poorly documented, and there is no way to generate config files from flags.

The eksctl repo provides is an example that uses an existing VPC with predefined subnets, but this provides no visibility into how the same settings relate to de novo VPCs. It is also much more fine-grained than what is necessary with the flags.

If one were highly proficient in golang (and very patient), one could figure it out from source, but IMO this defeats the purpose of a turnkey solution like eksctl.

Is there a way to use a config file to achieve what is achieved in the flag example above? If so, how?

1

1 Answers

13
votes

This is a yaml that i used a few days ago to build a cluster with eksctl:

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig

metadata:
  name: myname
  region: us-east-1

nodeGroups:
  - name: ng-1
    labels:  
      worker: default
    instanceType: m5.xlarge
    desiredCapacity: 1
    minSize: 1
    maxSize: 10
availabilityZones: ['us-east-1a', 'us-east-1b', 'us-east-1c', 'us-east-1d']