我尝试使用SSL设置一个aws负载均衡器(ELB),按照#6566的指示
证书附在ELB上。
然而,当我试图在浏览器上访问我们的网页时,我遇到了“上游连接错误或头前断开/重置。重置原因:连接终止”的问题。
我们的设置没有SSL之前就已经开始工作了。
我使用自定义values.yaml安装istio (helm模板):
helm template ./istio/install/kubernetes/helm/istio --name istio \
--namespace istio-system --values ./mesh/values.yaml | kubectl apply -f -我已经将下面的注释插入到gateways标记中:
istio-ingressgateway:
serviceAnnotations:
service.beta.kubernetes.io/aws-load-balancer-ssl-cert: "arn:aws:acm:ap-southeast-1:xxxxx:certificate/my-crt"
service.beta.kubernetes.io/aws-load-balancer-backend-protocol: "http"
service.beta.kubernetes.io/aws-load-balancer-ssl-ports: "https"这是我的gateway.yaml:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-gateway
spec:
selector:
istio: ingressgateway #default istio ingressgateway
servers:
- port:
number: 80
name: http-istio-gateway
protocol: HTTP
hosts:
- "*"
tls:
httpsRedirect: true
- port:
number: 443
name: https-istio-gateway
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: api-gateway
spec:
gateways:
- istio-gateway
hosts:
- "*"
http:
- match:
- uri:
prefix: /socket.io/
route:
- destination:
host: api-gateway-ws.default.svc.cluster.local
port:
number: 5001
- match:
- uri:
prefix: /
route:
- destination:
host: api-gateway.default.svc.cluster.local
port:
number: 5000发布于 2020-02-28 22:09:28
我遇到了同样的错误,但问题不同。服务端口需要添加一个名称。https://github.com/istio/istio/issues/19966。它们需要遵循https://istio.io/docs/ops/deployment/requirements/格式(协议后缀)。
ports:
- name: https # Use http or https
protocol: TCP
port: 8080
targetPort: 8080发布于 2019-05-21 04:01:37
我已经通过更新网关清单解决了这个问题。不确定为什么在添加多个“匹配”时会出现错误。
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: istio-gateway
spec:
selector:
istio: ingressgateway #default istio ingressgateway
servers:
- port:
number: 80
name: http-istio-gateway
protocol: HTTP
hosts:
- "*"
tls:
httpsRedirect: true
- port:
number: 443
name: https-istio-gateway
protocol: HTTP
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: api-gateway
spec:
gateways:
- istio-gateway
hosts:
- "*"
http:
- match:
- uri:
prefix: "/socket.io"
route:
- destination:
host: api-gateway-ws.default.svc.cluster.local
port:
number: 5001
websocketUpgrade: true
- route:
- destination:
host: api-gateway.default.svc.cluster.local
port:
number: 5000发布于 2020-08-06 14:10:04
这很可能是因为在DOCKER中运行的应用程序与在DOCKER配置中公开的端口不匹配。
Docker文件EXPOSE <PORT>应该与启动应用程序的端口相同。
Istio侵入网关可以绑定到容器端口,但不能与应用程序通信。
https://devops.stackexchange.com/questions/8167
复制相似问题