Deploying WordPress on Google Cloud Platform by integrating various GCP services..
Hello Readers! This is my Google Cloud Platform task by integrating all those things which I've learnt in my two days of GCP workshop.
TASK DESCRIPTION :
I have created a set-up in which various services of GCP like VPC networking, Kubernetes, SQL, etc has been integrated. So here are the steps which needs to be incorporated :
- Create multiple projects namely a Developer project and a Production project.
- Create VPC network for both the projects.
- Create a link between both the VPC networks using VPC Peering.
- Create a Kubernetes Cluster in developer project and launch any web application .with the Load Balancer.
- Create a SQL server in the production project and create a database.
- Connect the SQL database to the web application launched in the Kubernetes cluster.
- Then finally install WordPress in one VPC using running database in other PC.
######################################################################
HERE WE BEGIN WITH OUR TASK...
Step-1: Project Creation -
Two new projects, 'DevProject' and 'ProdProject' are being created. A project consists of a set of users, a set of APIs and billing, authentication, and monitoring settings for those APIs.
Step-2: VPC Creation -
For creation of VPC, we need to first go to the Networking section and choose 'VPC network' . After that fill up all the details.
VPC in DevProject: I've created a VPC named 'dev' in 'asia-southeast1' (Singapore) region with an IP address range of '10.0.1.0/24' .
VPC in ProdProject: Then I created another VPC named 'prod' in 'us-east1' (US) region with an IP address range of '10.0.2.0/24' .
Step-3: VPC Peering -
VPC Network Peering in Google Cloud allows internal IP address connectivity across two Virtual Private Cloud (VPC) networks regardless of whether they belong to the same project or not.
VPC peering in ProdProject:
Currently it is 'inactive', but as soon as VPC peering will create in other region it will get activated automatically.
VPC peering in DevProject:
It is 'active' now.
Step-4: Launching Kubernetes Cluster for WordPress in DevProject -
Google Kubernetes Engine (GKE) provides a managed environment for deploying, managing, and scaling our containerized applications using Google infrastructure.
Creation of Cluster in DevProject :
- Creating cluster using WebUI.
Kubernetes cluster is now launched in our DevProject.
- Now we configure this cluster using CLI from our baseOS. For this we first installed 'gcloud SDK' and then 'kubectl.exe'.
- Now, launching 'WordPress' image on the top of this Kubernetes cluster.
- Creating a LOAD BALANCER.
Load Balancer is successfully created.
Step-5: Creation of SQL server in ProdProject:
For the instance creation, we need to go to the SQL option in the Storage and then follow the following steps:
- Create the SQL instance using WebUI.
- Create MySQL instance.
Here, MySQL Database is created.
- Add a User to that database,
- Do the Connectivity setting of the instance as public.
- Now, we can access the Database here in Cloud Shell.
- MySQL commands to create database:
Database is successfully created.
Step-6: Installation of WordPress and attaching Database :
Now, login to WordPress site:-
WordPress site is launched successfully.
As soon as we connect your database to WordPress site, our database will automatically get updated :-
######################################################################
Here I successfully launched my first WordPress site on Google Cloud Platform with Kubernetes integration.
This completes my GCP task given by Vimal sir!!!
***** THANK YOU FOR READING!! *****
Feedback and suggestions are most welcome.
FX Technology Analyst | CFA L1 Passed | Comp Sc @TIET’23
4 年Great work khushi??
Flutter Developer at Siya Tech Ventures
4 年Great work ??
Front-End Engineer|JavaScript|React|Redux|TIET'23|Amazon MLSS'22|Pre-Finalist Amazon Hackon S2|Mentor at IETE Students' Forum|4??at CodeChef
4 年Great Khushi Garg
EX - Amazonian | ECS SME | EX- TCSer | CKA Certified | AWS SAA-certified, AZ-900 & DP-900 certified
4 年Superb Khushi Garg