
EKS — Elastic Kubernetes Service
Amazon EKS is a managed service that helps make it easier to run Kubernetes on AWS. Through EKS, organizations can run Kubernetes without installing and operating a Kubernetes control plane or worker nodes. Simply put, EKS is a managed containers-as-a-service (CaaS) that drastically simplifies Kubernetes deployment on AWS.
To understand Amazon EKS better, let’s take a step back. Here’s a quick overview of Kubernetes.
Kubernetes is an open-source system that allows organizations to deploy and manage containerized applications like platforms as a service (PaaS), batch processing workers, and microservices in the cloud at scale. Through an abstraction layer created on top of a group of hosts, development teams can let Kubernetes manage a host of functions — including load balancing, monitoring and controlling resource consumption by team or application, limiting resource consumption and leveraging additional resources from new hosts added to a cluster, and other workflows.
Through Amazon EKS, organizations using AWS can get the full functions of Kubernetes without having to install or manage Kubernetes itself.
Why we use EKS ?
With Amazon EKS, the Kubernetes control plane — including the backend persistence layer and the API servers — is provisioned and scaled across various AWS availability zones, resulting in high availability and eliminating a single point of failure. Unhealthy control plane nodes are detected and replaced, and patching is provided for the control plane. The result is a resilient AWS-managed Kubernetes cluster that can withstand even the loss of an availability zone.
Now coming to the Real Life Use case …
→ Create EKS Cluster using eksctl command …
→ Launch Wordpress and MySQL containers on the top of EKS … So that we can manage the things in easier way ..
→Create one File system , So that we can obtain persistent storage from AWS
→Both Wordpress and MySQL containers are going to use EFS from AWS …(Integrate EFS with EKS )..So that if any pod goes down , the storage is remains safe in File system …
Same scenario used by many banks … Assume , the Wordpress is a bank official Website and MySQL Database is the Database for Bank Details … Now I am going to deploy ….
Step 1: Create EKS Cluster using eksctl command …
Created Cluster with Nodegroups ng1 and ng-mmixed .. ng1 is the normal t2.micro instance and ng-mixed is the spot instance …. Also attached keypair to Nodegroups for the purpose of future use …
I used below yml file to create Cluster on EKS …



Successfully Created Cluster …
Checking whether cluster is created or not using eksctl command …

Also check using webUI …


Step 2: Before launching the Wordpress and MySQL Containers .. Create File System for persistent storage ..

Create File system in same region where ur Cluster has been deployed ,,.. And select the Security group that has been created by cluster for all Node Groups … U can find it in the EC2 →Security Groups …
Step 3: To get Storage from EFS , we need EFS provisioner for that … Created provisioner for EFS using yml code ..

Note:
FILE_SYSTEM_ID → ur File System id
server : ur DNS name of File System …
region : Enter the region where u created EFS and Cluster ..
After creating the efs-provisioner , we have to give extra permissions for security purpose .. Here is the rbac.yml file for ClusterRoleBinding and Security purpose ..

Create a namespace using kubectl cmd .. So there will be no conflicts in future …
Cmd for creating namespace : kubectl create ns <name>

Step 4: Now create a seperate Storage class and also create PVC for Wordpress and MySQL containers … Here is the yml code …

Step 5: Now the final thing we need to do is deploy the containers …
Here is the yml code for deploying wordpress and mysql containers …
Code has been uploaded to github.com ← Code
while creating containers also create expose the Deployment to outer world ..
Now Coding part is done .. Now its time to deploy the containers …
I used Kustomization file for automatation purpose …Here is the code kustomization.yml …

Now run the kustomization file in the namespace eksns using the cmd
cmd: “kubectl create -k . -n eksns ”

The EFS won’t attached to amazon linux … So that we need to install amazon-efs-utils in all the nodegroups using yum command …
Note : Install amazon-efs-utils in all NodeGroups …

After installing ur NodeGroups are connected to File System …
U can check whether all resources are running or not using
cmd: “kubectl get all -n eksns”

All resources are created and Successfully running …
Now copy the external IP of wordpress and paste it into ur browser ..



If wordpress or mysql pod unfortunately deleted , Our data won’t lose coz of File System we created …
Finally done with the task … Here is the Github Link
Thanks for reading …
…. Signing off ….