gpt4 book ai didi

kubernetes - Istio Pilot 正在创建应该是 HTTP 的 TCP 监听器

转载 作者:行者123 更新时间:2023-12-02 12:05:10 24 4
gpt4 key购买 nike

安装程序是 Kubernetes v1.13 & Istio 1.0.5

我遇到了一个问题,即 Istio 服务发现正在创建匹配 TCP 监听器而不是 HTTP 监听器的 Envoy 配置。

通信在服务网格中进行,但我需要 Envoy 作为第 7 层代理而不是第 4 层传递。我没有获得通过 Envoy 发出的 HTTP 请求所需的日志。

这是我在 sidecar istio-proxy 日志中看到的内容:

[2019-02-05T15:40:59.403Z] - 5739 7911 149929 "127.0.0.1:80"入站|80||api-endpoint.default.svc.cluster.local 127.0.0.1:44560 10.244.3.100:80 10.244 .3.105:35204

当我检查边车中的 Envoy 配置时 - 这是该日志消息的相应配置。

      "name": "envoy.tcp_proxy",
"config": {
"cluster": "inbound|80||api-endpoint.default.svc.cluster.local",
"access_log": [
{
"name": "envoy.file_access_log",
"config": {
"path": "/dev/stdout",
"format": "[%START_TIME%] %RESPONSE_FLAGS% %BYTES_RECEIVED% %BYTES_SENT% %DURATION% \"%UPSTREAM_HOST%\" %UPSTREAM_CLUSTER% %UPSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_LOCAL_ADDRESS% %DOWNSTREAM_REMOTE_ADDRESS%\n"
}
}
],
"stat_prefix": "inbound|80||api-endpoint.default.svc.cluster.local"
}

所以我的问题是: 为什么 Pilot 为 Envoy 提供 HTTP 服务的 TCP 配置?

最佳答案

我遇到过这种情况,在我的情况下,我的服务的端口名称不是 http-xyz 的形式.
Istio/Envoy 假设流量是 TCP,除非它从端口名称中得到提示它是其他协议(protocol)。
根据 https://istio.io/help/faq/traffic-management/#naming-port-convention

Named ports: Service ports must be named.

The port names must be of the form protocol-suffix with http, http2, grpc, mongo, or redis as the protocol in order to take advantage of Istio’s routing features.

For example, name: http2-foo or name: http are valid port names, but name: http2foo is not. If the port name does not begin with a recognized prefix or if the port is unnamed, traffic on the port will be treated as plain TCP traffic (unless the port explicitly uses Protocol: UDP to signify a UDP port).

关于kubernetes - Istio Pilot 正在创建应该是 HTTP 的 TCP 监听器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54538510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com