knative queue-proxy

Knative Revision的Pod中,queue-proxy作为sidecar容器运行,处理流量转发。流量经过Istio Gateway到达Queue-Proxy的8012端口,再转发至应用容器。queue-proxy负责请求指标统计、健康检查(k8s probe和knative probe)以及代理功能。它预留了8012(http)、8013(http2,grpc)、8022(管理端口)等端口,应用端口应避免冲突。queue-proxy不统计k8s probe和knative probe的请求,提供探针能力确保Ingress和Pod状态。
摘要由CSDN通过智能技术生成

knative revision最终创建的deploy,会在pod中启用一个sidecar容器,即queue-proxy。

下图展示了queue-proxy的用途,业务流量首先进入 Istio Gateway,然后会转发到 Queue-Proxy 的 8012 端口,Queue-Proxy 8012 再把请求转发到业务容器的监听端口。

queue-proxy

queue-proxy用途

  1. 应用请求数等指标统计。
  2. Pod健康检查(k8s探针)
  3. 代理转发流量
  4. 判断Ingress是否ready需要通过访问queue-proxy实现

queue-proxy预留的端口

knative的组件预留了一些端口作为服务端口,例如8012端口默认是给queue使用的,因此应用的端口应该避开这些预留的端口。

  • 8012,queue-proxy代理的http端口,一般访问应用流量的入口。
  • 8013,http2端口,用于grpc流量的转发。
  • 8022,queue-proxy管理端口。
  • 9090,queue-proxy容器的监控端口,图中的端口已过时。数据由Autoscaler采集,用于kpa。
  • 9091,queue-proxy采集到的应用监控指标(req请求数,响应市场等),图中的端口已过时。由prometheus采集,用于计费。
    serving/pkg/apis/networking/ports.go
// The ports we setup on our services.
const (
	// ServiceHTTPPort is the port that we setup our Serving and Activator K8s services for
	// HTTP/1 endpoints.
	ServiceHTTPPort = 80

	// ServiceHTTP2Port is the port that we setup our Serving and Activator K8s services for
	// HTTP/2 endpoints.
	ServiceHTTP2Port = 81

	// BackendHTTPPort is the backend, i.e. `targetPort` that we setup for HTTP services.
	BackendHTTPPort = 8012

	// BackendHTTP2Port is the backend, i.e. `targetPort` that we setup for HTTP services.
	BackendHTTP2Port = 8013

	// QueueAdminPort specifies the 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值