我们正在使用GCP外部HTTPS负载平衡器,架构如下图所示。 LB的主要用途是将用户重定向到静态错误站点(托管在云存储桶上),以防CE实例下降,CE上的Traefik崩溃,CE上的Docker Crashes等。
我们在LOAD BALANCER上定义了4个后端服务:
-
static-error-page
后端桶
blog-backend-service
, gallery-backend-service
和 shop-backend-service
然后,区域网络端点组
,我们定义了主机和路径规则,以便:
-
https://blog.company.com
- > Blog-Backend-Service
-
https://gallery.company.com
- > Gallery-Backend-Service
-
https://shop.company.com
- > shop-backend-service
-
所有无与伦比的(默认)
- > static-error-page
每个Zonal网络端点组( Blog-Backend-Service
, Gallery-Backend-Service
和 shop backend -Service
)仅定义了1个端点: 192.168.171:443
( 192.168.171.3
是CE实例的内部IP)。
但是,由于我的网站是在反向代理(TRAEFIK)后面提供的,因此在网络端点中指定 ip:port
组合是没有用的,因为它们都具有相同的 ip:port
。我想在网络端点中指定URL,而不是 ip:port
(这样,网络端点也将显示正确的健康状态,如果网站下降,它总是报告 healthy 现在,即使申请减少)。
是否可以在网络端点中指定URL而不是 ip:port
?如果没有,我的选择是什么?
We are using GCP external HTTPS load balancer, architecture is shown in the diagram below. The primary use of LB is redirecting users to static error site (hosted on Cloud Storage bucket) in case CE instance is down, Traefik crashes on CE, Docker crashes on CE, etc.
We have 4 backend services defined on load balancer:
static-error-page
backend bucket
blog-backend-service
, gallery-backend-service
and shop-backend-service
zonal network endpoint groups
Then, we defined host and path rules so that:
https://blog.company.com
-> blog-backend-service
https://gallery.company.com
-> gallery-backend-service
https://shop.company.com
-> shop-backend-service
All unmatched (default)
-> static-error-page
Each zonal network endpoint group (blog-backend-service
, gallery-backend-service
and shop-backend-service
) has just 1 endpoint defined: 192.168.171:443
(192.168.171.3
is internal IP of CE instance).
However, since my websites are served behind reverse proxy (Traefik), specifying IP:port
combination in network endpoint is useless because they all have the same IP:port
. I would like to specify URL instead of IP:port
in network endpoint (that way network endpoint would also show correct health status if website is down, it always reports healthy now, even if application is down).
Is it possible to specify URL instead of IP:port
in network endpoint? If not, what are my alternatives?

发布评论
评论(1)
您可以使用旨在完成该工作的Google API网关,而不是使用Treafik,而您仍然可以使用其背后的负载平衡器。
Instead of using treafik, you can use Google API Gateway which was meant to do that job, while you can still use the load balancer behind it.