【发布时间】:2021-11-24 17:41:16
【问题描述】:
我正在尝试通过 Istio HTTPS -> HTTP 配置 TLS 终止。
HTTP 80 工作正常。
HTTPS 443 仅适用于/ 路径。
HTTP 200:
curl https://serviceA.example.com
HTTP 404:
curl https://serviceA.example.com/blabla
Istio 访问日志:
GET /blabla HTTP/2" 404 NR route_not_found
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: serviceA-gateway
namespace: default
spec:
selector:
istio: ingressgateway
servers:
- port:
number: 80
name: HTTP
protocol: HTTP
hosts:
- "serviceA.example.com"
- port:
number: 443
name: https
protocol: HTTPS
tls:
mode: SIMPLE
credentialName: serviceA.example.com
hosts:
- "*"
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: serviceA-swearl
namespace: default
spec:
hosts:
- serviceA.example.com
gateways:
- serviceA-gateway
HTTP:
- route:
- destination:
host: serviceA.default.svc.cluster.local
port:
number: 80
我不确定我做错了什么。通过查看文档,一切都应该正常工作。设置是带有 NLB 的 AWS EKS 上的 ISTIO 运算符。
另外,我在 istio-system 命名空间中有一个证书 - secret。 Service 和 Deployment 有必需的标签。
修复:问题在于我在 Ingress 定义上遇到了问题
pathType: ImplementationSpecific
应该是:
pathType: Prefix
Configure Ingress pathType ImplementationSpecific behavior #26883
【问题讨论】:
标签: http https istio istio-operator