ingressgateway的默認網絡類型是LoadBanlancer,在沒有外部負載均衡的情況下可以修改為NodePort。
1、修改
kubectl patch service istio-ingressgateway -n istio-system -p '{"spec":{"type":"NodePort"}}'
2、查看ID與端口
export INGRESS_HOST=$(kubectl get po -l istio=ingressgateway -n istio-system -o 'jsonpath={.items[0].status.hostIP}') export INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
3、訪問方式
可通過節點的IP+端口訪問,也可以手動掛個LB進來