Create the EKS cluster using the console / CLI
Then in the cloud shell run the following
aws eks update-kubeconfig --name {cluster_name} --region {aws_region}
Then create a Launch Template
After that, create an IAM role and security group for nodegroup
During the creation process, don’t choose any AMI, use instance type t3.medium ( or larger ) and use the Security group previously created.
After that, add the IAM role to the aws-auth config map. Commands are given below
curl -o aws-auth-cm.yaml https://s3.us-west-2.amazonaws.com/amazon-eks/cloudformation/2020-10-29/aws-auth-cm.yaml
Then edit the file and replace the rolearn with the IAM role arn
apiVersion: v1
kind: ConfigMap
metadata:
name: aws-auth
namespace: kube-system
data:
mapRoles: |
- rolearn: <ARN of instance role (not instance profile)>
username: system:node:{{EC2PrivateDNSName}}
groups:
- system:bootstrappers
- system:nodes
After that, run this command to apply.
kubectl apply -f aws-auth-cm.yaml
Then create nodegroup using the Launch Template.
If that is successful then you will see nodes running inside the EKS cluster.
Now you can deploy apps to the EKS via kubectl