Lesson 20 / 25
Cloud Load Balancing, Cloud CDN and Cloud Armor
Choose a load balancer and protect it at the edge.
One anycast IP for the world
Cloud Load Balancing is a family of software-defined load balancers. The global external Application Load Balancer (layer 7, HTTP/HTTPS) gives you one anycast IP address served from Google's edge locations worldwide; it routes by host and path to backends such as managed instance groups, Cloud Run services (through serverless network endpoint groups), GKE and Cloud Storage buckets, and sends users to the closest healthy region. Regional application load balancers, proxy network load balancers (TCP/SSL) and passthrough network load balancers (layer 4, preserving client IPs) cover other needs, with internal variants for private traffic. Cloud CDN caches responses at the edge when enabled on a backend. Cloud Armor attaches security policies to the load balancer: a web application firewall with preconfigured OWASP rules, IP and geography allow/deny lists, and rate limiting.
A Cloud Armor policy with rate limiting
Block a known bad range and throttle any single IP to 100 requests per minute.
gcloud compute security-policies create shop-edge
gcloud compute security-policies rules create 1000 --security-policy=shop-edge \
--src-ip-ranges=203.0.113.0/24 --action=deny-403
gcloud compute security-policies rules create 2000 --security-policy=shop-edge \
--src-ip-ranges="*" --action=throttle \
--rate-limit-threshold-count=100 --rate-limit-threshold-interval-sec=60 \
--conform-action=allow --exceed-action=deny-429 --enforce-on-key=IP
gcloud compute backend-services update web-backend --global --security-policy=shop-edgeOne phone number for a national chain
The global load balancer is a single toll-free number. Callers dial the same number from anywhere and are connected to the nearest open branch; Cloud Armor is the receptionist who refuses known prank callers.
Quick check: Which load balancer gives a single global anycast IP for HTTPS traffic routed by URL path?
- Passthrough network load balancer
- Internal TCP load balancer
- Cloud NAT
- Global external Application Load Balancer
Answer
Global external Application Load Balancer — The global external Application Load Balancer is layer 7, global and anycast.