这里我用的域名是 diynocap.com 准备好证书
kubectl create -n istio-system secret tls istio-ingressgateway-certs --key private.key --cert cert.pem
然后修改 gateway
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: nginx-gateway
namespace: lizhe
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 443
name: https
protocol: HTTPS
hosts:
- "diynocap.com"
- "diynocap2.com"
tls:
mode: SIMPLE
serverCertificate: /etc/istio/ingressgateway-certs/tls.crt
privateKey: /etc/istio/ingressgateway-certs/tls.key
需要设置对应的 hostport端口或者使用nodeport