blob: 5ba984fcf42f3da77c3b44f19468c59584f6817d [file] [log] [blame]
Sergio Slobodrianbe829272017-07-17 14:45:45 -04001{
2 "listeners": [
3 {
Sergio Slobodrian6570c742017-08-07 23:11:33 -04004 "address": "tcp://0.0.0.0:{{- .HttpsPort }}",
5 "ssl_context": {
6 "cert_chain_file": "/envoy/voltha.crt",
7 "private_key_file": "/envoy/voltha.key",
8 "ca_cert_file": "/envoy/voltha-CA.pem"
9 },
10 "filters": [
11 {
12 "type": "read",
13 "name": "http_connection_manager",
14 "config": {
15 "codec_type": "http1",
16 "stat_prefix": "ingress_http1",
17 "access_log": [
18 {
19 "path": "/envoy/voltha_access1_log.log"
20 }
21 ],
22 "route_config": {
23 "virtual_hosts": [
24 {
25 "name": "backend2",
26 "domains": ["*"],
27 "routes": [
28 {
29 "timeout_ms": 0,
30 "prefix": "/voltha.VolthaGlobalService/CreateDevice",
31 "cluster": "voltha-grpc-RR"
32 },
33 {
34 "timeout_ms": 0,
35 "prefix": "/voltha.VolthaGlobalService",
36 "cluster": "voltha-grpc"
37 },
38 {
39 "timeout_ms": 0,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040040 "prefix": "/voltha.HealthService",
41 "cluster": "voltha-grpc"
42 },
43 {
44 "timeout_ms": 0,
Sergio Slobodrian6570c742017-08-07 23:11:33 -040045 "prefix": "/voltha.",
46 "cluster": "voltha-grpc"
47 },
48 {
49 "timeout_ms": 0,
50 "prefix": "/schema.SchemaService",
51 "cluster": "voltha-grpc"
52 }
53 ]
54 }
55 ]
56 },
57 "filters": [
58 {
59 "type": "both",
60 "name": "grpc_json_transcoder",
61 "config": {
62 "proto_descriptor": "/envoy/proto.pb",
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040063 "services": ["voltha.VolthaGlobalService","voltha.HealthService","schema.SchemaService"],
Sergio Slobodrian6570c742017-08-07 23:11:33 -040064 "print_options": {
65 "add_whitespace": false,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040066 "always_print_primitive_fields": true,
Sergio Slobodrian6570c742017-08-07 23:11:33 -040067 "always_print_enums_as_ints": false,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040068 "preserve_proto_field_names": true
Sergio Slobodrian6570c742017-08-07 23:11:33 -040069
70 }
71 }
72 },
Sergio Slobodrian6570c742017-08-07 23:11:33 -040073 {
74 "type": "decoder",
75 "name": "router",
76 "config": {}
77 }
78 ]
79 }
80 }
81 ]
82 },
83 {
84 "address": "tcp://0.0.0.0:{{- .HttpPort }}",
85 "filters": [
86 {
87 "type": "read",
88 "name": "http_connection_manager",
89 "config": {
90 "codec_type": "http1",
91 "stat_prefix": "ingress_http1",
92 "access_log": [
93 {
94 "path": "/envoy/voltha_access1_log.log"
95 }
96 ],
97 "route_config": {
98 "virtual_hosts": [
99 {
Sergio Slobodrian6e270c12017-08-09 23:06:49 -0400100 "name": "backend3",
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400101 "domains": ["*"],
102 "routes": [
103 {
104 "timeout_ms": 0,
105 "prefix": "/voltha.VolthaGlobalService/CreateDevice",
106 "cluster": "voltha-grpc-RR"
107 },
108 {
109 "timeout_ms": 0,
110 "prefix": "/voltha.VolthaGlobalService",
111 "cluster": "voltha-grpc"
112 },
113 {
114 "timeout_ms": 0,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400115 "prefix": "/voltha.HealthService",
116 "cluster": "voltha-grpc"
117 },
118 {
119 "timeout_ms": 0,
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400120 "prefix": "/voltha.",
121 "cluster": "voltha-grpc"
122 },
123 {
124 "timeout_ms": 0,
125 "prefix": "/schema.SchemaService",
126 "cluster": "voltha-grpc"
127 }
128 ]
129 }
130 ]
131 },
132 "filters": [
133 {
134 "type": "both",
135 "name": "grpc_json_transcoder",
136 "config": {
137 "proto_descriptor": "/envoy/proto.pb",
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400138 "services": ["voltha.VolthaGlobalService","voltha.HealthService","schema.SchemaService"],
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400139 "print_options": {
140 "add_whitespace": false,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400141 "always_print_primitive_fields": true,
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400142 "always_print_enums_as_ints": false,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400143 "preserve_proto_field_names": true
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400144
145 }
146 }
147 },
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400148 {
149 "type": "decoder",
150 "name": "router",
151 "config": {}
152 }
153 ]
154 }
155 }
156 ]
157 },
158 {
159 "address": "tcp://0.0.0.0:{{- .GrpcPort }}",
Sergio Slobodrianbe829272017-07-17 14:45:45 -0400160 "filters": [
161 {
162 "type": "read",
163 "name": "http_connection_manager",
164 "config": {
165 "codec_type": "http2",
166 "stat_prefix": "ingress_http2",
167 "access_log": [
168 {
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400169 "path": "/envoy/voltha_access2_log.log"
Sergio Slobodrianbe829272017-07-17 14:45:45 -0400170 }
171 ],
172 "route_config": {
173 "virtual_hosts": [
174 {
175 "name": "backend",
176 "domains": ["*"],
177 "routes": [
178 {
179 "timeout_ms": 0,
180 "prefix": "/voltha.VolthaGlobalService/CreateDevice",
181 "cluster": "voltha-grpc-RR"
182 },
183 {
184 "timeout_ms": 0,
185 "prefix": "/voltha.VolthaGlobalService",
186 "cluster": "voltha-grpc"
187 },
188 {
189 "timeout_ms": 0,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400190 "prefix": "/voltha.HealthService",
191 "cluster": "voltha-grpc"
192 },
193 {
194 "timeout_ms": 0,
Sergio Slobodrianbe829272017-07-17 14:45:45 -0400195 "prefix": "/voltha.",
196 "cluster": "voltha-grpc"
Sergio Slobodrian58adc122017-07-31 14:36:42 -0400197 },
198 {
199 "timeout_ms": 0,
200 "prefix": "/schema.SchemaService",
201 "cluster": "voltha-grpc"
Sergio Slobodrianbe829272017-07-17 14:45:45 -0400202 }
203 ]
204 }
205 ]
206 },
207 "filters": [
208 {
209 "type": "decoder",
210 "name": "router",
211 "config": {}
212 }
213 ]
214 }
215 }
216 ]
217 }
218 ],
219 "admin": {
220 "access_log_path": "/envoy/access.log",
221 "address": "tcp://0.0.0.0:8001"
222 },
223 "cluster_manager": {
224 "clusters": [
225 {
226 "name": "voltha-grpc",
227 "connect_timeout_ms": 250,
228 "type": "static",
229 "lb_type": "round_robin",
230 "features": "http2",
231 "hosts": [
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400232 {{block "viplist" .VolthaRR}}
233 {{- range .}}
234 {{- if isFirst2}}
235 {{- printf "{\"url\": \"tcp://%s\"}" . }}
236 {{- else }}
237 {{- printf ",{\"url\": \"tcp://%s\"}" . }}
238 {{- end }}
239 {{- end}}
240 {{- end}}
Sergio Slobodrianbe829272017-07-17 14:45:45 -0400241 ]
242 },
243 {
244 "name": "voltha-grpc-RR",
245 "connect_timeout_ms": 250,
246 "type": "static",
247 "lb_type": "round_robin",
248 "features": "http2",
249 "hosts": [
250 {{block "addrlist" .VolthaRR}}
251 {{- range .}}
252 {{- if isFirst}}
253 {{- printf "{\"url\": \"tcp://%s\"}" . }}
254 {{- else }}
255 {{- printf ",{\"url\": \"tcp://%s\"}" . }}
256 {{- end }}
257 {{- end}}
258 {{- end}}
259 ]
260 }
261 ]
262 }
263}
264