-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path3.1-virtual-gateway-selection.yaml
102 lines (102 loc) · 3.03 KB
/
3.1-virtual-gateway-selection.yaml
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
##################################################
# Test Name: Vitual Host Virtual Gateway Selection
# Test Number: 3.1
# Test Description:
# - Select each gateway individually with separate virtual hosts
##################################################
apiVersion: networking.mesh.gloo.solo.io/v1
kind: VirtualMesh
metadata:
name: virtual-mesh
namespace: gloo-mesh
spec:
federation: # Enable automatic federation of all services to all clusters
selectors:
- {}
meshes:
- name: istiod-istio-system-cluster1
namespace: gloo-mesh
- name: istiod-istio-system-cluster2
namespace: gloo-mesh
---
apiVersion: networking.enterprise.mesh.gloo.solo.io/v1beta1
kind: VirtualGateway
metadata:
name: ingress-cluster1
namespace: gloo-mesh
spec:
ingressGatewaySelectors:
- portName: http2 # match on port name http2
destinationSelectors: # select single specific kubernetes services
- kubeServiceRefs:
services:
- name: istio-ingressgateway # select cluster1 ingress gateway service
namespace: istio-system
clusterName: cluster1
connectionHandlers:
- http:
routeConfig:
- virtualHostSelector: # delegate routing to virtual hosts with label gateway: cluster1
labels:
gateway: cluster1
---
apiVersion: networking.enterprise.mesh.gloo.solo.io/v1beta1
kind: VirtualGateway
metadata:
name: ingress-cluster2
namespace: gloo-mesh
spec:
ingressGatewaySelectors:
- portName: http2 # match on port name http2
destinationSelectors: # select single specific kubernetes services
- kubeServiceRefs:
services:
- name: istio-ingressgateway # select cluster1 ingress gateway service
namespace: istio-system
clusterName: cluster2
connectionHandlers:
- http:
routeConfig:
- virtualHostSelector: # delegate routing to virtual hosts with label gateway: cluster2
labels:
gateway: cluster2
---
apiVersion: networking.enterprise.mesh.gloo.solo.io/v1beta1
kind: VirtualHost
metadata:
name: frontend
namespace: gloo-mesh
labels: # applies to ingress-cluster1 virtualGateway
gateway: cluster1
spec:
domains:
- api.solo.io
routes:
- name: frontend
routeAction:
destinations:
- kubeService:
clusterName: cluster1 # route to cluster1 frontend
name: frontend
namespace: app
port: 8080
---
apiVersion: networking.enterprise.mesh.gloo.solo.io/v1beta1
kind: VirtualHost
metadata:
name: frontend
namespace: gloo-mesh
labels: # applies to ingress-cluster2 virtualGateway
gateway: cluster2
spec:
domains:
- api.solo.io
routes:
- name: frontend
routeAction:
destinations:
- kubeService:
clusterName: cluster2 # route to cluster2 frontend
name: frontend
namespace: app
port: 8080