AWS + KUBERNATES = AMAZON E
Ankit Kumar
DevOps| Terraform | Linux |Azure | Azure DevOps | AWS | RH294( Ansible) | Python | Docker | Kubernetes | Grafana | ELK | Prometheus
Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service. Amazon EKS automatically detects and replaces unhealthy control plane instances, restarting them across the Availability Zones within the Region as needed. Amazon EKS leverages the architecture of AWS Regions in order to maintain high availability.
Joomla is a free and open-source content management system (CMS) for publishing web content, developed by Open Source Matters, Inc. It is built on a model–view–controller web application framework that can be used independently of the CMS.
MySQL is free and open-source software under the terms of the GNU General Public License and is also available under a variety of proprietary licenses. MySQL was owned and sponsored by the Swedish company MySQL AB, which was bought by Sun Microsystems (now Oracle Corporation).
OBJECTIVE OF TASK:-
1. At first, a multi-node EKS cluster is to be created on the top of AWS.
2.then, two services, namely Joomla and MySQL are to be launched in that multi-node cluster.
3. Both services will be getting persistent storage from the EFS service of AWS.
4. Joomla service is to be exposed to the public world using the Load Balancer (ELB) service of AWS.
STEPS FOLLOWED IN COMPLETION OF THE TASK :-
STEP 1:The very first step is to create an IAM user in your AWS account. The IAM user must have administrative permissions. A key is to be generated using which we can log in into this IAM account. The next step is to log in to the IAM account using CLI. For this, “aws” command is required.
The command to login is: “aws configure”
STEP 2 :Now after logging into the account we create the cluster ,for that first we download the eksctl command from the internet and add it into our path.The next step is to configure the “eksctl” command in your local system so that we can use the EKS service of AWS more efficiently.
STEP 3: for launching cluster first we have to configure it using YAML file.
In this cluster, I am going to launch three Node Groups and one of the node groups will be launched as a spot instance. I have also attached a public key to all the nodes in order to login to the nodes.
The cluster will be launched in the ap-south-1 (Mumbai) region.
Now for creating the cluster we use the command
$ eksctl create cluster -f cluster.yml
hence the cluster has been created.
after cluster get created some services and resources launched in aws by cluster.
RESOURCES LAUNCHED BY EKS CLUSTER IN AWS:-
SERVICES LAUNCHED IN VPS BY EKS CLUSTER :-
INSTANCES LAUNCHED:-
STEP 3: The next step is to configure the kubectl command in the local system in order to contact the cluster.
Then we have to update the “config” file so that kubectl can contact the master node of the EKS cluster.
updated kube config file:-
general information of the resources running in the cluster:
STEP 4: create a separate namespace to launch resources in the cluster.
The newly created namespace is to be set as the default namespace:
The information of the cluster is:
STEP 5: we need to launch an EFS service to give storage to our pods. And we have to launch the EFS in the same security group in which the nodes are launched. The EFS will be launched in the same VPC where the cluster has been launched. Else, there will be no connectivity between the EFS and the pods.
And hence, the EFS has been launched:
Now, in order to give the EFS storage to the pods, we need to download the “amazon-efs-utils” program on all the slave nodes.
STEP 6: next step to download the amazon-efs-program on all the nodes.
STEP 7:Now, the main process starts where I am going to launch Joomla and MySQL services on the top of the cluster. For this, numerous different resources and services are to be configured such as secret, efs-provisioner, role binding, PVC, deployment, etc.
I have configured everything using the YAML files of the respective services/resources. Here are all those files:
YAML file for EFS-Provisioner:
creating storage class:
Now creating the mysqldeployment.yaml file. The file service, PVC and Deployment. Deployment consists of the replicaset, container specifications and image details. The PVC will create a request for a persistent volume of size 10GiB. This persistent volume uses EFS to store the data. The volume is mounted to the /var/lib/mysql folder since it stores all the data.
After creating the file for database, we shall now create the joomla.yaml file.
In this file we have created the code for setting up the Joomla app on our one of the clusters. In this Service acts as a loadbalancer and exposes the setup to the outside world ,rest is the same as the mysql server file.
Now creating YAML.file for Role-Binding:
Now created secret key YAML.file where mysql database password are stored.
LIST OF YAML.FILES CREATED
STEP 8: launched all the resources and services using the above YAML files.
command use to launch the service:
kubectl create -f
All the resources and services have been successfully launched:
STEP 9: Creating the load balancer.The Load Balancer service in the EKS cluster is launched using the ELB (Elastic Load Balancer) service of the AWS:
And the Joomla service has been successfully launched on the multi-node EKS cluster:
And finally the goal of making this task has been acheived. The final objective of task been completed by launching joomla on pod.
HAVE A GOOD DAY........
THANKYOU........
Github link: https://github.com/ankiiitt/EKS---TASK-