1

我正在尝试通过 istio 入口将来自外部世界的 grpc 流设置到 istio 集群中。我能够建立连接,但我看到每 60 秒重置一次连接。

容器日志在中断之前告诉“rpc 错误:code = Unavailable desc”

查看入口和特使日志。没什么帮助。附在下面。

INGRESS LOGS
[2020-03-06T12:14:10.221Z] "- - -" 0 - "-" "-" 2679 2552 9993 - "-" "-" "-" "-" "10.244.0.93:5448" outbound|5448||grpc-broker.x-infra.svc.cluster.local 10.244.0.116:58094 10.244.0.116:443 10.222.2.9:37864 <xxxxxx DNS NAME xxxxxxxx> -

ENVOY LOGS
[2020-03-06T12:16:28.331Z] "- - -" 0 - "-" "-" 12021 2733 50282 - "-" "-" "-" "-" "127.0.0.1:5448" inbound|5448|tcp-broker|grpc-broker.x-infra.svc.cluster.local 127.0.0.1:56816 10.244.0.93:5448 10.244.0.116:34782 outbound_.5448_._.grpc-broker.x-infra.svc.cluster.local -

我们应该在 grpc 流中添加任何额外的东西来工作吗?

集群默认启用 mTLS,源和目标 pod 是部署而不是有状态集。

4

1 回答 1

0

从 istio 端确保 istio 没有关闭连接:

这可以通过 idleTimeout 设置 来防止DestinationRule

根据关于 istio 的 文档idleTimeout

上游连接池连接的空闲超时。空闲超时定义为没有活动请求的时间段。如果未设置,则没有空闲超时。当达到空闲超时时,连接将被关闭。请注意,基于请求的超时意味着 HTTP/2 PING 不会使连接保持活动状态。适用于 HTTP1.1 和 HTTP2 连接。

所以如果你 DestinationRule 这样做:

apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
  name: grpc-iddletimeout-policy
spec:
  host: grpcservice.servicenamespace.svc.cluster.local
  trafficPolicy:
    connectionPool:
      http:
        idleTimeout: 2m

这应该在 命名空间HTTP/2 中空闲 2 分钟后关闭来自 Istio 特使代理端 的任何 连接 。grpcserviceservicenamespace

希望能帮助到你。

于 2020-03-11T13:13:20.253 回答