-
Notifications
You must be signed in to change notification settings - Fork 1
/
chat-svc.yaml
122 lines (115 loc) · 2.15 KB
/
chat-svc.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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
apiVersion: apps/v1
kind: Deployment
metadata:
labels:
app: chat-svc
name: chat-svc
namespace: default
spec:
replicas: 1
selector:
matchLabels:
app: chat-svc
strategy:
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
type: RollingUpdate
template:
metadata:
labels:
app: chat-svc
spec:
containers:
- image: gcr.io/cloud-native-madison/chat-svc:0.1.2
imagePullPolicy: IfNotPresent
name: chat-svc
ports:
- containerPort: 9000
name: grpc
protocol: TCP
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 30
---
apiVersion: v1
kind: Service
metadata:
name: chat-svc
labels:
app: chat-svc
spec:
ports:
- port: 9000
name: grpc
protocol: TCP
targetPort: 9000
selector:
app: chat-svc
---
apiVersion: networking.istio.io/v1alpha3
kind: EnvoyFilter
metadata:
name: chat-svc-grpc-web-filter
spec:
workloadLabels:
app: chat-svc
filters:
- listenerMatch:
listenerType: SIDECAR_INBOUND
listenerProtocol: HTTP
insertPosition:
index: FIRST
filterType: HTTP
filterName: "envoy.grpc_web"
filterConfig: {}
---
apiVersion: networking.istio.io/v1alpha3
kind: VirtualService
metadata:
name: chat-svc
namespace: default
labels:
app: chat-svc
spec:
gateways:
- chat-gateway
hosts:
- chat-svc
- chat.kurtspace.com
http:
- match:
- uri:
prefix: /v1.chat.ChatService
route:
- destination:
host: chat-svc
port:
number: 9000
corsPolicy:
allowOrigin:
- '*'
allowCredentials: true
allowHeaders:
- grpc-timeout
- content-type
- keep-alive
- user-agent
- cache-control
- content-type
- content-transfer-encoding
- custom-header-1
- x-accept-content-transfer-encoding
- x-accept-response-streaming
- x-user-agent
- x-grpc-web
allowMethods:
- POST
- GET
- OPTIONS
- PUT
- DELETE
exposeHeaders:
- custom-header-1
- grpc-status
- grpc-message