Integrate database(SQL service) to front end WordPress(deploy on k8s cluster) top of GCP Cloud.
AJAY KUMAR YADAV
DevOps Engineer II at Devtron Inc || AWS || Azure || GCP || K8s || Eksctl || KOps || Terraform || Ansible II Jenkins
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 Google, Qwiklabs 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)
-> 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
developer vpc
->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
vpc peering at developer vpc
Step 2
-> Launch k8s cluster in production vpc and deploy the wordpress application top of it.
-> Now connect this k8s cluster:-
-> Now we have to create a deployment of docker image(wordpress) and expose with LoadBalancer service.
-> LoadBalancer at cluster:-
Step 3
-> Launch SQL server :-
-> Create one database in SQL server
->Now connect to this SQL server to wordpress application :-
Note:- LoadBalancer give external IP(35.200.70.11)
->Now the connect the SQL server's database for check:-
That's All
Thanks to read.