Multi-Cloud Setup using WordPress on Kubernetes Platform & RDS on AWS.
We need to achieve following using Terraform :
Deploy the WordPress application on Kubernetes and AWS using terraform including the following steps;
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.
We’ll first Set up VPC, Subnet & Firewall in GCP
Subnet set up in GCP
Firewall Rule Set up
Now we’ll set up Google Container Engine — K8s Cluster
Next step is to set up Amazon RDS DB in AWS.
Amazon Relational Database Service (Amazon RDS) is a web service that makes it easier to set up, operate, and scale a relational database in the AWS Cloud. In this demo we’ll use MySQL DB engine & launch RDS instance in across 2 Availability zones.
We’ll create VPC, Subnets, Security Group & Internet Gateway first.
VPC Set up in AWS
Subnets in VPC
Internet Gateway Set up
Security Group for RDS DB
RDS DB instance launched successfully.
Now we need so create WordPress deployment and Load Balancer in GCP
We can also check services using kubectl commands as under
This will create the deployment and load balancer. In end, we can see the output in browser
Thus using Terraform, we have set up Multi Node cluster with Wordpress on Kubernetes & RDS DB in AWS