?? Hybrid Multi Cloud Task-3??
Tushar Dighe
DevOps/Cloud Engineer | Kubernetes | GCP | AWS | Azure | Wiz | Databricks| Cycode | Security
INTEGRATION OF WORDPRESS RUNNING ON TOP OF KUBERNETES CLUSTER WITH AWS RDS.??
So, you might be thinking that what is AWS RDS and KUBERNETES ? ??
AWS RDS is a Relational Database Service by AWS. This service aims to simplify the setup and scaling of the database. Within a few minutes, we can create our full-fledged working database.
Kubernetes is an open-source platform that is used for managing Containerized services. In, short Kubernetes is Container-Orchestration tool.
In this article, we will be setting up a WordPress on the top of the K8S cluster and then we will we creating MariaDB DataBase on the top of AWS RDS and finally, we will be integrating the same. Also, we will be doing this with the help of terraform.
So, let’s start and first understand what we will be doing throughout this article step by step.
?? We will be writing an Infrastructure as code using Terraform, which automatically deploy the WordPress application
?? On AWS, we will use the RDS service for the relational database for the WordPress application.
?? We will deploy WordPress as a container on top of the Minikube cluster.
?? Also, The WordPress application will be accessible from the public world if deployed on AWS or through workstation if deployed on Minikube.
For this, there are some pre-requisite to be done before beginning this project.
- MINIKUBE SHOULD BE INSTALLED.
- SHOULD HAVE AWS ACCOUNT PRE CREATED.
- TERRAFORM SHOULD BE ALSO INSTALLED.
Now, let’s create this project step by step.
Step 1: In the first step, we will be launching WORDPRESS on the top of the MINIKUBE cluster by using TERRAFORM.
For this, we will be creating a file with extension .tf
Now, let’s write our code that will deploy WordPress.
In this file we will define the provider which is KUBERNETES in this case, Create deployment, define no of replicas so that our infrastructure never gets down, we will also specify an image that is WORDPRESS.
Step 2: Now, its time to launch a DATABASE in AWS using AWS RDS.
For this, we will be creating another file with .tf extension.
Here, we will define the provider name that is AWS in this case. Also, I am using the default profile and ap-south region that is the MUMBAI region. Storage type, engine type, version for database, etc will also be defined in this file.
Also, we will be defining USERNAME, PASSWORD, and DATABASE NAME.
FOR INITIALIZING COMMAND IS
terraform init
This command will download all the plugins required by our project.
Now, its time to run our code. To, the run command is
terraform apply --auto-approve
This command will deploy the whole resources within few minutes.
Lets check if everything is right or not.
YES!! DATABASE IS LAUNCHED IN AWS RDS.
ALSO, OUR KUBERNETES DEPLOYMENT IS READY.
kubectl get all
Now, just type
minikube service list
This command will give a list of all the services in K8S.
Just copy the URL and run this in any browser.
Finally, everything is right.
We had landed in FAMOUS FIVE MINUTES INSTALLATION.
After, selecting language another screen will popup in which we have to fill DATABASE NAME, USERNAME, PASSWORD, DATABASE HOST.
Here Database Host is the endpoint of RDS. For EndPoint, we will have to move into the AWS Console. This can also be viewed on the terminal only by using the output module of terraform.
Just copy the ENDPOINT and paste the same in the DATABASE HOST field.
GOOD TO GO!!
It’s CONNECTED!! JUST CHECK CURRENT ACTIVITY
Thanks for reading..................
HOPE THIS ARTICLE WILL BE HELPFUL!!
Upcoming Technology Analyst @Morgan-Stanley | MSIC'23 Winner | 4x Red Hat Certified Professional | VJTI IT'25
4 年Nice article brother ????