-
Notifications
You must be signed in to change notification settings - Fork 2
/
default_routing_demo.yaml
85 lines (85 loc) · 1.62 KB
/
default_routing_demo.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
kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: my-tutorial
namespace: my-smcp
spec:
to:
kind: Service
name: istio-ingressgateway
weight: 100
port:
targetPort: 8080
wildcardPolicy: None
---
kind: Gateway
apiVersion: networking.istio.io/v1alpha3
metadata:
name: customer-gateway
namespace: my-tutorial
spec:
servers:
- hosts:
- my-tutorial-my-smcp.apps.cluster-e7a6.e7a6.sandbox1459.opentlc.com
port:
name: http
number: 80
protocol: HTTP
selector:
istio: ingressgateway
---
kind: VirtualService
apiVersion: networking.istio.io/v1alpha3
metadata:
name: customer
namespace: my-tutorial
spec:
hosts:
- customer
- recommendation
- my-tutorial-my-smcp.apps.cluster-e7a6.e7a6.sandbox1459.opentlc.com
gateways:
- customer-gateway
http:
- match:
- uri:
exact: /customer
rewrite:
uri: /
route:
- destination:
host: customer
port:
number: 8080
- match:
- uri:
exact: /recommendation
rewrite:
uri: /
route:
- destination:
host: recommendation
subset: v1
weight: 80
- destination:
host: recommendation
subset: v2
weight: 20
---
kind: DestinationRule
apiVersion: networking.istio.io/v1alpha3
metadata:
name: recommendation
namespace: my-tutorial
spec:
host: recommendation
subsets:
- labels:
version: v1
name: v1
- labels:
version: v2
name: v2
- labels:
version: v3
name: v3