Saturday, February 5, 2022

Create Amazon EKS cluster by eksctl | How to create EKS cluster in AWS cloud using eksctl | Create EKS Cluster in command line using IAM Role

What is Amazon EKS

Amazon EKS is a fully managed container orchestration service. EKS allows you to quickly deploy a production ready Kubernetes cluster in AWS, deploy and manage containerized applications more easily with a fully managed Kubernetes service.

EKS takes care of master node/control plane. We need to create worker nodes.

EKS cluster can be created in following ways:

1. AWS console
2. AWS CLI
3. eksctl command

We will create EKS cluster using eksctl command line tool.

Please watch steps in YouTube channel:

Pre-requisites:

This Lab is using Jenkins EC2 instance. Jenkins EC2 instance needs to have following configured:

Create IAM Role with Administrator Access

You need to create an IAM role with AdministratorAccess policy.
Go to AWS console, IAM, click on Roles. create a role


Select AWS services, Click EC2, Click on Next permissions.
 
 Now search for AdministratorAccess policy and click


Skip on create tag.
Now give a role name and create it.

Assign the role to EC2 instance
Go to AWS console, click on EC2, select EC2 instance, Choose Security.
Click on Modify IAM Role



Choose the role you have created from the dropdown.
Select the role and click on Apply.

Switch to Jenkins user
sudo su - jenkins

Create EKS Cluster with two worker nodes using eksctl

eksctl create cluster --name demo-eks --region us-east-1 --nodegroup-name my-nodes --node-type t3.small --managed --nodes 2 

the above command should create a EKS cluster in AWS, it might take 15 to 20 mins. The eksctl tool uses CloudFormation under the hood, creating one stack for the EKS master control plane and another stack for the worker nodes. 

eksctl get cluster --name demo-eks --region us-east-1

This should confirm that EKS cluster is up and running.

Update Kube config by entering below command:

aws eks update-kubeconfig --name demo-eks --region us-east-1

kubeconfig file be updated under /var/lib/jenkins/.kube folder.

you can view the kubeconfig file by entering the below command:

cat  /var/lib/jenkins/.kube/config

Connect to EKS cluster using kubectl commands

To view the list of worker nodes as part of EKS cluster.

kubectl get nodes

kubectl get ns

Deploy Nginx on a Kubernetes Cluster
Let us run some apps to make sure they are deployed to Kubernetes cluster. The below command will create deployment:

kubectl create deployment nginx --image=nginx


View Deployments
kubectl get deployments

Delete EKS Cluster using eksctl

eksctl delete cluster --name demo-eks --region us-east-1

the above command should delete the EKS cluster in AWS, it might take a few mins to clean up the cluster.

Errors during Cluster creation
If you are having issues when creating a cluster, try to delete the cluster by executing the below command and re-create it.

eksctl delete cluster --name demo-eks --region us-east-1


or Login to AWS console --> AWS Cloud formation --> delete the stack manually.

you can also delete the cluster under AWS console --> Elastic Kubernetes Service --> Clusters
Click on Delete cluster

DevOps BootCamp by Coach AK on AWS cloud and Azure Cloud Computing Online Classes | Mar 2024 Schedule

Are you in IT? Tired of your work? Are you not able to make any good progress in your career? 
Are you not having a job? Looking for a break in IT? Are you interested in learning DevOps? 
 
Did you get laid off from your previous job due to Covid-19
 
You are in the right place to kick start your career in DevOps. DevOps is one of the top and hot IT skills right now. Currently almost all the employers are struggling to get right resources in their teams who can do the DevOps and automation work..You could be that person by attending this coaching program.

DevOps Coaching Classes schedules for Mar 2024
Date Time Type When?
Mar 09th 09:45 AM CST to 11:25 AM CST on Saturdays
10:35 AM CST to 12:30 PM CST on Sundays    
Weekends Sat/Sundays
Mar 11th 6:00 to 8:00 PM CST Weekdays Mondays/Wednesdays    

DevOps Coaching Highlights:

- Comprehensive hands on knowledge on Git,  Jenkins, Maven, SonarQube, Nexus, Terraform, Ansible, Docker, Kubernetes, Prometheus, Docker registry, Helm,  AWS and Azure cloud platforms.

- Coach is having about 23+ yrs of professional IT experience, 9+ Yrs in DevOps/Cloud/Automation.

- Many students already got placed in reputed companies from this coaching program successfully.

- Working as a Sr.DevOps Coach/Architect in a one of the top IT services companies in USA.

- Unique program...less theory, more hands on lab exercises
 
Resume preparation will be done with candidates personally.

One-to-one Interview coaching.

- Coaching is purely hands on with 101% job relevant.

100% Job assistance.

- Coached about 1800+ students successfully for past five years and many of my students got placed with many large enterprises in DFW, Charlotte, Houston, Austin, Chicago, Florida, Seattle, Bay area, Ohio, NJ and NY areas.

To join DevOps Coaching classes, please contact Coach AK below:

Contact no # : +1(469)733-5248
WhatsApp #: +1 (469)733-5248
Email id: devops.coaching@gmail.com
Contact: Coach AK

DevSecOps Bootcamp Dec 2024 Schedule | DevSecOps & AWS Azure Cloud Coaching by Coach AK | DevSecOps and Cloud Computing Online Classes

Lot of new topics covered like GitHub Actions, GitHub Advanced Security, Helm, Prometheus and Grafana..) The DevOps requirements in the IT m...