1

I'm trying to change an existing external HTTPS LBS configuration to apply advanced custom-header based routing rules on GCloud, but get the following error when updating the url-map

HTTPError 400: Invalid value for field 'resource.defaultService': ... Advanced routing rules are not supported for scheme EXTERNAL

The current setup is a Kubernetes workload (deployment) exposed as a service and has path-based ingress rules. FYI- Path-based LBS works.

Sample url-map

kind: compute#urlMap
name: k8s-um-development-lbs-test
defaultService: https://www.googleapis.com/compute/v1/projects/beans-cloud/global/backendServices/backend-1
hostRules:
- hosts:
  - '*'
  pathMatcher: user-agent-matcher
pathMatchers:
- name: user-agent-matcher
  routeRules:
    - matchRules:
        - prefixMatch: /
          headerMatches:
            - headerName: User-Agent
              regexMatch: "*Pattern-1*"
      priority: 0
      service: https://www.googleapis.com/compute/v1/projects/beans-cloud/global/backendServices/backend-1
    - matchRules:
        - prefixMatch: /
          headerMatches:
            - headerName: User-Agent
              regexMatch: "*Pattern-2*"
      priority: 1
      service: https://www.googleapis.com/compute/v1/projects/beans-cloud/global/backendServices/backend-2
  defaultService: https://www.googleapis.com/compute/v1/projects/beans-cloud/global/backendServices/backend-1
selfLink: https://www.googleapis.com/compute/v1/projects/beans-cloud/global/urlMaps/k8s-um-development-lbs-test
mrivanlima
  • 561
  • 4
  • 10
Sat Sun
  • 11
  • 1

1 Answers1

1

I want to confirm that is only possible to use it with HTTP(s) Load Balancer, So, if you wanted to rewrite or modify the URL, please review how to here.

Just to have more references, here is another reference, but please consider that this is only for Internal Load Balancer (Also HTTP(s)).

And as a last thing, I add information about that currently is not possible to custom the headers for external HTTP(s) Load Balancers, please put a comment here, in order to be informed about any update about it.

Regards and Happy New Year.

blueboy1115
  • 161
  • 2