Integrating AWS and GCP to host a website.
Samarth Pant
Information Technology Analyst @ TCS | Contextual Master | OpenTofu | Terraform |
Hey folks, I recently created a project in which I integrated the GoogleKubernetes Engine(GKE) service offered by GCP and Relational Database Services(RDS) offered by AWS to host a WordPress website.
Steps followed for the project:
- Created a project in GCP called my-dev-project.
- Created a new VPC called 'vpc-devproject' in this project:
- Created a new firewall rule called 'myvpcfirewall' for allowing inbound traffic from outside world:
- Configured a Kubernetes Cluster in GKE service of GCP having following specifications:
- Name: samarth-k8s-cluster
- Region: asia-southeast-1
- Default Node Locations: asia-southeast-1-a, asia-southeast-1-b, asia-southeast-1-c.
- Nodes per-zone: 1
- Total Nodes:3
- Installed and configured GoogleCloud SDK for using GCP via local CMD. Then connected to the k8s cluster running on GCP via local CMD using the provided command.
- Created a deployment named 'mywp' using the WordPress image from DockerHub.
- By default the pods are not accessible by the outside world, we have to expose the pod. Used the Load Balancer service of GCP to expose the port 80 of WordPress pods so that we can use them by typing the IP in the browser.
- After the above command, a Load Balancer automatically gets created in the GCP as k8s uses the LB.
- Using the external IP of the Load Balancer to connect to our WordPress pods.
- For the backend Database, the RDS service of AWS is used:
- Entered the database details for setting the WordPress website.
- Now, WordPress is set up successfully and we enter our details and create login credentials.
- If the setup is done successfully, we can log in to our dashboard and post an article.
SIH Grand Finalist 2020 || MLops || ARTH Ambassador and Learner at LinuxWorld Informatics Pvt. Ltd
4 年Great work bro