Launching Content Management System(Joomla) using AWS-EKS

Joomla + AWS-EKS

AWS-EKS(Elastic Kubernetes Service) is a powerful Kubernetes management infrastructure that helps make it easier to run Kubernetes on AWS.

Joomla is a free and open-source content management system 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

First of all, we required an EKS cluster for deploying our project. So, let's start with creating the EKS cluster.

Creating an EKS cluster:

We will create a file named cluster1.yml which has all of the code required to create the EKS cluster. In this cluster, we will create three nodes(slaves) of the t2.micro instance. Adding ssh key so that later we can log in to these nodes for the management.

cluster1.yml

Run this command to run this file:

$ eksctl create cluster -f cluster1.yml
Create an EKS cluster
EKS cluster is created

Now, the EKS cluster is created successfully.

Configuring kubectl command:

After that, we required to configure the kubectl command for the launched cluster(in my case cluster name is mycluster).

$ aws eks update-kubeconfig --name mycluster
Configure kubectl command

Now, we required to install Amazon EFS Utilities on every node in the cluster using the following command:

$ yum install amazon-efs-utils

Create a namespace for our project:

Let’s create a namespace named webns where we will create all of our project deployments.

$ kubectl create namespace webns
Create namespace

Create an EFS storage:

We have to store the data and configurations of our project permanently. For this purpose, AWS provides us one scalable and elastic storage known as EFS.

Create an EFS storage from the AWS console and make sure to attach the correct security group as that of the EKS cluster.

Create EFS storage
Create EFS storage
EFS storage is created

EFS storage is created!

Create an EFS provisioner:

After that, we have to create EFS provisioner so that the EFS storage can be used by the resources in the EKS cluster.

The code for creating an EFS provisioner is written in a create-efs-provisioner.yaml file. Just replace the EFS file system ID at line no. 22 and replace the nfs server at line no. 33 with the values of your EFS file system.

create-efs-provisioner.yaml

Run the create-efs-provisioner.yaml file in a webns namespace to create an EFS provisioner.

$ kubectl create -f create-efs-provisioner.yaml -n webns

Create RBAC:

Now, we required to create Role-Based access control(RBAC). We are giving the role as cluster admin.

create-rbac.yaml

This can be done by running the create-rbac.yaml file in webns namespace.

$ kubectl create -f create-rbac.yaml -n webns

Create Storage Class, PVC for Joomla and PVC for MySQL:

We are creating the storage class and taking the storage from EFS storage we had created earlier.

create-storage.yaml

Run the create-storage.yaml file to create the Storage Class, PVC for Joomla, and PVC for MySQL.

$ kubectl create -f create-storage.yaml -n webns
Create EFS provisioner, RBAC, and storage

Now, all of the resources required to run our Content Management System(Joomla) are created.

As a final step, we required to create the MySQL database and launch the Joomla.

Create a deploy-mysql.yaml file that contains all of the configurations to deploy the MySQL database.

deploy-mysql.yaml

Create a deploy-joomla.yaml file that contains all of the configurations to deploy the Joomla site.

deploy-joomla.yaml

Finally, we will create kustomization.yaml file that contains the sequence to launch the MySQL and Joomla configuration files. Also, this file will create secrets for us.

kustomization.yaml

Run this file to deploy the MySQL and Joomla site on the EKS cluster.

$ kubectl create -k .
kubectl create -k .

Check if all of the resources get launched.

$ kubectl get all
kubectl get all

As we can see in the above picture, all of our resources are launched and all of the pods are up and running.

Access the launched site:

To access the launched site open the EXTERNAL-IP provided by the service/joomla in the browser to view the deployed joomla site.

Joomla site is launched

Do the installation.

Joomla site installation

And finally, our Joomla Content Management System is successfully launched using the EKS cluster.

The configuration files for this project are available at:

You can follow the same steps to launch either WordPress or Drupal on the AWS-EKS.

That’s it for this Article. I hope you had learned how to launch the website on the AWS-EKS cluster.

If you liked this article, please applaud it.

You can also follow me on Twitter at @cankush625 or find me on LinkedIn.

Tech blogger, researcher and integrator