部署istio的ingressGateway时,
把istio的IngressGateway理解为 k8s的ingressController
把Gateway理解为 k8s的ingress规则
将k8s的Service通过VirtualService映射到Gateway
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: test-gateway
namespace: test
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 80
name: http
protocol: HTTP
hosts:- "*"
通过 DestinationRule 来定义不同版本,在istio称为 子集subsets。
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: test-destinationrule
namespace: test
spec:
host: test-service
trafficPolicy:
tls:
mode: ISTIO_MUTUAL
subsets:
- name: v1
labels:
version: v1 - name: v2
labels:
version: v2