Istio Pilot 正在创建应该是 HTTP 的 TCP 侦听器
Istio Pilot is creating TCP Listeners that should be HTTP
设置为 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
当我检查 sidecar 中的 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,除非它从端口名称中得到提示它是其他协议。
根据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 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
当我检查 sidecar 中的 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,除非它从端口名称中得到提示它是其他协议。
根据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).