您的位置:首页 > 财经 > 产业 > 长春市网络品牌推广_开鲁网站seo站长工具_网络营销技巧培训班_宁波优化seo软件公司

长春市网络品牌推广_开鲁网站seo站长工具_网络营销技巧培训班_宁波优化seo软件公司

2024/10/7 1:32:53 来源:https://blog.csdn.net/LONG_Yi_1994/article/details/142317899  浏览:    关键词:长春市网络品牌推广_开鲁网站seo站长工具_网络营销技巧培训班_宁波优化seo软件公司
长春市网络品牌推广_开鲁网站seo站长工具_网络营销技巧培训班_宁波优化seo软件公司

假设有一个外部服务,外部服务ip为:10.10.102.90,其中32033为v1版本,32034为v2版本。

现在需要把这个服务引入到istio中,并且需要配置所有访问该服务的流量都通过egressgateway转发出去。

serviceentry

apiVersion: networking.istio.io/v1beta1
kind: ServiceEntry
metadata:name: gin-service-entry
spec:endpoints:- address: 10.10.102.90labels:version: v1ports:http: 32033- address: 10.10.102.90labels:version: v2ports:http: 32034hosts:- gin.test.chlocation: MESH_EXTERNALports:- name: httpnumber: 80protocol: HTTPresolution: STATIC

gateway

apiVersion: networking.istio.io/v1beta1
kind: Gateway
metadata:name: gin-egressgateway
spec:selector:istio: egressgatewayservers:- port:number: 80name: httpprotocol: HTTPhosts:- gin.test.ch

dr

apiVersion: networking.istio.io/v1beta1
kind: DestinationRule
metadata:name: egressgateway-for-ginnamespace: istio-system
spec:host: istio-egressgateway-1-19-6.istio-system.svc.cluster.localsubsets:- name: gin

vs

apiVersion: networking.istio.io/v1beta1
kind: VirtualService
metadata:name: direct-gin-through-egress-gateway
spec:gateways:- gin-egressgateway- meshhosts:- gin.test.chhttp:- match:- gateways:- meshport: 80route:- destination:host: istio-egressgateway-1-19-6.istio-system.svc.cluster.localport:number: 80subset: ginweight: 100- match:- gateways:- gin-egressgatewayport: 80route:- destination:host: gin.test.chport:number: 80weight: 100

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com