How to deploy a WordPress site with AWS RDS database on Kubernetes

Here my Task-6

Deploy the WordPress application on Kubernetes and AWS using terraform including the following steps:

Image for post
Image for post

1. Write an Infrastructure as code using Terraform, which automatically deploy the WordPress application

2. On AWS, use RDS service for the relational database for WordPress application.

3. Deploy WordPress as a container either on top of Minikube or EKS or Fargate service on AWS

4. The WordPress application should be accessible from the public world if deployed on AWS or through workstation if deployed on Minikube.

Now let’s start to deploying our WordPress site on Kubernetes with the integration of RDS service from AWS with the help of Minikube.

Step-1) Write an Infrastructure as code using Terraform, which automatically deploy the WordPress application

Now, in step-1 we are going to deploy WordPress site on Kubernetes using minikube. Minikube is a tool which helps to run the single-node Kubernetes cluster.

Image for post
Image for post
Image for post
Image for post

In the above image, as you can see we are using AWS resource, Kubernetes provider, and Kubernetes deployment resource.

Image for post
Image for post

In the above image, as you can see we are using kubernetes_Service resource. In this, we are using NodePort to expose our deployment and we are using type is CMS, and port should be 80.

Step-2) On AWS, use RDS service for the relational database for WordPress application.

Now we are going to create a database using RDS service.

Image for post
Image for post
Image for post
Image for post

Now run the command using terraform as shown in the below image.

Image for post
Image for post

Step-3) Now we successfully deployed WordPress as a container on the top of Minikube.

Now using minikube IP and node port we can easily launch a WordPress site.

Image for post
Image for post
Image for post
Image for post

Now the below image is shown WordPress.

Step-4) The WordPress application should be accessible from the public world if deployed on AWS or through workstation if deployed on Minikube.

We are using here minikube IP and NodePort to launch a WordPress site.

Image for post
Image for post
Image for post
Image for post
Image for post
Image for post

Thanks for reading my article.

Github Link: https://github.com/technicalej/HybridMulti-Cloud-Task-6

Written by

I am a Part-time blogger. Check my blog → technicalej.in

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