🎯 ロードバランサー決定木

GCP の 11 種類の LB を「要件 → 正解」で即答するための思考プロセス。

決定木 (3 ステップ)

Q1クライアントは VPC 外? (External?)
Yes (External)
Q2aHTTP(S)?
Yes (App LB)
グローバルGlobal External Application LB (Premium Tier)
リージョナル / Standard TierRegional External Application LB
No (TCP/UDP)
IP/Port 保持・AnycastExternal Passthrough NLB
プロキシ・TLS 終端Global / Regional External Proxy NLB
No (Internal)
Q2bHTTP(S)?
Yes (App LB)
マルチリージョンCross-region Internal Application LB
単一リージョンRegional Internal Application LB
No (L4)
IP/Port 保持・Next Hop 可Internal Passthrough NLB
プロキシ・TLS 終端Regional / Cross-region Internal Proxy NLB

「要件 → 正解 LB」一覧

要件キーワード正解 LB
HTTPS グローバル + WAF + CDNGlobal External Application LB
HTTPS 単一リージョン + 低コスト (Standard Tier)Regional External Application LB
TCP/UDP Anycast、IP 保持External Passthrough NLB
TLS 終端 + グローバル TCPGlobal External Proxy NLB
VPC 内 HTTPS、マルチリージョンCross-region Internal Application LB
VPC 内 HTTPS、単一リージョンRegional Internal Application LB
VPC 内 TCP/UDP、IP/Port 保持、Next HopInternal Passthrough NLB
VPC 内 TCP/UDP、TLS 終端Internal Proxy NLB

NEG 種別と組み合わせ

NEG 種別用途使える LB
GCE_VM_IP_PORT (Zonal)VM の IP:port 直接全て (Container-native LB の起点)
Internet NEG (FQDN/IP)オンプレ/他クラウドExternal Application/Proxy LB
Serverless NEGCloud Run / Functions / App EngineApplication LB
Hybrid NEGオンプレ/他クラウド (private)Internal Application/Proxy LB
PSC NEGマネージドサービス公開Application LB

session affinity 早見表

モードPassthroughProxy/App
NONE
CLIENT_IP
CLIENT_IP_PORT_PROTO (5-tuple)
GENERATED_COOKIE
HEADER_FIELD
HTTP_COOKIE

確認問題: シナリオ即答

Q1. 既存の Cloud Run サービスを 1 つの公開ドメインで複数 URL path に振り分けたい。

A。 Serverless NEG + LB の URL map で path-based routing。

Q2. オンプレを Internal Application LB のバックエンドにしたい。

B。 Hybrid NEG は Internal LB でオンプレを backend にする専用 NEG。