Integrate database(SQL service) to front end WordPress(deploy on k8s cluster) top of GCP Cloud.

Integrate database(SQL service) to front end WordPress(deploy on k8s cluster) top of GCP Cloud.


Task Description :

1. Create multiple projects namely developer and production.

2. Create VPC network for both the projects.

3. Create a link between both the VPC networks using VPC Peering.

4. Create a Kubernetes Cluster in developer project and launch any web application with the Load balancer.

5. Create a SQL server in the production project and create a database.

6. Connect the SQL database to the web application launched in the Kubernetes cluster.


Note:- I used qwiklabs for this gcp task.

Prerequisites .
  • GCP account or we can use qwiklabs .
  • gcloud commands present at your workstation or we can use cloud shell also for CLI operation.


I want to explain some information related to task:-

Google Cloud Platform ( GCP )

Google Cloud Platform, offered by Google, is a suite of cloud computing services that runs on the same infrastructure that Google uses internally for its end-user products, such as Google Search, Gmail, file storage, and YouTube

Google server hasn’t gone down in years. So, if you are planning to run your application on the Google Cloud infrastructure, then you can be assured of your applications being safe and secure.


Qwiklabs in gcp

Owned by GoogleQwiklabs is a hands-on experience that grants temporary credentials to Google Cloud. Learners can skill up as they learn and work in a real, production cloud environment .

Qwiklabs is an online learning environment that takes you through live, real-world scenarios, you might come across as an IT specialist. Qwiklabs works with the Google Cloud Console to spin up and create virtual machines. As a reminder, a virtual machine, or VM for short, is a computer simulated through software.


we have to download gcloud sdk software & then we can proceed with the CLI.

We can download the software from the given link: 


Note:- After download the above gcloud SDK then install , when we will install it automatic lands to the your GCP account and you have to sign in your a/c at broswer.


-> In case of qwiklabs we have to run :-

gcloud auth login


Note: - After run this command you have to login (by giving qwiklab's Username and Password)

No alt text provided for this image


-> Now lets start hands on parts step wise :-

Step 1


Note:-In qwiklabs we can not create another project so we can use project given by the qwiklabs by default at the time of start the lab.


-> I create two vpc in the given project:-

production vpc
No alt text provided for this image


developer vpc
No alt text provided for this image
No alt text provided for this image


->Now we have to create vpc peering at both vpc for established the private google network connection between these two vpc.


vpc peering at production vpc
No alt text provided for this image


vpc peering at developer vpc
No alt text provided for this image


Step 2

-> Launch k8s cluster in production vpc and deploy the wordpress application top of it.

No alt text provided for this image


No alt text provided for this image


-> Now connect this k8s cluster:-

No alt text provided for this image


No alt text provided for this image


-> Now we have to create a deployment of docker image(wordpress) and expose with LoadBalancer service.

No alt text provided for this image
No alt text provided for this image


-> LoadBalancer at cluster:-

No alt text provided for this image


No alt text provided for this image


Step 3

-> Launch SQL server :-

No alt text provided for this image


No alt text provided for this image


No alt text provided for this image


-> Create one database in SQL server

No alt text provided for this image


->Now connect to this SQL server to wordpress application :-

Note:- LoadBalancer give external IP(35.200.70.11)

No alt text provided for this image
No alt text provided for this image
No alt text provided for this image
No alt text provided for this image


->Now the connect the SQL server's database for check:-

No alt text provided for this image
No alt text provided for this image


That's All
Thanks to read.

要查看或添加评论,请登录

AJAY KUMAR YADAV的更多文章

社区洞察

其他会员也浏览了