How to Create an AWS EKS Cluster
History of EKS:
According to information made public by the Cloud Native Computing Foundation, AWS is the platform of choice for most companies running Kubernetes. Running hundreds of millions of containers on AWS, Kubernetes served as the IT strategy’s central component for these AWS customers.
Before EKS became widely accessible, AWS customers who run high-availability Kubernetes clusters required specialized knowledge and a lot of devoted cluster management time.
A K8s management infrastructure is required to be set up by organizations on various AZs. This complication is avoided with EKS by providing a production-ready architecture that, among other advantages, automatically runs and manages Kubernetes clusters across several AZs.
Why Do you need AWS EKS Cluster:
EKS provides an integrated console for Kubernetes clusters. Cluster operators and application developers can use EKS as a single place to organize, visualize, and troubleshoot your Kubernetes applications running on Amazon EKS. The EKS console is hosted by AWS and is available automatically for all EKS clusters.
How to create an EKS Cluster:
Many Cloud operators have fallen into this continuous loop where they don’t know what exact steps to take when creating an EKS cluster, what IAM Roles are, and what node groups are. This article will guide you in achieving this step by step.
Step 1: Create IAM Roles for the EKS Cluster and Node Group
Create EKS IAM Role:
- Navigate to the Roles tab in the Identity and Access Management (IAM) dashboard in the AWS Console
- Click Create role
- Select the type of trusted entity:
- Choose EKS as the use case
- Select EKS-Cluster
- Click Next: Permissions
4. Click Next: Tags
5. Click Next: Review
- Give the role a name, e.g. EKSClusterRole
6. Click Create role
You should see a message saying The role AWSServiceRoleForAmazonEKS has been created.
Create EKS Cluster Node Group:
- In the IAM Roles tab, click Create role
- Select the type of trusted entity:
- Choose EC2 as the use case
- Select EC2
- Click Next: Permissions
3. In Attach permissions policies, search for each of the following and check the box to the left of the policy to attach it to the role:
- AWS AmazonEC2ContainerRegistryReadOnly
- AmazonEKSWorkerNodePolicy
- AmazonEKS_CNI_Policy
4. Click Next: Tags
5. Click Next: Review
- Give the role a name, e.g. NodeRole
6. Click Create role
You should see a message saying The role AWSServiceRoleForAmazonEKSNodegroup has been created.
Step 2: Create an SSH Pair
- Navigate to the Key pairs tab in the EC2 Dashboard
- Click Create key pair
◦ Give the key pair a name, e.g. mysamplekey
◦ Select RSA and .pem - Click Create key pair
Step 3: Create an EKS Cluster
- Navigate to the Clusters tab in Amazon EKS dashboard in the AWS Console
- Click Create cluster
- Specify:
- a unique Name (e.g. MyFirstEKSCluster)
- Kubernetes Version (e.g. 1.21)
- Cluster Service Role (select the role you created above, e.g.EKSClusterRole)
4. Click Next
5. In Specify networking look for Cluster endpoint access, click the Public radio button
6. Click Next and Next
7. In Review and create, click Create
Step 4: Create a Node Group
- Click on the Compute tab in the newly-created cluster
- Click Add Node Group
- Specify:
◦ a unique Name (e.g. MyNodeGroup)
◦ Cluster Service Role (select the role you created above, e.g.NodeRole) - Create and specify SSH key for node group
- In Node Group compute configuration, set instance type to 8t3.micro and disk size to 4 (to minimize costs)
- In the Node Group scaling configuration, set the number of nodes to 2
- Click Next
- In Node Group network configuration, toggle on Configure SSH access to nodes
◦ Select the EC2 pair created above (e.g. mysamplekey)
◦ Select All
◦ Click Next - Review the configuration and click “Create”
Thank you for taking the time to read. I hope this helps you create your EKS Clusters.
if you have a comment or suggestion, or just want to discuss DevOps please feel free to reach out.