blob: 7c8e6b1c998755ef5bb66a9d05bdb862b333719f [file] [log] [blame]
Sergio Slobodrian6570c742017-08-07 23:11:33 -04001{
2 "listeners": [
3 {
4 "address": "tcp://0.0.0.0:{{- .HttpPort }}",
5 "filters": [
6 {
7 "type": "read",
8 "name": "http_connection_manager",
9 "config": {
10 "codec_type": "http1",
11 "stat_prefix": "ingress_http1",
12 "access_log": [
13 {
14 "path": "/envoy/voltha_access1_log.log"
15 }
16 ],
17 "route_config": {
18 "virtual_hosts": [
19 {
20 "name": "backend2",
21 "domains": ["*"],
22 "routes": [
23 {
24 "timeout_ms": 0,
25 "prefix": "/voltha.VolthaGlobalService/CreateDevice",
26 "cluster": "voltha-grpc-RR"
27 },
28 {
29 "timeout_ms": 0,
30 "prefix": "/voltha.VolthaGlobalService",
31 "cluster": "voltha-grpc"
32 },
33 {
34 "timeout_ms": 0,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040035 "prefix": "/voltha.HealthService",
36 "cluster": "voltha-grpc"
37 },
38 {
39 "timeout_ms": 0,
Sergio Slobodrian6570c742017-08-07 23:11:33 -040040 "prefix": "/voltha.",
41 "cluster": "voltha-grpc"
42 },
43 {
44 "timeout_ms": 0,
45 "prefix": "/schema.SchemaService",
46 "cluster": "voltha-grpc"
47 }
48 ]
49 }
50 ]
51 },
52 "filters": [
53 {
54 "type": "both",
55 "name": "grpc_json_transcoder",
56 "config": {
57 "proto_descriptor": "/envoy/proto.pb",
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040058 "services": ["voltha.VolthaGlobalService","voltha.HealthService","schema.SchemaService"],
Sergio Slobodrian6570c742017-08-07 23:11:33 -040059 "print_options": {
60 "add_whitespace": false,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040061 "always_print_primitive_fields": true,
Sergio Slobodrian6570c742017-08-07 23:11:33 -040062 "always_print_enums_as_ints": false,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -040063 "preserve_proto_field_names": true
Sergio Slobodrian6570c742017-08-07 23:11:33 -040064
65 }
66 }
67 },
Sergio Slobodrian6570c742017-08-07 23:11:33 -040068 {
69 "type": "decoder",
70 "name": "router",
71 "config": {}
72 }
73 ]
74 }
75 }
76 ]
77 },
78 {
79 "address": "tcp://0.0.0.0:{{- .GrpcPort }}",
80 "filters": [
81 {
82 "type": "read",
83 "name": "http_connection_manager",
84 "config": {
85 "codec_type": "http2",
86 "stat_prefix": "ingress_http2",
87 "access_log": [
88 {
89 "path": "/envoy/voltha_access2_log.log"
90 }
91 ],
92 "route_config": {
93 "virtual_hosts": [
94 {
95 "name": "backend",
96 "domains": ["*"],
97 "routes": [
98 {
99 "timeout_ms": 0,
100 "prefix": "/voltha.VolthaGlobalService/CreateDevice",
101 "cluster": "voltha-grpc-RR"
102 },
103 {
104 "timeout_ms": 0,
105 "prefix": "/voltha.VolthaGlobalService",
106 "cluster": "voltha-grpc"
107 },
108 {
109 "timeout_ms": 0,
Sergio Slobodrian9c874d42017-09-05 12:58:07 -0400110 "prefix": "/voltha.HealthService",
111 "cluster": "voltha-grpc"
112 },
113 {
114 "timeout_ms": 0,
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400115 "prefix": "/voltha.",
116 "cluster": "voltha-grpc"
117 },
118 {
119 "timeout_ms": 0,
120 "prefix": "/schema.SchemaService",
121 "cluster": "voltha-grpc"
122 }
123 ]
124 }
125 ]
126 },
127 "filters": [
128 {
129 "type": "decoder",
130 "name": "router",
131 "config": {}
132 }
133 ]
134 }
135 }
136 ]
137 }
138 ],
139 "admin": {
140 "access_log_path": "/envoy/access.log",
141 "address": "tcp://0.0.0.0:8001"
142 },
143 "cluster_manager": {
144 "clusters": [
145 {
146 "name": "voltha-grpc",
147 "connect_timeout_ms": 250,
148 "type": "static",
149 "lb_type": "round_robin",
150 "features": "http2",
151 "hosts": [
Sergio Slobodrian19628742017-09-05 19:52:54 -0400152 {{block "viplist" .VolthaRR}}
153 {{- range .}}
154 {{- if isFirst2}}
155 {{- printf "{\"url\": \"tcp://%s\"}" . }}
156 {{- else }}
157 {{- printf ",{\"url\": \"tcp://%s\"}" . }}
158 {{- end }}
159 {{- end}}
160 {{- end}}
Sergio Slobodrian6570c742017-08-07 23:11:33 -0400161 ]
162 },
163 {
164 "name": "voltha-grpc-RR",
165 "connect_timeout_ms": 250,
166 "type": "static",
167 "lb_type": "round_robin",
168 "features": "http2",
169 "hosts": [
170 {{block "addrlist" .VolthaRR}}
171 {{- range .}}
172 {{- if isFirst}}
173 {{- printf "{\"url\": \"tcp://%s\"}" . }}
174 {{- else }}
175 {{- printf ",{\"url\": \"tcp://%s\"}" . }}
176 {{- end }}
177 {{- end}}
178 {{- end}}
179 ]
180 }
181 ]
182 }
183}
184