我正在尝试更改现有的外部 HTTPS LBS 配置以在 GCloud 上应用基于高级自定义标头的路由规则,但在更新 url-map 时出现以下错误
HTTPError 400:字段“resource.defaultService”的值无效:...方案EXTERNAL不支持高级路由规则
当前设置是作为服务公开的 Kubernetes 工作负载(部署),并具有基于路径的入口规则。仅供参考-基于路径的 LBS 有效。
示例网址映射
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