AWS Elastic Kubernetes Service
AWS Elastic Kubernetes Service

AWS Elastic Kubernetes Service

Hello Techies, This is article explain the task which I have completed on AWS EKS from the knowledge that I have gained in two days of technical session on AWS EKS organized by Linux World Informatics Pvt Ltd

Before starting we need to understand some important terms like:

What is AWS Elastic Kubernetes Service?

Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service. Customers such as Intel, Snap, Intuit, GoDaddy, and Autodesk trust EKS to run their most sensitive and mission critical applications because of its security, reliability, and scalability.

What is Kubernetes?

Kubernetes (K8s) is an open-source system for automating deployment, scaling, and management of containerized applications. It groups containers that make up an application into logical units for easy management and discovery.

How it works?

No alt text provided for this image

Requirements to be install to use the EKS on your device:

  • aws cli :- AWS Command Line Interface (AWS CLI) is an open source tool that enables you to interact with AWS services using commands in your command-line shell
  • eksctl :- eksctl is a simple CLI tool for creating clusters on EKS - Amazon's new managed Kubernetes service for EC2. It is written in Go, uses CloudFormation, was created by Weaveworks and it welcomes contributions from the community.
  • kubectl :- The kubectl command line tool lets you control Kubernetes clusters.

Note:- After installing these softwares, add these command in environment variables so that it is easily accessible for any using cmd prompt.

Till here we have sufficient knowledge about these terms. Now time to understand the task that I have performed.

I have created one cluster on AWS using the eksctl command which has some nodes in form of EC2 instance are running. These instances are slaves nodes which perform the jobs assigned by the master node which is Kubernetes here. Here we are using kubectl command to manage and monitor our nodes and the services running on these nodes locally on our system but the main management is done by EKS as it is managed by Kubernetes.

I have done these things because I want to host one blogging website which is available for the users on internet. Here I have hosted Joomla with MySQL where Joomla acts as a frontend and to store the users data, MySQL which provides the database support.

So I have given overview of task. Now its time to try it practically.

No alt text provided for this image

First we need to create a new user and configure our aws cli for this newly created user. For this follow these steps:

No alt text provided for this image

Provide the user credential and don't forget to select the access type with both option selected

No alt text provided for this image

Providing the Adminstrator power to the user so that user can manage everything

No alt text provided for this image
No alt text provided for this image

Finally user created. Now download the csv file which has access keys need to configure aws cli.

Configure AWS Cli:

Open your cmd and type "aws configure" and then provide the details from the csv file downloaded above.

No alt text provided for this image

Till here our cmd pormpt is ready for running the aws, eksctl and kubectl commands.

Time to launch the eks cluster..........

Here I have created a yaml file for creating the cluster.

No alt text provided for this image

Launching the cluster:

No alt text provided for this image
No alt text provided for this image

Now go to AWS WebUi and check for cluster in EKS. You will get like this

No alt text provided for this image
No alt text provided for this image

or use command in cmd prompt

eksctl get cluster

Update the cluster configuration in kubeconfig file so that kubectl handle the cluster

No alt text provided for this image

Till here our cluster is created. Now its time to make a secure storage using EFS service.

Steps: Go to AWS WEBUi console and search for EFS then click on create provide the VPC name, attach the security groups and our EFS is ready to use.

No alt text provided for this image
No alt text provided for this image

Note: Add the File system name and DNS to the efs-porivisoner.yaml file so that it will available for the instances.

Now login to the each EC2 terminal using the SSh from connect option and install one software so that EFS is enabled for instances.

sudo su -

No alt text provided for this image
yum install amazon-efs-utils -y

after sometime software will be installed

No alt text provided for this image

Now till here our cluster and file-system is ready. We can found the below mentioned changes done in our AWS.

  • VPC created.
No alt text provided for this image
  • Subnets created.
No alt text provided for this image
  • Routing Table created.
No alt text provided for this image
  • Internet Gateway created.
No alt text provided for this image
  • Nat Gateway created
No alt text provided for this image
  • Elastic IP created
No alt text provided for this image
  • Instances created
No alt text provided for this image
  • LoadBalancer created
No alt text provided for this image
  • CloudFormation created
No alt text provided for this image

Now till here our basic requirements to launch the Joomla-MySQL is done.

Finally time to launch the Joomla and MySQL servers. Here I am launching these using Kustomization.yaml file which can launch the entire setup in one go.

This Kustomization.yaml file contains:

No alt text provided for this image

Note: All these files are available in my GitHub profile click here to see.

Description of files:

  • efs-provisioner.yaml : provision the efs for instances
  • rbac.yaml : it will do role binding
  • storage.yaml : it will create a storage class and pvc for joomla and mysql
  • mysql.yaml : it will create a deployment for MySQL which has pvc and service as ClusterIP
  • joomla.yaml : it will create a deployment for Joomla which has pvc and service as LoadBalancer

to launch this file use this command:

No alt text provided for this image

After this wait for some time and the run this command to check pods status :

kubectl get pods

No alt text provided for this image

Now all our service is running fine now time to open our Joomla UI. For this use the public Ip provided by aws for running instance.

Copy the url and search it on browser and if everything works fine we will land to this beautiful UI.

No alt text provided for this image

Fill the details and credentials to create a new site

No alt text provided for this image

Provided the credentinals for database connectivity.

No alt text provided for this image
No alt text provided for this image

Overview of details filled

No alt text provided for this image

Here comes the desired page. Congratulations! Joomla! is now installed and ready to use.

Now I have created a testing Blogpost for AWS EKS.

No alt text provided for this image
No alt text provided for this image

Now for MySQL:

No alt text provided for this image

I have gone inside to one of the running mysql pods and login into the database.

No alt text provided for this image

Database created!!!!

No alt text provided for this image

Tables created.

After all these practical step we come to the end of this task. Objective achieved!!!!

We have successfully launched the Joomla-MySQL server and it is open to use for everyone.

I am very grateful to my mentor and trainer for this knowledgeable training "Mr. Vimal Daga" the person who teaches me such a great concept and I am very happy after completing such a great task which has lots of great and powerful knowledge.

For the yaml files visit to my GitHub profile:

Thank you very much for reading this article pls share the same if you find my work worthy!!!!



Mohammed Hamza

Research Student at ETS | University of Quebec | Federated Learning | Blockchain | Smart Contract

4 年

Congratulations!!!

回复

要查看或添加评论,请登录

Manish Verma的更多文章

社区洞察

其他会员也浏览了