Wondering how to create multiple node groups for EKS worker nodes using eksctl? We can help you with this!
As a part of our AWS Support Services, we often receive similar requests from our AWS customers.
Today, let’s see the steps followed by our Support Techs to help our customers by using eksctl to create multiple node groups for EKS worker nodes.
Create multiple node groups for EKS worker nodes using eksctl
We can create a worker node group using eksctl with default parameters or with custom parameters using a configuration file.
With default parameters
Let’s see the steps to create a worker node group using eksctl with default parameters:
- Firstly, we need to install eksctl.
2. Then using the below command we can confirm that eksctl is installed on the terminal with the required permissions:
$ eksctl version
3. Now we shoul run the following command to create an additional worker node group with default parameters:
$ eksctl create nodegroup --cluster=yourClusterName --name=yourNodeGroupName --region yourRegionName
The default parameters are:
Instance type = m5.large
AMI : lastest AWS EKS AMI
Nodes-desired capacity = 2
Nodes-min capacity =2
Nodes-max capacity=2
New node groups inherit the version of Kubernetes installed, however we specify a different version of Kubernetes. Also run the –version=latest command for using the latest version of Kubernetes.
4. Now login to the AWS management console and open AWS CloudFormation console.
5. Then select the stack associated with the node group that we created.
6. Select the Events tab to see for an AWS CloudFormation event showing that our stack is deployed.
7. Now we should run the following command to confirm that the new worker node groups are attached to the cluster. Also, we can verify that the node group configuration is applied using the same command.
$ Kubectl get nodes
$ eksctl get nodegroups --cluster yourClusterName
With custom parameters
Let’s see the steps to create a worker node group using eksctl with custom parameters:
- Firstly, we must define the parameters for the new worker node group in a configuration file.
For example:
kind: ClusterConfig
apiVersion: eksctl.io/v1alpha5
metadata:
name: yourClusterName
region: yourRegionName
nodeGroups:
- name: ng1-Workers
availabilityZones: ["az-name"]
desiredCapacity: 3
instanceType: m5.large
iam:
instanceProfileARN: "arn:aws:iam::11111:instance-profile/eks-nodes-base-role" #Attaching IAM role
instanceRoleARN: "arn:aws:iam::1111:role/eks-nodes-base-role"
privateNetworking: true
securityGroups:
withShared: true
withLocal: true
attachIDs: ['sg-11111', 'sg-11112']
ssh:
publicKeyName: 'my-instance-key'
kubeletExtraConfig:
kubeReserved:
cpu: "300m"
memory: "300Mi"
ephemeral-storage: "1Gi"
kubeReservedCgroup: "/kube-reserved"
systemReserved:
cpu: "300m"
memory: "300Mi"
ephemeral-storage: "1Gi"
tags:
'environment': 'development'
- name: ng-2-builders #example of a nodegroup that uses 50% spot instances and 50% on demand instances:
minSize: 2
maxSize: 5
instancesDistribution:
maxPrice: 0.017
instanceTypes: ["t3.small", "t3.medium"] # At least two instance types should be specified
onDemandBaseCapacity: 0
onDemandPercentageAboveBaseCapacity: 50
spotInstancePools: 2
tags:
'environment': 'production'
2. Then run the following command to create an additional worker node group using the configuration file.
$ eksctl create nodegroup –config-file= yourConfigFileName
3. Now login to the AWS management console and open AWS CloudFormation console.
4. Then select the stack associated with the node group that we created.
5. Select the Events tab to see for an AWS CloudFormation event showing that our stack is deployed.
6. Now we should run the following command to confirm that the new worker node groups are attached to the cluster. Also, we can verify that the node group configuration is applied using the same command.
$ kubectl get nodes
$ eksctl get nodegroups --cluster yourClusterName
Now we can see that the worker nodes have joined the cluster.
[Need help with more AWS queries? We’d be happy to assist]
Conclusion
To conclude, today we discussed the steps followed by our Support Engineers to help our customers to create multiple node groups for EKS worker nodes using eksctl.
PREVENT YOUR SERVER FROM CRASHING!
Never again lose customers to poor server speed! Let us help you.
Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.
0 Comments