Deployment of WordPress Application in Google Cloud Platform along with Kubernetes Clusters and SQL Database
!! Hello Connections !!
Welcome you to my project which is based on Google Cloud Platform with Kubernetes.
PROJECT DESCRIPTION :
1. Create multi projects with dev and prod.
2. Create VPC network for dev project.
3.Create VPC network for prod project.
4. Connect both the VPC network with VPC peering.
5. Create a Kubernetes Cluster in dev project and launch a wordpress application with the Load balancer.
6. Create a SQL server in prod project and create a database.
7. Connect the SQL database with the application launched in the Kubernetes cluster.
Before I start we introduce some terms which are as follow:
1.Virtual Private Cloud (VPC):
A virtual private cloud (VPC) is an on-demand configurable pool of shared computing resources allocated within a public cloud environment, providing a certain level of isolation between the different organizations using the resources.
2. VPC Peering:
VPC Network Peering enables you to connect VPC networks so that workloads in different VPC networks can communicate internally.
3.Kubernetes:
Kubernetes is open-source system for automating deployment,scaling and management of containerized application.
So that was all about introduction.
Let's start to project ⏩
1) For building of any kind of Infrastructure in GCP we need one project. So I created two projects named as developer and production.
2) Under these project we have to create two VPC ( Virtual Private Cloud ) one for WordPress deployment and second for MySQL Database Instance in different regions. I have created one VPC in asia-southeast1 i.e.Singapore in developer project and one VPC in asia-southeast2 i.e. Jakarta.
-->VPC in developer project
-->VPC in production project
One more thing which we want to do that is attaching Firewall Rule for allow all traffic coming in VPC .
--> Firewall rule in developer project
--> Firewall rule in production project
3) For connecting these VPC we have to use VPC peering. For this we have to create VPC peer for both VPC's. I created two peer with name dev-vpc in developer project and prod-vpc in production project.
-->dev-vpc in developer project
Recommended by LinkedIn
-->prod-vpc in production project
As we see both peer have active status i.e. both have successful VPC peering.
4) Now we have to create one kubernetes cluser using Kubernetes Engine service provided by GCP for deployment of WordPress application.
-->Kubernetes Cluster in developer project
5)For deploying the WordPress application in kubernetes cluster we have to contact with Google Kubernetes Engine .As to communicate with kubernetes master which send further task to its slave nodes we require kubectl program to be configured in our system .
In these case we are using Google Cloud Platform which provides us Kubernetes As A Service using Google Kubernetes Engine and for these we have to contact to GCP from our system .For these we have to install Google Cloud SDK Shell Program in our system which provides us all the GCP respective commands to use Google Cloud .
6)To deploy the WordPress application using kubernetes we have to create deployment in kubernetes which using WordPress image for launching the pods .
After creating the kubernetes deployment we have to launch the WordPress application on internet.Here we also require one load balancer for the deployment which balances all the traffic load coming from public world on the application .For these we have to expose the deployment on port number 80 to access the WordPress application.
Let's see everything is created or not.Yes... It is created
--> kubectl get services
7) Now to create Back end i.e. to store user data of WordPress application we use MySQL Database in GCP.
So,we have to launch these MySQL Database instance using SQL service of Google Cloud in production project.
--> Adding authorized network to public ip of MySQL Instance :
For WordPress application,we have to create new database.
8)Now final step is to connect WordPress application to MySQL Database.
Now to connect MySQL database with WordPress application we have to add database login and password of the database user.
After successfully connecting the database and login to WordPress we can run the installation of the WordPress application .
Finally In this way I complete project of Google Cloud Platform Workshop.
For any queries or suggestions DM me.
$$ Thank You all for Visiting my article $$
Project Engineer at Wipro Limited
4yGreat work👏👏
DevOps @Forescout 🔐 | Google Developer Expert | AWS | DevOps | 3X GCP | 1X Azure | 1X Terraform | Ansible | Kubernetes | SRE | Platform | Jenkins | Tech Blogger 🚀
4yNice work Simran Kukareja ✨