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?
By default eksctl create cluster will create a dedicated VPC for the cluster. This is done in order to avoid interference with existing resources for a variety of reasons, including security, but also because it is challenging to detect all settings in an existing VPC. The default VPC CIDR used by eksctl is 192.168.
kubectl – A command line tool for working with Kubernetes clusters. This guide requires that you use version 1.23 or later. For more information, see Installing or updating kubectl. eksctl – A command line tool for working with EKS clusters that automates many individual tasks.
eksctl is a simple CLI tool for creating and managing clusters on EKS - Amazon's managed Kubernetes service for EC2. It is written in Go, uses CloudFormation, was created by Weaveworks and it welcomes contributions from the community.
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']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With