[英]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.