c4i-techologies
c4i-techologies
c4i-techologies
c4i-techologies
  • Home
  • About Us
    • Our Team
  • Services
    • Mobile Application Development
      • iPhone apps Development
      • Android Apps Development
      • Hire Android Developer
      • iPad application development
    • Games Development
    • Cloud Based Application Development
    • Web Development
    • SEO Services
      • SEO eCommerce
      • Free SEO Audit
  • Solutions
    • Cloud Migration
    • Data Center
    • Big Data Analytics
    • Educational Solutions
    • Data mining
  • Technologies
    • Java
    • Internet of Things
    • Cloud Computing
    • Data Science
  • Careers
    • Open Positions
  • Blogs
    • Blog

      • Technology
      • SEO
      • Social Media
  • Contact

Create TCP/UDP Internal Load Balancer (ILB) on Google Cloud Platform (GCP) using managed and unmanaged instance groups

Home » Technology » Create TCP/UDP Internal Load Balancer (ILB) on Google Cloud Platform (GCP) using managed and unmanaged instance groups

Creating Internal Load Balancer in Google Cloud Platform is easy and it is used to distribute the load across VM instances. In this guide we will see how to create TCP/UDP Load Balancer using managed and unmanaged instances.

 

Prerequisites:

1) Gcloud SDK must be installed in your local

2) Login to your designated gcp project

3) User or Service Account must have required IAM roles to create ILB

Create TCP/UDP ILB using Managed Instance group

Google’s managed instance group are the group of identical VM instances created using an instance template. These VM instances can be in different zones (regional) but with same region when multi zone is enabled while creating managed instance group(MIG). As by the name managed, this group has some important features like autoscaling, auto-healing, Rolling out updates.

To Create ILB, Follow the below steps sequentially

1) Create Managed Instance group using commandline or GUI or Google deployment manager or rest API

2) Create TCP heath check using below command line

gcloud compute health-checks create tcp <health-check-name> --description="Health check: TCP <port>" --check-interval=5s --timeout=5s --healthy-threshold=2 --unhealthy-threshold=2 --port=<port> --proxy-header=NONE --region=<health-check-region>

3) Create a backed service using below command line

gcloud compute backend-services create <backend-service-name> --load-balancing-scheme internal --health-checks <health-check-name> --protocol tcp --region <backend-service-region>

4) Assign the created managed instance group to the created backend service

gcloud compute backend-services add-backend <backend-service-name> --instance-group <instance-group-name> --instance-group-region=<instance-group-region> --region <backend-service-region>

5) Create a forwarding rule using below command line

gcloud compute forwarding-rules create <forwarding-rule-name> --load-balancing-scheme internal --address <ILB ip address> --ports <port> --subnet <full path of subnet> --region <forwarding rule region> --backend-service <backend-service-name>

Note: Managed instance group, backend service and forwarding rule must be in same region

Create TCP/UDP ILB using Unmanaged Instance group

An unmanaged instance group is a collection of user created/managed VM instances that are created in a same zone, VPC network, and subnet. Unmanaged instances will not have same instance template. We need to manually add user created/managed VM instances into unmanaged instance groups

To Create ILB, Follow the below steps sequentially

1) Assumed User created/managed instances are up and running. Then create Unmanaged instance group using below command line

gcloud compute instance-groups unmanaged create <instance-group-name-1> --zone=<zone1>

gcloud compute instance-groups unmanaged create <instance-group-name-2> --zone=<zone2>

2) Add User created/managed instances to the created instance groups

gcloud compute instance-groups unmanaged add-instances <instance-group-name-1> --instances <instance-name-1>,<instance-name-2> --zone=<zone1>
gcloud compute instance-groups unmanaged add-instances instance-group-name-2> --instances <instance-name-3>,<instance-name-4> --zone=<zone2>

Note: Unmanaged instance group will be created only with same zone instances

3) Verify User created/managed instances are grouped under unmanaged instance group by using below command line

gcloud compute instance-groups unmanaged list-instances <instance-group-name-1> --zone=<zone1>

gcloud compute instance-groups unmanaged list-instances <instance-group-name-2> --zone=<zone2>

4) Create TCP heath check using below command line

gcloud compute health-checks create tcp <health-check-name> --description="Health check: TCP <port>" --check-interval=5s --timeout=5s --healthy-threshold=2 --unhealthy-threshold=2 --port=<port> --proxy-header=NONE --region=<health-check-region>

5) Create a backed service using below command line

gcloud compute backend-services create <backend-service-name> --load-balancing-scheme internal --health-checks <health-check-name> --protocol tcp --region <backend-service-region>

6) Assign the created unmanaged instance groups to the created backend service

gcloud compute backend-services add-backend <backend-service-name> --instance-group <instance-group-name-1> --instance-group-zone <instance-group-zone-1> --region <backend-service-region>

gcloud compute backend-services add-backend <backend-service-name> --instance-group <instance-group-name-2> --instance-group-zone <instance-group-zone-2> --region <backend-service-region>Create a forwarding rule using below command line

7) Create a forwarding rule using below command line

gcloud compute forwarding-rules create <forwarding-rule-name> --load-balancing-scheme internal --address <ILB ip address> --ports <port> --subnet <full path of subnet> --region <forwarding rule region> --backend-service <backend-service-name>

Note: Unmanaged instance group, backend service and forwarding rule must be in same region

Contents

    • 0.1 Prerequisites:
  • 1 Create TCP/UDP ILB using Managed Instance group
    • 1.1 To Create ILB, Follow the below steps sequentially
  • 2 Create TCP/UDP ILB using Unmanaged Instance group
    • 2.1 To Create ILB, Follow the below steps sequentially
KARTHICK SHANMUGAMOORTHY
24
Technology
Prev PostHTTP Liveness and Readiness Probe in Kubernetes DeploymentOct 21, 2020

Related items

Technology

HTTP Liveness and Readiness Probe in Kubernetes Deployment

Liveness and Readiness probes are required in Kubernetes to prevent deadlock of your appli

KARTHICK SHANMUGAMOORTHY
October 21, 2020
26
Technology

Configure Pod Anti-affinity and Pod Disruption Budget in Kubernetes deployment for High availability

High availability (HA) is the ability to make our application continuously operational for

KARTHICK SHANMUGAMOORTHY
October 21, 2020
25
c4ismall
We are on a mission to energize everyone to embrace technology for profitable employment.
Contact Us
Head Office
12000 Westheimer Rd STE 108, Houston, TX 77077
248-513-2965
Contact Us
Michigan Office
27620 Farmington Road, Suite 208 MI-48334
+1 248 987 1187
Copyright © 2020. All Rights Reserved.