You are on page 1of 18

Internal Load Balancing in 5 mins

Deliver scalable and resilient internal-only services on GCP


Google Cloud Load Balancing

HTTP(S) Load
Global SSL proxy
Balancing

Internal TCP/UDP Network TCP/UDP


Regional
Load Balancing Load Balancing

Hash-based LB Capacity-based LB Global Load


Request Routing
algorithm algorithm Balancing

Connection Cross-region
Health Checks Autoscaling
Draining failover

Affinity Logging Monitoring Cloud CDN


Internal Load Balancing

LB IP:
10.10.10.1 Src IP: 10.10.10.1 Src IP: 10.10.10.1
Client A Backend B
Dst IP: 10.10.10.200 Dst IP: 10.10.10.200
X

Internal (RFC 1918) Client IP preserved Health checks Autoscaling Session Affinity
Load Balancing (TCP, HTTP, HTTPS) (no prewarming)

REST API gcloud CLI Console


Internal Load Balancing Example

Subnet 1 Subnet 2 Subnet 3

Internal LB IP
Client instances 10.240.0.200
10.240.0.1 10.240.0.2

192.168.1.5 Zone: us-central1-b


192.168.1.1

Zone: us-central1-a

172.16.1.1
10.240.0.3

Zone: us-central1-c

Network: shopnet

Google Cloud Platform US Central region

Logical representation of the ILB, there is no LB instance between client and backend instances Backends running shopping cart application
Internal Load Balancing
Under the hood: Software-defined load balancing is delivered using
Andromeda, GCP’s
software-defined
Load Balancers can become Andromeda network virtualization
choke points stack
There is no load balancer in
the path between your client
and backend instances

Client Client Client Client


instance ...... instance instance ...... instance

IP1 IP2 IP1 IP2


Virtual Network
VIP

Load Balancer
instance(s) Internal LB

IP3 IP4 IP5 VIP VIP VIP

Backend Backend Backend Backend Backend


Backend ...... instance instance ...... instance

IP3 IP4 IP5

Typical Instance-based Internal Load Balancing Software-defined Internal Load Balancing on GCP
Configuring Internal Load Balancing
(console)

Infrastructure & Operations 6


Internal Load Balancing Configuration
Client
Instance

Forwarding Rule Internal LB IP, port


configuration

Regional Backend Service

Backend 1 Backend 2 Backend 3

Backend Configuration
Instance Group 1

Instance Group 2

Instance Group 3
Instance 1 Instance 3 Instance 5

Instance 2 Instance 4 Instance 6

Subnet A Subnet B

Region X
1. Click “create load balancer” to get started
Click Create
2. Select the type of Internal Load Balancer- either TCP or UDP

Click here for TCP


ILB
3. Specify you want to load balance traffic between your instances (internal)

Specify you want internal


load balancing
4. Configure backends in your region of choice

Configure backends

Remember to open up firewall


for ILB health checks
5. Configure your RFC 1918 Internal LB IP (specify or let ILB auto-allocate)

Configure Internal Load


Balancing IP and port (or
list of ports)
6. Click “create” and your ILB is ready to distribute traffic!

Click Create.
Done!
Internal Load Balancing Use Cases

Infrastructure & Operations 14


ILB Use Case 1: Scaling and HA for internal (micro)services
Load balance across multiple
instances of your internal service

Internal Load Balancer Internal Load Balancer

Internal Load Balancer

RECOMMEND RECOMMEND

SHOPPPING SHOPPPING SHOPPING


CART CART CART

CATALOG CATALOG

Google Cloud Platform Application composed of ILB-scaled services


ILB Use Case 2: Multi-tier apps Internal Load Balancing us-central-1a

Web Tier with external load


balancing Database Tier

IP: 10.10.10.10, Port: 80


Internal Load Balancing
Internal Tier
Web Tier

External Load Balancing


Global: HTTP(S) LB, SSL Proxy
User in San Francisco Regional: Network TCP/UDP LB

Database Tier
Web Tier Internal Tier

User in Iowa 100.1.1.1, Port: 80 us-central-1b

Internal Load Balancing


IP: 10.20.1.1,
User in Singapore

Port: 80
Internal Tier with Internal Load
Balancing Database Tier
Web Tier
Internal Tier

asia-east-1a
ILB Use Case 3: Scale-out and HA for virtual appliances

Internal Load Balancer

10.0.0.2 10.0.0.3 10.0.0.4

Virtual Appliance Virtual Appliance Virtual Appliance


Instance 1 Instance 2 Instance 3

Google Cloud Platform


Learn more

https://cloud.google.com/compute/docs/load-balancing/internal/

‹#›

You might also like