Reputation: 151
I'm configuring a GCP Load Balancer with route rules for different backend services based on URL prefixes. I want to match paths like /dev/two/
, /dev/three/
, etc., but all calls are hitting the default service when /dev/
is included in the path.
When I remove /dev/
from the prefix match (e.g., /two/
), everything works fine, but I want to keep /dev/
in the route without it defaulting to the main backend.
Here’s my YAML configuration for the GCP Load Balancer:
defaultService: projects/my-project-101010/global/backendServices/one-back-end
name: matcher1
routeRules:
- matchRules:
- prefixMatch: /dev/two/
priority: 1
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/two-back-end
weight: 100
- matchRules:
- prefixMatch: /dev/three/
priority: 2
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/three-back-end
weight: 100
- matchRules:
- prefixMatch: /dev/four/
priority: 3
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/four-back-end
weight: 100
- matchRules:
- prefixMatch: /dev/five
- prefixMatch: /dev/six
- prefixMatch: /dev/seven
- prefixMatch: /dev/eight
priority: 4
routeAction:
weightedBackendServices:
- backendService: projects/my-project-101010/global/backendServices/five-to-eight-back-end
weight: 100
/dev/two/
, /dev/three/
, etc., without it hitting the default service./dev/
prefixed URLs and not redirect all traffic to the default backend service./dev/
part from the prefix, and it works fine. But I want to keep /dev/
and ensure it doesn't default to the main backend.Has anyone encountered this issue or has suggestions on how to properly configure the routes with the /dev/
prefix while ensuring correct routing?
Upvotes: 0
Views: 19