kubernetes - 访问 Cloud Run on GKE 服务的奇怪方式

标签 kubernetes google-cloud-platform istio google-cloud-run knative

我正在关注thisgcpcloud run 上执行所谓的快速入门并进行一些实验的教程。

除了宣布的和典型的服务可用性方面存在一些延迟和不一致之外,脚本化的步骤进展顺利。

我想问(找不到任何相关文档或解释)是为什么,为了让我访问需要传递给curl的服务> 相关教程所示的特定 Host header :

curl -v -H "Host: hello.default.example.com" YOUR-IP

其中YOUR-IP是由istio管理的入口网关创建的负载均衡器的公共(public)IP

最佳答案

Most proxies根据 Host header 处理外部流量匹配请求。他们使用 Host header 中的内容来决定将请求发送到哪个服务。如果没有 Host header ,他们将不知道将请求发送到哪里。

Host-based routing is what enables virtual servers on web servers. It’s also used by application services like load balancing and ingress controllers to achieve the same thing. One IP address, many hosts.

Host-based routing allows you to send a request for api.example.com and for web.example.com to the same endpoint with the certainty it will be delivered to the correct back-end application.

这在 Multi-Tenancy 代理/负载均衡器中很常见,这意味着它们为代理后面完全不同的租户/应用程序处理流量。

关于kubernetes - 访问 Cloud Run on GKE 服务的奇怪方式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56650085/

相关文章:

node.js - 来自卷的数据作为 kubernetes secret

kubernetes - Helm hook 在升级时不会删除先前版本的资源

database - Cloud Spanner 插入 ID

ssl - Istio + Kubernetes : Gateway more than one TLS Certificate

kubernetes - 如何配置 Istio 虚拟服务目标协议(protocol)

java - 创建 kubernetes 部署时,Quarkus RestClient 属性的环境值无效

kubernetes - 存储桶中的GCP堆栈驱动程序日志记录日志格式已从每个容器的文件夹更改为stdout\stderr

firebase - 正确的 Firestore 带宽/网络/互联网导出计费因素

java - Google Cloud Bigtable 实例

url - Istio VirtualService - 损坏的 URL