How to setup/create Kubernetes cluster?

How to setup/create AWS kubernetes cluster

So first we will understand about EKS.

What is EKS?
EKS is a managed or create kubernetes cluster service of AWS, which gives you the flexibility to start, run, and scale Kubernetes applications in the AWS cloud or on-premises. Amazon kubernetes cluster EKS helps you provide highly available and secure clusters and automates key tasks such as patching, node provisioning, and updates.

Lets talk about the process of “How to setup EKS cluster

Prerequisites:-

AWS Account with Admin Privileges
AWS CLI Access to use kubectl Utility
Instance(To manage cluster by using kubectl

We need to setup all these things:-
Create IAM Role for EKS cluster
Create Dedicated VPC for the EKS Cluster / Cloudformation Stack
Create EKS cluster
Install AWS kubectl
Configure AWS with credentials
Install & Setup AWS IAM-authenticator and Kubectl utility
Create IAM role for EKS Worker Nodes
Create Worker Nodes

######## Create IAM Role for EKS Cluster #####

1. go to IAM Management  section in AWS.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

2. click on Roles section and then click on create role.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

3.  Click on EKS service and then select “EKS -Cluster” use case, click on next:Permission.

amazon kubernetes cluster

4. click next-next define the name of the role and at last click on create role.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

### Create dedicated VPC for cluster via cloudformation ####

1. Select cloud-formation service in aws kubernetes cluster.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

2. Click on create stack, select template is ready, amazon kubernetes cluster S3 url and define this url.

https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2020-04-21/amazon-eks-vpc-private-subnets.yaml

3. click on next and define stack name.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

4. Click on next- next and create a stack, Now your stack is ready, you can also check the VPC is created or not in the VPC section.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

### create an EKS Cluster ####
1. Go to EKS section in aws kubernetes cluster and click on create EKS Cluster

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

2. Define the cluster name, select Kubernetes version, select cluster service role, which we had created recently and click on next.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

3. Select the VPC which we had created, select security group with the name of stack which we had created and select the cluster endpoint access as per the requirement.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

Now enable logs

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

Now click on create and after 5 to 10 mins your EKS cluster is ready.

#### Now setup of AWS CLI from where you want to access the cluster ####

Follow this link:- https://www.devopscheetah.com/how-to-install-aws-cli-on-linux/

#### Now install the kubectl utility #####

Follow this link: https://www.devopscheetah.com/installing-kubectl/

#### Now install the aws -iam-authenticator ####

Follow this link: https://docs.aws.amazon.com/eks/latest/userguide/install-aws-iam-authenticator.html

#### Now install the aws-auth-conf ####

Follow this link: https://docs.aws.amazon.com/eks/latest/userguide/add-user-role.html

#### Create I AM role for worker nodes ####

Attach these three policies or more as per the requirement.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

#### Create Worker node group ####

1. click on compute section in EKS cluster.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

2. Click on add node group,

define the group name,

 define IAM role which we had created,

select AMI type,

select Instance type,

Select disk size,

Node Group scaling configuration (Min Max Desired)

ssh Key Pair and Define security group

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

Now, Worker node group is created.

create kubernetes cluster, aws kubernetes cluster, amazon kubernetes cluster

Now, your EKS cluster is ready.

So today we learned “How to setup EKS Cluster”.

1 thought on “How to setup/create Kubernetes cluster?”

Leave a Reply

Your email address will not be published. Required fields are marked *