In this guide , I will show you how to setup EKS cluster using AWS Console

What is EKS?

Kubernetes is an open source system for deploying , scaling , automating and managing containerized applications.

EKS Stands for Elastic Kubernetes Service and it is fully managed by Amazon.

As It is a managed service , The Kubernetes control plane will be taken care by Amazon.

Amazon EKS can be spanned across Availability zones for high availability.

It has the ability to automatically find and replace the unhealthy nodes.

Services Integrated with EKS

Amazon EKS can be integrated with the following services which provides High availability , Security and Scalability for the Applications running in Kubernetes cluster.

  • Elastic Load balancing – Which will help to distribute loads
  • ECR – container images can be stored here.
  • IAM – To provide security to the cluster
  • VPC – Cluster can be isolated.

Also , Kubernetes can be able to automatically patch and update the EKS cluster.

How does EKS works?

  • Create an EKS cluster using AWS Console or using eksctl.
  • Register the worker nodes with the Kubernetes cluster.But AWS will automatically register the worker nodes while launching the cluster
  • Once the EKS cluster is successfully launched , We can setup kubectl to communicate with the cluster.
  • Then We can use kubectl or helm to deploy applications in the EKS cluster.

Creating Cluster using Console

To create an EKS cluster using AWS console , Login to EKS Console

Click Create cluster

First We need to configure the cluster.

Provide a name for the cluster , Which cant be edited after creation.

Choose the Latest Kubernetes version.

kubernetes cluster will manage the other AWS services , For that we need to provide a permission by creating an IAM role and using it as a Cluster Service Role during cluster creation.

We need to use following aws managed policies and then create the role and attach those policies.

AmazonEKSClusterPolicy , AmazonEKSServicePolicy.

To know more about creating Policies and Services , Check this article

kubernetes

And then click Next ,

Then Choose the VPC and the Subnets where the cluster should be created.

For Cluster Endpoint access , You can configure your cluster endpoint access to be Public , Private or Both.

kubernetes

and then click Next

if you want to configure Logging of EKS cluster components such as Audit , API server , Controller manager etc to Cloudwatch Loggroup you can enable it.

But make sure you add the necessary cloudwatch policy to the IAM role that is attached with the EKS cluster.

kubernetes
kubernetes

and then click Next

You can review the configuration of the EKS cluster , Add tags If required , and then click Create.

Once the cluster is created , We need to configure the kubeconfig for the cluster we have created using AWS CLI.

If you havn’t installed and configured AWS CLI , Refer this article

To create the kubeconfig using AWS CLI , Use the below command.

aws eks --region ap-south-1 update-kubeconfig --name test1

I have created a cluster with Name : test1 in the Region : ap-south-1 (Mumbai).

You will get a response as Added new context

Now that We have added EKS cluster to the kubeconfig in the local system.

Next , We need to install kubernetes client , kubectl to access the cluster using the kubeconfig we configured through AWS CLI.

To install kubectl use the below commands.

curl -o kubectl https://amazon-eks.s3.us-west-2.amazonaws.com/1.16.8/2020-04-16/bin/linux/amd64/kubectl
chmod +x ./kubectl

Then move it to the /usr/local/bin folder.By doing so , You dont need to type the full path to kubectl.

sudo mv ./kubectl /usr/local/bin/kubectl

Now If you run the below command ,

kubectl version

You will get the following response,

Client Version: version.Info{Major:"1", Minor:"16+"

Now that we have configured kubectl to access the cluster.

You can verify the configuration using the below command.

kubectl get svc

You will get the below response.

NAME         TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
kubernetes ClusterIP 10.100.0.1 443/TCP 16m

Before Adding Node group into the kubernetes cluster , We need to create an IAM Role with the below policies.

AmazonEKSWorkerNodePolicy , AmazonEKS_CNI_Policy , AmazonEC2ContainerRegistryReadOnly.

After you have created a Role with the above mentioned policies.

Adding Node Group

Go to EKS console , Select the Cluster , Under Compute , Click Add Node Group

For the Group Configuration , provide a name for the node group and then choose the IAM Role you have created.

Choose the subnets where the nodes should be created.

You can Enable or disable Remote access for the nodes within the cluster

Choose the Key pair and You can restrict access by using Security group and then click Next

On the Set compute configuration , Choose the AMI Type , Instance Type and the Disk Size.

For Setup scaling policies , You can specify Minimum , Maximum and Desired nodes to run within the Cluster.

And then Click Next , Review the configurations of the managed Node group and then Click Create.

Once the instances are ready. Go to the terminal and type

kubectl get nodes

We have succesfully Launched an EKS cluster and added nodes to the Cluster.

We can now deploy applications into the Kubernetes cluster.

Hope you found this helpful.

Please do check out my other articles.