AWS

4 Mins Read

Build your Application using Amazon EKS

Voiced by Amazon Polly

Introduction

Amazon EKS (Elastic Kubernetes Service) has been used widely for running Kubernetes clusters on AWS. It is a managed service, so you don’t have to manage everything manually. When using Amazon EKS, AWS creates and manages control plane nodes for you and allows you to focus on your applications.

Maximize Performance and Minimize Throughput Costs with Amazon Dynamo DB

  • Developer friendly
  • Automatic backup and restore
  • Cost effective
Connect Today

Architecture

The following diagram depicts important components involved while using EKS.

The EKS control plane comprises the Kubernetes API server nodes, etcd cluster. Kubernetes API server nodes that run components like the API server, scheduler, and kube-controller-manager run in an auto-scaling group. EKS runs a minimum of two API server nodes in distinct Availability Zones (AZs) within in AWS region. Likewise, for durability, the etcd server nodes also run in an auto-scaling group that spans three AZs. EKS runs a NAT Gateway in each AZ, and API servers and etcd servers run in a private subnet. This architecture ensures that an event in a single AZ doesn’t affect the EKS cluster’s availability. An elastic data plane ensures that Kubernetes can scale and heal your applications automatically. A resilient data plane consists of two or more worker nodes, can grow and shrink with the workload, and automatically recover from failures. You have two choices for worker nodes with EKS: EC2 instances and Fargate. If you choose EC2 instances, you can manage the worker nodes yourself or use EKS managed node groups. You can have a cluster with a mix of managed, self-managed worker nodes, and Fargate.

Setting up your AWS Environment for EKS

1. Installing the AWS CLI.
The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. With just one tool to download and configure, you can control multiple AWS services from the command line and automate them through scripts.

2. Configuring AWS CLI Credentials using the access key ID and secret access key of the IAM user using the command ‘aws configure’.

3. Install kubectl.
Kubectl is a command line tool used to run commands against Kubernetes clusters. It does this by authenticating with the Master Node of your cluster and making API calls to do a variety of management actions. If you’re just getting started with Kubernetes, prepare to spend a lot of time with kubectl!

4. Configure kubectl for EKS.
Sample command:

Launch AWS EKS

5. Create cluster

A Kubernetes (K8s) cluster is a group of computing nodes, or worker machines, that run containerized applications. Containerization is a software deployment and runtime process that bundles an application’s code with all the files and libraries it needs to run on any infrastructure.

6. Install eksctl
Sample command:

eksctl is a simple CLI tool for creating and managing clusters on EKS – Amazon’s managed Kubernetes service for EC2. It is written in Go, uses CloudFormation, was created by Weaveworks and it welcomes contributions from the community.

 Launch Application

7. kubectl apply -f <path to the .yaml file of your application>

Sample yaml file — Run NGINX Containers using a YAML File

apiVersion: apps/v1

kind: Deployment

metadata:

name: nginx-deployment

spec:

replicas: 3

selector:

matchLabels:

app: nginx

template:

metadata:

labels:

app: nginx

spec:

containers:

– name: nginx-container

image: nginx:latest

ports:

– containerPort: 80 

Verify Application

8. kubectl get pods -n application1

Sample output

9. kubectl get svc -n application1

Sample output

Add Application Load Balancer

Once the application is up, one can additionally add load balancer using AWS Application Load Balancer. The steps involved

1. Download the IAM policy

2. Create the IAM Policy

3. Create IAM Role

4. Deploy Application Load Balancer controller

  • Add the helm repository

Sample Command:

  • Update the repository
  • Install the load balancer
  • Verify the installation

Conclusion

The step-by-step process helps in setting up all the entire end to end environment for launching your application using AWS EKS. The process starts with understanding the architecture, setting up the prerequisite, creating and configuring the cluster, launching the application and verifying the same. Additionally, one can make use of AWS Application Load balancer to serve as the single point of contact for the application.

Enable smarter efficient workflows through Amazon MLOps Eco-system

  • Improve speed
  • Reduce time
  • Zero downtime
Get Started

About CloudThat

CloudThat is a leading provider of Cloud Training and Consulting services with a global presence in India, the USA, Asia, Europe, and Africa. Specializing in AWS, Microsoft Azure, GCP, VMware, Databricks, and more, the company serves mid-market and enterprise clients, offering comprehensive expertise in Cloud Migration, Data Platforms, DevOps, IoT, AI/ML, and more.

CloudThat is the first Indian Company to win the prestigious Microsoft Partner 2024 Award and is recognized as a top-tier partner with AWS and Microsoft, including the prestigious ‘Think Big’ partner award from AWS and the Microsoft Superstars FY 2023 award in Asia & India. Having trained 650k+ professionals in 500+ cloud certifications and completed 300+ consulting projects globally, CloudThat is an official AWS Advanced Consulting Partner, Microsoft Gold Partner, AWS Training PartnerAWS Migration PartnerAWS Data and Analytics PartnerAWS DevOps Competency PartnerAWS GenAI Competency PartnerAmazon QuickSight Service Delivery PartnerAmazon EKS Service Delivery Partner AWS Microsoft Workload PartnersAmazon EC2 Service Delivery PartnerAmazon ECS Service Delivery PartnerAWS Glue Service Delivery PartnerAmazon Redshift Service Delivery PartnerAWS Control Tower Service Delivery PartnerAWS WAF Service Delivery Partner and many more.

To get started, go through our Consultancy page and Managed Services PackageCloudThat’s offerings.

WRITTEN BY Vivek Kumar

Share

Comments

    Click to Comment

Get The Most Out Of Us

Our support doesn't end here. We have monthly newsletters, study guides, practice questions, and more to assist you in upgrading your cloud career. Subscribe to get them all!