-
Notifications
You must be signed in to change notification settings - Fork 62
/
Copy pathbookinfo-gateway.yaml
71 lines (70 loc) · 1.88 KB
/
bookinfo-gateway.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
#
# A simple example of a gateway for the bookinfo app.
#
---
apiVersion: networking.istio.io/v1alpha3
kind: Gateway
metadata:
name: bookinfo-gateway
spec:
selector:
istio: ingressgateway # use istio default controller
servers:
- port:
number: 443
name: https-443
protocol: HTTPS
hosts:
- "*"
tls:
mode: SIMPLE
credentialName: ingress-tls-cert
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: bookinfo
spec:
hosts:
- "*"
gateways:
- bookinfo-gateway
http:
- match:
- uri:
# Allow the Authentication Request Callback to get routed to productpage so it can be intercepted by the authservice
prefix: /productpage/oauth
- uri:
# Allow the authservice logout request to get routed to productpage so it can be intercepted by the authservice
exact: /authservice_logout
- uri:
exact: /productpage
- uri:
prefix: /static
- uri:
exact: /login
- uri:
exact: /logout
- uri:
prefix: /api/v1/
route:
- destination:
host: productpage
port:
number: 9080
---
# Add a DestinationRule to enable session affinity, which ensures that the requests from the same user-agent reach
# the same instance of productpage, and hence, the same instance of Sidecar and Authservice. This is required when you
# deploy multiple instances of productpage because Authservice currently only supports in-memory session storage.
apiVersion: networking.istio.io/v1alpha3
kind: DestinationRule
metadata:
name: bookinfo-dest-rule
spec:
host: productpage.default.svc.cluster.local
trafficPolicy:
loadBalancer:
consistentHash:
httpCookie:
name: bookinfo-session-affinity-cookie
ttl: 0s