Google Cloud Platform Project

Abhiroop Bas
3 min readAug 26, 2020

--

Kubernetes cluster and load balancer to a Wordpress site managed by a SQL server from two different projects

Project description:

Using GCP platform to create a load balancer with the help of a Kubernetes cluster and SQL server for a php site for two projects connected by VPC peering

Project Objective:

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

Load balancer
SQL

Services and technologies used:

· Google Cloud Platform Console

· Compute Engine

· Virtual Private Cloud

· Firewall

· Google Cloud Engine

· Google Kubernetes Engine

· Structured Query Language

· Load balancer

Google Cloud Platform

· Identity and Access Management

Kubernetes

Process:

STEP 1: Create two projects say, “devproject” and “prodproject”

STEP 2: Create a new instance

The instance in devproject is set up as a CentOS 7 in asia-southeast-1 region (Singapore).

The instance in prodproject is set up as a CentOS 7 in us-east-1 region (South Carolina).

Instances

STEP 3: Create firewall rule

Allow Ingress for all IP ranges (0.0.0.0/0) for the tcp: 80 port

STEP 4: Setup VPC sub network

The sub network for the devproject instance be set up in us-east-1 and that for prodproject instance in asia-southeast-1 region

STEP 5: VPC peering

Apply for VPC peering from both the projects to each other to enable the systems to be connected.

VPC peering

STEP 6: Use GKE to setup a Kubernetes cluster

Add a node to the devproject and create a Kubernetes cluster in 3 zones.

Kubernetes cluster

STEP 7: Load balancer

Use kubectl.exe from the command prompt connected to the devproject to do horizontal scaling of pods and use deployment to setup a load balancer

STEP 8: SQL database

Setup a SQL database in the prodproject using the Storage services of GCP and add a database to it. Add user to it to enable update into the database.

SQL database

STEP 9: Wordpress image setup

Setup the Wordpress image using kubectl.exe and attach the load balancer to it.

STEP 10: IAM services

Use defined set of roles or customized roles to give access to the prodproject as other users through Google account

Conclusions:

The Google Cloud Platform can be used to manage and cater to clients from all across the world without having physical offices in all the destinations.

--

--

Abhiroop Bas
Abhiroop Bas

No responses yet