![](/img/trans.png)
[英]gRPC in EKS on AWS with Nginx-Ingress-Controller
[英]SSL with GRPC on AWS EKS and Istio Ingress gives StatusCode.UNAVAILABLE
我正在使用 AWS EKS 服务(K8S 版本 1.17)运行 kubernetes 集群,并在其上安装 Istio (1.7.1) 作为 Operator 安装。
我一直在运行这些服务,因为它们正常工作,而且我将 Istio Ingress Gateway 作为入口服务运行,使用 AWS NLB 发布,在 Istio Ingress Gateway 上带有以下注释:
metadata:
annoations:
service.beta.kubernetes.io/aws-load-balancer-type: "nlb"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "tcp"
service.beta.kubernetes.io/aws-load-balancer-internal: "false"
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "redacted arn"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https"
这成功创建了具有 4 个侦听器的 NLB(根据 Istio 入口定义),其中 443 使用提供的证书运行 TLS。
在其后面,网关配置如下:
apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:
name: service-gateway
namespace: istio-system
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: grpc-plain
protocol: GRPC
hosts:
- redacted
- port:
number: 443
name: grpc-tls
protocol: GRPC
hosts:
- redacted
---
apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:
name: service-vservice
namespace: app
spec:
gateways:
- istio-system/service-gateway
hosts:
- redacted
http:
- route:
- destination:
host: service
port:
number: 8000
但是,虽然普通端口 (80) 与负载均衡器配合得很好,但 SSL/TLS 端口 443 使用任何语言(使用 C、C++、Python 测试)都会出现以下错误:
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.UNAVAILABLE
details = "failed to connect to all addresses"
debug_error_string = "{"created":"@1601027790.018488379","description":"Failed to pick subchannel","file":"src/core/ext/filters/client_channel/client_channel.cc","file_line":4089,"referenced_errors":[{"created":"@1601027790.018476348","description":"failed to connect to all addresses","file":"src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc","file_line":393,"grpc_status":14}]}"
>
例如,Python 客户端已初始化如下:
import grpc
from service_pb2_grpc import ServiceStub
creds = grpc.ssl_channel_credentials()
with grpc.secure_channel(url, creds) as channel:
grpc_client = ServiceStub(channel)
使用简单客户端时出现此错误我做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.