AWS EKS Service for deploying Wordpress & MYSQL

Did your app or server fail due to limited resources on your system ? Did you fail deploying your own cluster in Kubernetes due to lot of management work and limited resources under your Lab?

Well here comes Amazon EKS service to your rescue. Amazon Elastic Kubernetes Service (Amazon EKS) is a fully managed Kubernetes service and It is one of the most trusted way to run Kubernetes due to its high security, reliability, and scalability.

There are a lot of benefits for using Amazon EKS like Serverless option, Security, Simplified management and many more. You can get more information on AWS EKS service from here.

Now in this blog i will be demonstrating how you can deploy your own Wordpress and MYSQL server database using EKS.
Note :- You can use any frontend and backend service as per your requirement.

There are some requirements mentioned below:
Necessary Requirements:

  1. Some basic knowledge of AWS Cloud Computing.
  2. Similarly basic knowledge of Kubernetes service along with yml coding.
  3. Knowledge of how to launch frontend and backend services.
  4. Some softwares like aws cli, kubectl, eksctl and add paths of all of them to your system environment variables.
  5. Optional :- Download my repo code from here if you want to follow along with me.

So here are the steps:

Step 1: Head over to your AWS account and create a new AWS IAM User with admin privileges.

Get your Acess Key and Secret Access Key and configure your AWS cli using

aws configure

Step 2: Create a Cluster file using yml code. You can get some help from here or you can get my repo from earlier and make some changes.

Step 3: Run following command to create a cluster. Cluster formation will take 15–20 min.

eksctl create cluster -f cluster.yml

After Cluster formation you can verify from AWS Console also

Step 4: Run below command to update or create kubectl configuration file which will allow us to contact to our cluster through kubectl command.

aws eks update-kubeconfig  --name mycluster

Step 5: Head back to your AWS console and create an EFS file system and attach VPC and Subnets created by our Cluster.
Note: While choosing subnets choose subnet which is used by your nodegroups.

Step 6: Create a namespace for isolated and more control over your work

kubectl config set-context --current --namespace=wordpress-mysql

Now you have to run 3 files which will run and make your EFS provisioned and availaible for cluster and storage.yaml will make make pvc for permanent storage for both Wordpress and MYSQL.

kubectl create -f efs-provisioner.yaml
kubectl create -f rbac.yaml
kubectl create -f storage.yaml

Step 7: Now create a secret which is more secure and enter a password which you would choose and later refer it to in deploy-wordpress.yaml & deploy-mysql.yaml

kubectl create secret generic mysql-pass --from-literal=password=mydb

Step 8: Now the final step is to deploy your MYSQL and Wordpress yaml files.

kubectl create -f deploy-wordpress.yaml
kubectl create -f deploy-mysql.yaml

You can get your Load Balancer IP from

kubectl get all

Then enter your IP in your browser and boom!. There comes your Wordpress setup page, fill them and now you will be landed to your Dashboard.

Feel free to create your WP site by customizing theme or whatever you want to do.

Now the most beautiful part is if you delete this pod, then also a new pod will be created with same data and same public IP.

If you want to delete your cluster use below command

eksctl delete cluster -f cluster.yml

and also delete your EFS system through AWS console.

Thanks all of you for reading. See you in next blog.




Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Ten tips for product owners on how to support daily standups

Why Julia Could Be The Data Science Language of The Future

Writing to AWS S3 from Spark

My intro to Google Go

Alphr Weekly Report #10

Setting up Nginx, Gunicorn, Celery, Redis, Supervisor, and Postgres with Django to run your Python…

Automate the Boring Stuff: MANIPULATING IMAGES

Azure Function App on Kubernetes with GitHub Actions and Argo Cd Series Part-I

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Apeksh Agarwal

Apeksh Agarwal

More from Medium

Monitoring AWS Batch

Building Kubernetes Admission Webhooks (Part 2 of 2)

How To Deploy NodeJS APIs on AWS EKS using HELM

Tricking Postgres into using an insane — but 200x faster — query plan