Internal Load Balancing in 5 mins - Google Cloud Platform · Global Load Balancing Request Routing...

18
Deliver scalable and resilient internal-only services on GCP Internal Load Balancing in 5 mins

Transcript of Internal Load Balancing in 5 mins - Google Cloud Platform · Global Load Balancing Request Routing...

Deliver scalable and resilient internal-only services on GCP

Internal Load Balancing in 5 mins

Google Cloud Load Balancing

Connection Draining Autoscaling Cross-region

failoverHealth Checks

Global Load BalancingRequest Routing Hash-based LB

algorithmCapacity-based LB

algorithm

Cloud CDNAffinity Logging Monitoring

HTTP(S) Load Balancing SSL proxy

Network TCP/UDP Load Balancing

Internal TCP/UDP Load Balancing

Global

Regional

Client IP preservedInternal (RFC 1918)Load Balancing

Health checks(TCP, HTTP, HTTPS)

Autoscaling(no prewarming)

Session Affinity

gcloud CLIREST API Console

Src IP: 10.10.10.1Dst IP: 10.10.10.200

Src IP: 10.10.10.1Dst IP: 10.10.10.200

Backend BClient A

LB IP: 10.10.10.1

X

Internal Load Balancing

Google Cloud Platform US Central region

10.240.0.1 10.240.0.2

192.168.1.1

10.240.0.3172.16.1.1

Zone: us-central1-a

Subnet 3Subnet 1 Subnet 2

192.168.1.5

Zone: us-central1-c

Zone: us-central1-b

Internal Load Balancing Example

Client instancesInternal LB IP 10.240.0.200

Network: shopnet

Backends running shopping cart applicationLogical representation of the ILB, there is no LB instance between client and backend instances

Backend instance......

Internal LB

Virtual Network

Client instance......

VIPVIP VIP

Backend instance

Backend instance

Client instance

IP1 IP2

Backend......

Load Balancer instance(s)

Client instance......

IP4IP3 IP5

Backend Backend

Client instance

IP1 IP2

VIP

IP3 IP4 IP5

Andromeda

Under the hood: Software-defined load balancing

Software-defined Internal Load Balancing on GCPTypical Instance-based Internal Load Balancing

Load Balancers can become choke points There is no load balancer in

the path between your client and backend instances

Internal Load Balancing is delivered using Andromeda, GCP’s software-defined network virtualization stack

6Infrastructure & Operations 66

Configuring Internal Load Balancing(console)

Forwarding Rule

Regional Backend Service

Region X

ClientInstance

Instance 1

Instance 2

Inst

ance

Gro

up 1

Instance 3

Instance 4In

stan

ce G

roup

2

Instance 5

Instance 6

Inst

ance

Gro

up 3

Backend 2 Backend 3Backend 1

Backend Configuration

Internal LB IP, port configuration

Subnet A Subnet B

Internal Load Balancing Configuration

1. Click “create load balancer” to get startedClick 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!

14Infrastructure & Operations 1414

Internal Load Balancing Use Cases

ILB Use Case 1: Scaling and HA for internal (micro)services

SHOPPPING CART

SHOPPING CART

SHOPPPING CART

CATALOGCATALOG

RECOMMENDRECOMMEND

Google Cloud Platform Application composed of ILB-scaled services

Internal Load Balancer

Internal Load Balancer

Internal Load Balancer

Load balance across multiple instances of your internal service

User in San Francisco

Web TierInternal Tier

Web Tier Internal Tier

us-central-1a

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

Inte

rnal

Loa

d Ba

lanc

ing

I

P: 1

0.10

.10.

10, P

ort:

80

Web TierInternal Tier

Inte

rnal

Loa

d Ba

lanc

ing

I

P: 1

0.20

.1.1

, Po

rt: 8

0

asia-east-1a

User in Singapore

Database Tier

Database Tier

Database Tier

External Load BalancingGlobal: HTTP(S) LB, SSL ProxyRegional: Network TCP/UDP LB

Internal Load BalancingILB Use Case 2: Multi-tier apps

Internal Tier with Internal Load Balancing

Web Tier with external load balancing

ILB Use Case 3: Scale-out and HA for virtual appliances

Virtual ApplianceInstance 2

Virtual ApplianceInstance 3

Virtual ApplianceInstance 1

10.0.0.2 10.0.0.3 10.0.0.4

Internal Load Balancer

Google Cloud Platform

‹#›

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

Learn more