DEPLOYING WORDPRESS USIND AWS RDS AND KUBERNATES

Hey, guys hope you all are doing well today's article gonna be super fun and you can use it for your use as the heading suggests today we are going to deploy a WordPress website on Kubernetes and a database will be AWS RDS sounds interesting right ??

Let’s start with the process of deployment here I am assuming you have set k8s in your system I am using Kubernetes on minikube you can use aws eks also as discussed in the previous article if not seen click here.

First, let’s start with deploying WordPress on Kubernetes using terraform here I am using a minikube cluster.

Step1 start minikube cluster

After this is done I have written terraform code fr running local cmnd in our prompt using null resource u can grab code from git hub repo that I attach in the last fetch code from that and move in the directory and after this first cmnd, u have to run terraform init(to install all the required resource) after this you have to run terraform plan to see what’s going to deploy and at last terraform apply which will deploy all the things.

Once this is done two more commands we have to run one to get minkube IP(to get minkube IP) and kubectl get svc to get ports where our service is deployed.

Once you get this just go to the IP and u see the below type of screen

Once complete till here it's time to set a database because we need database name, username, password, and host etc.

Let’s start the process of setting rds in aws here I have used terraform for deploying rds terraform code I will be putting in my GitHub repo that you can find at the end of the article. Clone the git repo and open the folder and go to cmnd prompt run all three cmnd we discuss above while setting WordPress on Kubernetes.

This gonna be taking time for deploying rds on aws in terraform code one thing you have to remember this line which I highlighted in the below pic.

They contain DB username, name, port, and password so set accordingly. Once deployment is done go to aws console.

In the above image you can see info creating means it is creating once it is done you can see the domain name in the endpoint that is what your host.

Once this is created now we create one ec2 instance from which we can see the database and table in DB.

Please see the above image carefully in that I have used some command of MySQL to connect remotely from instance.

Once you create databases inside DB then move to the WordPress site and fill in the required information.

Once all this is done we all are ready to go.

Here above you can see our site is deployed successfully.

Now if you want to destroy use terraform destroy

Github Link:-https://github.com/guptaadi123/WP-RDS

Guys, here we come to the end of this blog I hope you all like it and found it informative. If have any query feel free to reach me :)

Guys follow me for such amazing blogs and if have any review then please let me know I will keep those points in my mind next time while writing blogs. If want to read more such blog to know more about me here is my website link https://sites.google.com/view/adityvgupta/home.Guys Please do not hesitate to keep 👏👏👏👏👏 for it (An Open Secret: You can clap up to 50 times for a post, and the best part is, it wouldn’t cost you anything), also feel free to share it across. This really means a lot to me.

--

--

--

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

Recommended from Medium

| Engineering News-Record

asobuがGlobal Game Jam 2021を開催!- asobu is hosting Global Game Jam 2021

Sukhavati Network Monthly Update — May 2022

Aleo has made a big step for the development of its ecosystem.

Manage the marbles with Dagger Producers

How To Unlock Boost Mobile APN Settings Android (4G) New?

How To Unlock Boost Mobile APN Settings Android (4G) New?

Building of Discord

What to do between changes and runtime

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
Gupta Aditya

Gupta Aditya

More from Medium

Composing AWS Systems Manager configurations with Terraform — Part 1

How to deploy an Amazon EKS cluster using Terraform

Access Db credentials from Aws secret and rotate password using AWS lambda

Expose internal API to an external client using AWS API Gateway and mTLS