Skip to content

1.2 Setting Up EKS Cluster using AWS Console

deepak gupta edited this page Dec 2, 2021 · 2 revisions

In this Lab we will be creating EKS Cluster using AWS Console

AWS Prerequisites

  • IAM Users by programmatically and Console access.
  • IAM Roles for your services.
  • VPC, Availability zone, subnets & Security Groups.

IAM Resources

  1. Go to AWS IAM Dashboard and click on New User. Create a new user with programmatic access first.

  2. Go to AWS IAM Dashboard and click on Roles, and then click on Create Role

  • EKS Role: Choose from the services list: EKS, then, EKS Cluster for the use case, keeping name as EKSClusterPolicy.

  • Node Groups Role: For this service we need to choose an EC2 Service Role , keeping name EKSNodePolicy and assign the followings permissions:

     - AmazonEKSWorkerNodePolicy
     - AmazonEC2ContainerRegistryReadOnly
     - AmazonEKS_CNI_Policy
    

Each permission allows to EC2 instances create the node to communicate with AWS, pull images from ECR and Assign the right IP inside the VPC and subnet configuration.

  1. Assign these policies to the user, and proceed with that user in your AWS Account.

  2. Creating EKS Cluster and Nodes :

  • To start with this, let’s go to the EKS Dashboard, here.

  • Add Cluster and Create, If you haven’t created a cluster yet, you only have to type the name of your new cluster and assign the role we just created in the IAM Dashboard for EKS. This role will allow EKS to handle their master and worker nodes and Go Ahead.

  • Next, we need to assign all the network configurations and here we go with Default one. Last field is about the security group. We can choose the default security group.

  • We can leave all the default settings for the rest of the fields. Click on “Next” and finish the cluster creation.

  • Once the cluster has the label: “Active” we can go ahead to create the Node Group, which basically is a set of AWS EC2 Instances where the workers and pods will be located.

  • Creating the Node Group in EKS : To create the new Node group the cluster must have an “Active” status. Click on “Add new Node Group” and then, we’ll use the IAM Role we created for EKSNodePolicy

  • After this step, we can configure our EC2 Images in our cluster and some scalability options, we go with the default ones, and finally create our Node Group.

  • And once everything is up you can check the total cluster.

  • And to connect with your K8 cluster, can create one machine keeping as K8 Admin setup with AWS CLI and kubectl to manage your cluster and manage deployemnts.
$ aws eks --region <region> update-kubeconfig --name <nameof cluster>