Bird
0
0

Given this URL map configuration:

medium📝 Predict Output Q4 of 15
GCP - Cloud Load Balancing
Given this URL map configuration:
{"defaultService": "backendA", "hostRules": [{"hosts": ["example.com"], "pathMatcher": "pm1"}], "pathMatchers": [{"name": "pm1", "defaultService": "backendA", "pathRules": [{"paths": ["/images/*"], "service": "backendB"}]}]}

Which backend service will handle a request to https://example.com/images/logo.png?
AbackendA
BdefaultService of the load balancer
CbackendB
DNo backend service will handle this request
Step-by-Step Solution
Solution:
  1. Step 1: Match host and path in URL map

    The host "example.com" matches the hostRule with pathMatcher "pm1". The path "/images/logo.png" matches the pathRule "/images/*" which routes to backendB.
  2. Step 2: Determine backend service for the request

    Since the path matches the pathRule, the request is routed to backendB, not the defaultService backendA.
  3. Final Answer:

    backendB -> Option C
  4. Quick Check:

    Path match overrides defaultService = backendB [OK]
Quick Trick: Path rules override default service if matched [OK]
Common Mistakes:
  • Choosing defaultService instead of matched path service
  • Ignoring hostRules in routing
  • Assuming no backend handles the request

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes