【发布时间】:2021-03-04 18:32:15
【问题描述】:
我在 AKS 上有一个带有默认入口网关的示例 istio 集群。一切都按预期工作我只是想了解如何。网关定义如下:
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: my-gateway
namespace: some-config-namespace
spec:
selector:
app: istio-ingressgateway
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:
- uk.bookinfo.com
- eu.bookinfo.com
tls:
httpsRedirect: true # sends 301 redirect for http requests
- port:
number: 443
name: https-443
protocol: HTTPS
hosts:
- uk.bookinfo.com
- eu.bookinfo.com
tls:
mode: SIMPLE # enables HTTPS on this port
serverCertificate: /etc/certs/servercert.pem
privateKey: /etc/certs/privatekey.pem
通过https://uk.bookinfo.com 访问该站点可以正常工作。但是,当我查看进入 ingressgateway pod 的 LB 和服务时,我看到了:
LB-IP:443 -> CLUSTER-IP:443 -> istio-ingressgateway:8443
kind: Service
spec:
ports:
- name: http2
protocol: TCP
port: 80
targetPort: 8080
nodePort: 30804
- name: https
protocol: TCP
port: 443
targetPort: 8443
nodePort: 31843
selector:
app: istio-ingressgateway
istio: ingressgateway
clusterIP: 10.2.138.74
type: LoadBalancer
由于 istio-ingressgateway pod 的 targetPort 是 8443,那么将端口号定义为 443 的网关定义如何工作?
【问题讨论】:
标签: kubernetes istio envoyproxy