JOOMLA AND MYSQL SETUP ON AMAZON EKS
Introduction to Amazon EKS
Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernates 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.
EKS is the best place to run Kubernetes for several reasons. First, you can choose to run your EKS clusters using AWS Fargate, which is serverless compute for containers. Fargate removes the need to provision and manage servers, lets you specify and pay for resources per application, and improves security through application isolation by design. Second, EKS is deeply integrated with services such as Amazon CloudWatch, Auto Scaling Groups, AWS Identity and Access Management (IAM), and Amazon Virtual Private Cloud (VPC), providing you a seamless experience to monitor, scale, and load-balance your applications. Third, EKS integrates with AWS App Mesh and provides a Kubernetes native experience to consume service mesh features and bring rich observability, traffic controls and security features to applications.
How It Works
Introduction to Kubernates
Kubernetes is a portable, extensible, open-source platform for managing containerized workloads and services, that facilitates both declarative configuration and automation. It has a large, rapidly growing ecosystem. Kubernetes services, support, and tools are widely available.
What is Joomla?
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.
Goal:
- To create an EKS cluster using AWS
- Deploying Joomla and MySQL on EKS
- Using EFS for storage
Pre-requisite
- Amazon AWS Account
- AWS CLI
- EKSCTL
- Kubectl
These softwares have to be downloaded from the internet and need to set the path in environmental variable.
The whole process for completing the task is described below :
Step1: We have to create the AWS IAM user
Step2: Login to AWS console using the CLI
For this we first need to configure the credentials using the command :
#aws configure
Step3: Creating EKS cluster file with 2 node groups: ng-1 and ng-2. Here, the public key is also attached to access the nodes.
We have to create EKS-cluster using the below code:
Step 4: Login AWS from the command line with an already defined IAM role and then launching the cluster.
It will take approximately 10 to 12 minutes to launch the cluster.
Now it will create the cluster then we can check that instance, security group and cloudFormation creation from the webui also.
Step5: Now create a config file by using this config file we can access the EKS cluster from windows CLI.
Step 6: Setting up EFS for giving storage to the nodes created above in step 2. Here EFS is used instead of EBS because EFS allows you to mount the file system across multiple regions and instances whereas EBS is only accessible from a single EC2 instance in particular AWS region.
In AWS EFS service, same Shared Node Security Group is to be assigned as security group in EFS to all the availability zones in the same VPC where cluster nodes were launched.
Step7: Before going to the main file creation we have to install one software in all the nodes manually by going inside each EC2 instance
Step 8: Launching EFS-Provisioner, it allows you to mount EFS storage as Persistent Volumes in Kubernetes.
efs-provisioner.yml
Step 9: Creating ClusterRoleBinding to give access to the cluster created in a specific namespace.
role.yml
Step 10: Claiming Persistent Volume Storage from EFS for MySQL and Joomla.
storage.yml
Step 11: Launching Kubernetes Deployment of MySQL and Joomla.
mysql.yml
joomla.yml
All services launched:
Using External IP of Load Balancer in the browser, now we can access Joomla.
We have to delete the cluster using command:
GITHUB URL:
Thank you for reading!!