What Is EKSCTL?
EKSCTL almost automates much of our experience of creating EKS Cluster. EKSCTL is written in Go and makes use of AWS service, CloudFormation. It is the official CLI for Amazon EKS. The current version of eksctl allows you to create a number of clusters, list those, and delete them as well.
Amazon Production Grade EKS Cluster with One Command:
When we look at creating a Production grade EKS Cluster, we can create an EKS Cluster with the following command: eksctl create cluster
When you run the above command, following things happen:
Sets up the AWS Identity and Access Management(IAM ) Role for the master plane to connect to EKS.
Creates the Amazon VPC architecture, and the master control plane.
Brings up instances, and deploys the ConfigMap so nodes can join the cluster.
Provides access to the cluster with a pre-defined kubeconfig file.
Create Production Grade EKS CLuster: Using Config Files
You can create Production Grade EKS Cluster using the Config File. Following are the steps:
First, attach the following AWS Managed Policies for a role / user / group required for creating an EKS Cluster using EKSCTL
AmazonEC2FullAccess
IAMFullAccess
AmazonVPCFullAccess
AWSCloudFormationFullAccess
Second, Create a Cluster.yaml File
Properties:
OnDemandPercentageBaseCapacity: The minimum amount of the Auto Scaling group’s capacity that must be fulfilled by On-Demand Instances. The default value is 0, in this On-Demand Instances are launched as a percentage of the Auto Scaling group’s desired capacity as per onDemandPercentageAboveBaseCapacity setting.
OnDemandPercentageAboveBaseCapacity: Controls the percentages of On-Demand Instances and Spot Instances for your additional capacity beyond onDemandPercentageBaseCapacity. The range is 0–100. The default value is 100. Here, this property set to 50, the percentages are 50% for your additional capacity above base capacity.
vpc and subnets: If you don’t define these two properties, then AWS will automatically create vpc and subnets and assign them with their respective id’s.
attachPolicyARNs: Attaches the specified managed policy to the specified IAM role. Here, you will have to define custom policies along with managed policies because policies are explicitly defined, if you decide to leave it blank AWS will implicitly attach it’s own policies for creating an EKS Cluster.
Next, run this command to create EKS cluster using your yaml file: eksctl create cluster -f cluster.yaml
That’s it ! Your Production Grade EKS CLuster is ready. For eksctl documention, check the following link: https://eksctl.io/introduction/#getting-started/
To continue learning more about EKS, read this blog post on how to set up custom DNS routing on an EKS cluster.
Top comments (0)