VirtualPrivate Networks using Network Peering|Deployment of WebApplication with Cloud SQL and GKE|GCP

VirtualPrivate Networks using Network Peering|Deployment of WebApplication with Cloud SQL and GKE|GCP

?Task Details ?

1.Create two Virtual Private Cloud (VPC) networks namely developervpc and productionvpc

2.Connecting both vpc networks using vpc peering

3.Create a Kubernetes Cluster in the project and launch a web application with the LoadBalancer

4.Create A SQL server in the project and create a database

5.connect the SQL database to the web application launched in the kubernetes cluster

Virtual Private Cloud (VPC)

The Google Cloud Platform makes it possible to connect instances hosted in separate Virtual Private Clouds (VPCs), even if those instances belong to different projects or are hosted in different regions.

By default network with a series of default subnets will be deployed ready for immediate use. VM instances can be deployed on the default subnets without any network configuration

Each VM instance in gcp will have an internal Ip address and typically an external IP address.The internal IP address is used to communicate between instances in the same VPC network, while the external IP address is used to communicate with instances in other network or the internet

VPC network Peering

The Google Cloud Platform makes it possible to connect instances hosted in separate Virtual Private Clouds (VPCs), even if those instances belong to different projects or are hosted in different regions. This feature, known as VPC Network Peering, can result in better security (as services do not need to be exposed on public IP addresses) and performance (due to use of private, rather than public, networks and IP addresses).

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 have two separate VPC networks without overlapping subnet IP address ranges

Kubernetes

Google Kubernetes Engine (GKE) provides a managed environment for deploying, managing, and scaling your containerized applications using Google infrastructure. The GKE environment consists of multiple machines (specifically, Compute Engine instances) grouped together to form a cluster.

Each node in the pool has a Kubernetes node label, which has the node pool's name as its value. A node pool can contain only a single node or many nodes.

When you create a cluster, the number and type of nodes that you specify becomes the default node pool.

Cloud SQL :

Cloud SQL to host your MySQL database in Google's cloud, and let Google Cloud handle administrative duties like replication, patch management, and database management. Cloud Marketplace provides a simple click-to-deploy interface that makes it easy to install MySQL onto a Compute Engine instance.

Step 1: Creating the VPC networks

From the left navigation menu

select the -> VPC network -> VPC networks ->create vpc network

creating devloper vpc network as vpcdevproject with subnet lab1 within the ip address range 10.0.1.0/24 asia-southeast1

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


creating production vpc network as vpcprodproject with subnet lab2 within the ip address range 10.0.2.0/24 in region us-east1

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


Step 2: Connecting both devloper vpc network and production vpc network with vpc peering

From the left navigation menu, select the Networking-> VPC network -> VPC network peering.

Click the create connection button and Read the warning message and click the Continue button

Creating vpc peering with developer vpc network to peer with production vpc network

No alt text provided for this image


The Peering connection will be created and should display the status as Inactive

No alt text provided for this image

Repeat the above process and create a second peering connection, with production vpc network to peer with developer vpc network

No alt text provided for this image

The second peering connection will now be created. Once created, the two networks will automatically connect to each other with status active.

No alt text provided for this image

Step 3: Creating a Kubernetes Cluster in the project and launch a web application with the Load balancer

From the left navigation menu, select the kubernetes and create cluster

Creating a Kubernetes Cluster with location type as regional in the region us-central with size of one default pool node

No alt text provided for this image


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

once created the Kubernetes Cluster we get kubectl command line access by running the command

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

launching a web application word press with name myweb with the LoadBalancer on port 80 which default webserver is running.

No alt text provided for this image


Step 4:Creating a SQL server and a database in the project

From the left navigation menu, select the SQL and create instance

GCP providing three types of database engines

Creating SQL instance as mysqlservice with root user and password in region us-east1 and in zone us-east1-b

No alt text provided for this image

Adding the network as to access by every ip and every node but it is not good for security

No alt text provided for this image

creating a database with database name mysqlservice

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

we can connect sql instance with public ip address(database host) root user and password

No alt text provided for this image


Step 5:connect the SQL database to the web application launched in the kubernetes cluster

Accessing the external ip address of the web application launched in the kubernetes cluster

No alt text provided for this image

Connecting the web application using external ip address with port 80

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


Done this task under guidance of Vimal Daga Sir.In training of  GCP Workshop by Linux World Informatics Pvt Ltd.


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

Kalla Kruparaju的更多文章

  • Industry usecases of Azure Kubernetes Service

    Industry usecases of Azure Kubernetes Service

    Kubernetes is a portable, extensible, open source platform for container orchestration. It allows developers and…

  • Industry use cases of neural networks

    Industry use cases of neural networks

    One of the key parts of cutting edge AI technology, Artificial Neural Networks (ANNs) are becoming too important and…

    1 条评论
  • Linux World Azure Workshop Day 1 Summary

    Linux World Azure Workshop Day 1 Summary

    ?To run any program on the top of the operting system we need to provision the Operating system with hardware…

  • Networking !!!!

    Networking !!!!

    Hello Connections!!!! I am back with one more article to create a topology with three system. Agenda of the task is…

    4 条评论
  • Pinging to Google but not Facebook

    Pinging to Google but not Facebook

    Hello Connections!!!! I am back with one more article with i can ping to google but not facebook Listing the rules in…

    6 条评论
  • how comapnies are solving challenges using ansible

    how comapnies are solving challenges using ansible

    Ansible is an open-source software provisioning, configuration management, and application-deployment tool enabling…

  • Configuring HTTPD Server on Docker Container

    Configuring HTTPD Server on Docker Container

    Hello Connections?? In this article i would like to Configure the HTTPD Server on Docker Container. ?Prerequisite of…

    1 条评论
  • Setting up Python Interpreter and running Python Code on Docker Container

    Setting up Python Interpreter and running Python Code on Docker Container

    Hello Connections?? In this article i would like to deploy the python interpreter on the Docker Container and to run…

    4 条评论
  • Increasing or Decreasing the Size of Static Partition in RHEL 8.

    Increasing or Decreasing the Size of Static Partition in RHEL 8.

    Hello Connections !!! Increasing or decreasing the size of the storage will be only possible with LVM concept at…

    8 条评论

社区洞察

其他会员也浏览了