Kubernetes TLS匹配必须至少有一个SNI主机
此处引用bookinfo yaml: 我的网关看起来像:Kubernetes TLS匹配必须至少有一个SNI主机,kubernetes,kubernetes-ingress,istio,azure-aks,Kubernetes,Kubernetes Ingress,Istio,Azure Aks,此处引用bookinfo yaml: 我的网关看起来像: apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: bookinfo-gateway spec: selector: istio: ingressgateway # use istio default controller servers: - port: name: https number: 443
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: bookinfo-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
name: https
number: 443
protocol: https
tls:
mode: PASSTHROUGH
hosts:
- "*"
将其配置为从所有主机接受https。但是,在VirtualService中,我希望实现基于URL匹配的路由。这就是我当前的VS配置
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo
spec:
hosts:
- "*"
gateways:
- bookinfo-gateway
tls:
- match:
- uri:
prefix: /productpage
- port: 443
sniHosts:
- "*"
route:
- destination:
host: productpage
port:
number: 9080
部署时失败,错误为“TLS匹配必须至少有一个SNI主机”。如果我删除uri匹配条件,那么相同的VS配置也会起作用
有没有一种方法可以在保留通用主机的同时为TLS提供基于URI匹配的路由(因为我的主机很常见,我需要根据url前缀路由到特定的应用)?在Istio中,VirtualService TLS match不包含基于URI的路由()。TLS是一种不透明连接,只能执行基于主机的路由(因为主机名存在于客户端hello tcp握手中) 为了实现基于路径的路由,您需要将TLS终止为网关级别,并基于http执行路由。HTTP消息是透明消息,其中可以由istio或任何其他中间层应用L7路由 另一种选择是使用nginx或任何其他反向代理(执行ssl终止并将调用直接路由到appropirate服务)。简言之,为了执行基于L7的路由(基于路径的路由),您需要解密请求(TLS终止),无论是在istio端还是在应用程序端完成