Successfully Completed the Task on Google Cloud Platform

Aditya Jain
9 min readAug 23, 2020

Hello Everyone , In this Post I shared in detail about the Services provided by Google Cloud . I have done the following as follows -

1 . Created Multi Projects using WebUI and CLI

2. Enabled Google Compute Engine for both the Projects.

3. Created VPC in both the Projects . One VPC in Singapore Region while Other VPC in US region .

4. Created Subnet in both the VPC .

5. Connected both the VPC using VPC Peering.

6. Created Google Kubernetes Engine — GKE in 1 VPC .

7. Created SQL Server in another VPC and Created MySQL database .

8. Launched Wordpress Pod on the top of Kubernetes Cluster.

9. Created LoadBalancer for disaster Recovery .

10. Installed Wordpress in 1 VPC using Database running in another VPC.

Extra :-

  1. Created VM Instance in default VPC
  2. Host the Webserver on this VM Instance

Google Cloud Platform

GCP is one of the Product form the Google providing Public Cloud .

What is Project ?

A project consists of a set of users; a set of APIs; and billing, authentication, and monitoring settings for those APIs.

Creation of Projects -

Creation of Projects using CLI

After Creating Projects , Set-up Billings for the Projects .

What is VPC ?

Virtual Private Cloud (VPC) enables us to launch resources into a virtual network that you’ve defined. This virtual network closely resembles a traditional network that you’d operate in your own data center, with the benefits of using the scalable infrastructure of GCP.

VPC provide us border , which isolate us from outside . So any vpc cannot able to see our Infrastructure like RAM/CPU/Switch/db etc .

Creation of VPC in GCP in 1st Project in Singapore Region( whoaks)

Similary , VPC is Created in other Project USA Region (whoaks1)

What is VPC Peering ?

Google Cloud VPC Network Peering allows internal IP address connectivity across two Virtual Private Cloud (VPC) networks regardless of whether they belong to the same project or the same organization . You can make services available privately across different VPC networks within and across organizations.

Creation of VPC Peering in USA Region

Status is Inactive Till another VPC Peering is not Created in Singapore Region . As soon as , VPC Peering is created , They Become Active .

Creation of VPC Peering in Singapore Region

Now , Status of VPC network Peering is Active .

Steps to Google Cloud SDK set-up

What is Kubernetes?

Kubernetes is an open-source container-orchestration system for automating application deployment, scaling, and management .

Kubernetes , Powerful tool , have a inbuilt capacity to keep on watching a container (POD) . As soon as, OS goes down or fails they automaically launch another OS (internally instruct docker). Kubernetes manages docker and having a feature of Load Balancing and Service Discovery (Dynamic IP created by kubernetes).

Kubernetes has the capability to ask/Instruct the docker to launch an OS.
Slave Node — Node working for Kubernetes.
Master Node — Node manages the slave node .
If there are more than one Node , they are known as Multi-Node Cluster .

Behind the Scene , Kubernetes is used to manage the complete Infrastructure because kubernetes is good in launching the container in a second and also manages the container automatically.

Technically , Kubernetes never monitor Container , Instead they monitor POD and POD monitor container and manages it automatically .POD is the one who launches the container .

What is Pod?

A pod is a collection of containers and its storage inside a node of Kubernetes cluster . It is possible to create a pod with multiple conatiners inside it.Eg- one container for DB and one container for Wordpress in the same POD.

Creation of Kubernetes Cluster in Singapore Region (Project whoaks)

Here , I launched The K8S cluster in the VPC in Singapore region .

Kubernetes Cluster Created .

Creation of SQL Server in US Region (project whoaks1)

Creation of MySQL Database

Creation of User in MySQL Database

Launching WordPress Pod on the top of Kubernetes Cluster running in Singapore Region

By default , Kubernetes have their own LoadBalancer . Here we associate the Pod using LoadBalancer provided by GCP .

Here , There is No LoadBalancer in GCP .

As soon as , We expose the Pod running over K8S Cluster using LoadBalancer . One LoadBalancer is created automatically in the GCP .

If Pod goes down due to any reason , LoadBalancer automatically deployed 1 Pod .

Wordpress -

Attached MySQL Database running in other VPC, US region .

Here , Automatically table is created when Wordpress is attached to the Database .

Launching VM Instance using default VPC and Configuring WebServer -

By default , they don’t allow HTTP Port . So Here I attached one firewall to the Instance which allow HTTP port .

So , here WebServer Configured .

--

--