Skip to content

Instantly share code, notes, and snippets.

@shawnho1018
Created November 8, 2022 01:27
Show Gist options
  • Save shawnho1018/20bf510a3ee244535eaf13d597d9dbc8 to your computer and use it in GitHub Desktop.
Save shawnho1018/20bf510a3ee244535eaf13d597d9dbc8 to your computer and use it in GitHub Desktop.
urlmap-loadbalancer.yaml
defaultService: projects/shawn-mesh-2022/global/backendServices/bs-svc-a
name: matcher1
routeRules:
- urlRedirect:
pathRedirect: /balance
stripQuery: true
hostRedirect: tsmc.shawnk8s.com
redirectResponseCode: FOUND
matchRules:
- prefixMatch: /meet
priority: 1
- matchRules:
- prefixMatch: /shard-b
priority: 2
routeAction:
weightedBackendServices:
- backendService: projects/shawn-mesh-2022/global/backendServices/bs-svc-b
weight: 100
urlRewrite:
pathPrefixRewrite: /
hostRewrite: tsmc.shawnk8s.com
- matchRules:
- prefixMatch: /shard-c
priority: 3
routeAction:
weightedBackendServices:
- backendService: projects/shawn-mesh-2022/global/backendServices/bs-svc-c
weight: 100
urlRewrite:
pathPrefixRewrite: /
hostRewrite: tsmc.shawnk8s.com
- matchRules:
- prefixMatch: /login
priority: 4
routeAction:
weightedBackendServices:
- backendService: projects/shawn-mesh-2022/global/backendServices/bs-svc-login
weight: 100
urlRewrite:
pathPrefixRewrite: /
hostRewrite: tsmc.shawnk8s.com
- matchRules:
- prefixMatch: /balance
priority: 8
routeAction:
weightedBackendServices:
- backendService: projects/shawn-mesh-2022/global/backendServices/bs-svc-b
weight: 50
- backendService: projects/shawn-mesh-2022/global/backendServices/bs-svc-c
weight: 50
urlRewrite:
pathPrefixRewrite: /
hostRewrite: tsmc.shawnk8s.com
- matchRules:
- prefixMatch: /
priority: 9
routeAction:
weightedBackendServices:
- backendService: projects/shawn-mesh-2022/global/backendServices/bs-svc-login
weight: 100
urlRewrite:
pathPrefixRewrite: /
hostRewrite: tsmc.shawnk8s.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment