湖南做網(wǎng)站磐石網(wǎng)絡(luò)案例哈爾濱百度關(guān)鍵詞優(yōu)化
假設(shè)有一個(gè)外部服務(wù),外部服務(wù)ip為:10.10.102.90,其中32033為v1版本,32034為v2版本。
現(xiàn)在需要把這個(gè)服務(wù)引入到istio中,并且需要配置所有訪問該服務(wù)的流量都通過egressgateway轉(zhuǎn)發(fā)出去。
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-gin
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