
serviceentry:也可以访问外部服务。
gateway简介
L4-L6的负载均衡
提供对外的mtls
在istio网格中,gateway可以部署任意多个,可以共用一个,也可以每个租户,namespace单独隔离。
1 2 3 4 5 6 7 8 9 10 11 12 13 14
| apiVersion: networking.istio.io/v1alpha3 kind: Gateway metadata: name: bookinfo-gateway spec: selector: istio: ingressgateway servers: - port: number: 80 name: http protocol: HTTP hosts: - bookinfo.com
|
VirtualService定义gateway L7路由,为访问bookinfo.com的http流量,提供路由匹配转发策略。
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: bookinfo spec: hosts: - bookinfo.com gateways: - bookinfo-gateway http: - match: - uri: exact: /productpage - uri: prefix: /static - uri: exact: /login - uri: exact: /logout - uri: prefix: /api/v1/products route: - destination: host: productpage port: number: 9080
|
kubernetes Ingress vs Isito gateway

gateway原理及实现
1 2 3 4 5 6 7 8 9 10 11
| pilot-agent - args: - proxy - router - --domain - $(POD_NAMESPACE).svc.cluster.local - --proxyLogLevel=warning - --proxyComponentLogLevel=misc:error - --log_output_level=default:info - --serviceCluster - istio-ingressgateway
|