GCP – HTTP(S)负载均衡器 L7 后端存储桶问题

huangapple go评论80阅读模式
英文:

GCP - HTTP(S) Load Balancer L7 Backend Bucket Issue

问题

I have just migrated from the HTTP(S) L7 Load balancer (Classic) to the new HTTP(S) L7 load balancer.

我刚刚从HTTP(S) L7经典负载均衡器迁移到了新的HTTP(S) L7负载均衡器。

I currently have two backend services working fine, and I am looking at creating two backend buckets - however I am getting an error when creating them.

我目前有两个后端服务正常运行,我正在考虑创建两个后端存储桶 - 但是在创建它们时出现错误。

If I select simple host and path rule and specify the host, path and backend bucket - it works fine.

如果我选择简单的主机和路径规则并指定主机、路径和后端存储桶 - 它可以正常工作。

However, if I specify advanced host and path rule, and supply the following configuration:

但是,如果我指定高级主机和路径规则,并提供以下配置:

defaultService: projects/MY_PROJECT/global/backendBuckets/my-backend-bucket
name: matcher2
routeRules:
- matchRules:
  - prefixMatch: /
  priority: 0
  routeAction:
    weightedBackendServices:
    - backendService: projects/MY_PROJECT/global/backendBuckets/my-backend-bucket
      weight: 100

I am getting this cryptic error

我收到了这个神秘的错误消息

Invalid value for field 'resource': '{ "name": "my-loadbalancer", "hostRule": [{ "host": ["myhost.com"], "pathMatcher": ...'. Invalid resource: URL_MAP/ID.my-loadbalancer

Invalid value for field 'resource': '{ "name": "my-loadbalancer", "hostRule": [{ "host": ["myhost.com"], "pathMatcher": ...'. 无效的资源:URL_MAP/ID.my-loadbalancer

Has anyone come across this issue before? I am getting this even though I am creating a new backend bucket. I also tried using the old backend buckets I had created with the classic load balancer, and still I am getting this error?

有人遇到过这个问题吗?尽管我正在创建一个新的后端存储桶,但我仍然收到了这个错误消息。我还尝试使用我以前在经典负载均衡器中创建的旧后端存储桶,但仍然收到此错误?

Any help would be much appreciated, thanks.

非常感谢任何帮助。谢谢。

英文:

I have just migrated from the HTTP(S) L7 Load balancer (Classic) to the new HTTP(S) L7 load balancer.

I currently have two backend services working fine, and I am looking at creating two backend buckets - however I am getting an error when creating them.

If I select simple host and path rule and specify the host, path and backend bucket - it works fine.
GCP – HTTP(S)负载均衡器 L7 后端存储桶问题

However, if I specify advanced host and path rule, and supply the following configuration:

defaultService: projects/MY_PROJECT/global/backendBuckets/my-backend-bucket
name: matcher2
routeRules:
- matchRules:
  - prefixMatch: /
  priority: 0
  routeAction:
    weightedBackendServices:
    - backendService: projects/MY_PROJECT/global/backendBuckets/my-backend-bucket
      weight: 100

I am getting this cryptic error

Invalid value for field 'resource': '{ "name": "my-loadbalancer", "hostRule": [{ "host": ["myhost.com"], "pathMatcher": ...'. Invalid resource: URL_MAP/ID.my-loadbalancer

Has anyone come across this issue before? I am getting this even though I am creating a new backend bucket. I also tried using the old backend buckets I had created with the classic load balancer, and still I am getting this error?

Any help would be much appreciated, thanks.

答案1

得分: 1

这个问题实际上只能使用不同的yaml来解决,我认为你尝试的是负载均衡路由下的代码指导中的yaml。我也尝试过使用代码指导,但出现了一个错误消息,其中负载均衡器没有被创建。

我使用了这个链接作为指导,并得出了以下配置,它在使用高级主机和路径时起作用。

name: video-matcher
pathRules:
- paths:
  - /video/hd
  - /video/hd/*
  service: projects/project id /global/backendBuckets/bucketname```

<details>
<summary>英文:</summary>

This concern is actually feasible just using a different yaml, I believe what you have tried is the yaml from code guidance under load balancer routing. I also tried to use the code guidance but I am having an error message wherein load balancer is not created.

I used this 
(https://cloud.google.com/load-balancing/docs/url-map-concepts#example_url_map_workflow_with_an) as a guidance and came up with this configuration and it worked using the advanced host and path. ```defaultService: projects/project id /global/backendBuckets/bucketname name: video-matcher pathRules: - paths: - /video/hd - /video/hd/* service: projects/project id /global/backendBuckets/bucketname``` </details>

huangapple
  • 本文由 发表于 2023年4月13日 21:55:06
  • 转载请务必保留本文链接:https://go.coder-hub.com/76006293.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定