首页 > 解决方案 > 服务器关闭了流而不发送预告片

问题描述

我正在尝试使用 gRPC for Kubernetes(Amazon EKS)从 Envoy 与 Envoy 进行通信。

我的边车中有一个特使,我正在使用 grpcurl 来验证请求。请求投递到应用容器,没有报错,但是控制台返回如下结果

server closed the stream without sending trailers

我不知道上述问题的原因是什么,这个结果可能是什么原因?当我在与特使连接之前点击单个服务时,我能够确认响应恢复正常。

这是我的特使配置

    admin:
      access_log_path: /tmp/admin_access.log
      address:
        socket_address:
          protocol: TCP
          address: 127.0.0.1
          port_value: 10000
    static_resources:
      listeners:
        - name: listener_secure_grpc
          address:
            socket_address:
              protocol: TCP
              address: 0.0.0.0
              port_value: 8443
          traffic_direction: INBOUND
          filter_chains:
            - filters:
                - name: envoy.http_connection_manager
                  typed_config:
                    "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
                    codec_type: auto
                    stat_prefix: ingress_http
                    route_config:
                      name: local_route
                      virtual_hosts:
                        - name: service_grpc
                          domains:
                            - "*"
                          routes:
                            - match:
                                prefix: "/"
                              route:
                                cluster: cluster_grpc
                                max_stream_duration:
                                  grpc_timeout_header_max: 30s
                    tracing: {}
                    http_filters:
                      - name: envoy.filters.http.health_check
                        typed_config:
                          "@type": "type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck"
                          pass_through_mode: false
                          headers:
                          - name: ":path"
                            exact_match: "/healthz"
                      - name: envoy.filters.http.router
              transport_socket:
                name: envoy.transport_sockets.tls
                typed_config:
                  "@type": "type.googleapis.com/envoy.extensions.transport_sockets.tls.v3.DownstreamTlsContext"
                  common_tls_context:
                    tls_certificates:
                      - certificate_chain:
                          filename: /etc/ssl/grpc/tls.crt
                        private_key:
                          filename: /etc/ssl/grpc/tls.key
        - name: listener_stats
          address:
            socket_address:
              protocol: TCP
              address: 0.0.0.0
              port_value: 10001
          traffic_direction: INBOUND
          filter_chains:
            - filters:
                - name: envoy.http_connection_manager
                  typed_config:
                    "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
                    codec_type: AUTO
                    stat_prefix: ingress_http
                    route_config:
                      virtual_hosts:
                        - name: backend
                          domains:
                            - "*"
                          routes:
                            - match:
                                prefix: /stats
                              route:
                                cluster: cluster_admin
                    http_filters:
                      - name: envoy.filters.http.router
        - name: listener_healthcheck
          address:
            socket_address:
              protocol: TCP
              address: 0.0.0.0
              port_value: 10010
          traffic_direction: INBOUND
          filter_chains:
            - filters:
                - name: envoy.http_connection_manager
                  typed_config:
                    "@type": "type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager"
                    codec_type: AUTO
                    stat_prefix: ingress_http
                    route_config: {}
                    http_filters:
                      - name: envoy.filters.http.health_check
                        typed_config:
                          "@type": "type.googleapis.com/envoy.extensions.filters.http.health_check.v3.HealthCheck"
                          pass_through_mode: false
                          headers:
                          - name: ":path"
                            exact_match: "/healthz"
                      - name: envoy.filters.http.router
      clusters:
        - name: cluster_grpc
          connect_timeout: 1s
          type: STATIC
          http2_protocol_options: {}
          upstream_connection_options:
            tcp_keepalive: {}
          load_assignment:
            cluster_name: cluster_grpc
            endpoints:
              - lb_endpoints:
                - endpoint:
                    address:
                      socket_address:
                        address: 127.0.0.1
                        port_value: 1443
        - name: cluster_admin
          connect_timeout: 1s
          type: STATIC
          load_assignment:
            cluster_name: cluster_grpc
            endpoints:
              - lb_endpoints:
                - endpoint:
                    address:
                      socket_address:
                        address: 127.0.0.1
                        port_value: 10000

PS 2021.03.19

这是我发现的其他内容。当我从入口主机请求时,我得到了上述失败,但是当我从服务请求时,我得到了正常响应!

标签: kubernetesgrpcenvoyproxy

解决方案


推荐阅读