Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 1 | { |
| 2 | "listeners": [ |
| 3 | { |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 4 | "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 Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 40 | "prefix": "/voltha.HealthService", |
| 41 | "cluster": "voltha-grpc" |
| 42 | }, |
| 43 | { |
| 44 | "timeout_ms": 0, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 45 | "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 Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 63 | "services": ["voltha.VolthaGlobalService","voltha.HealthService","schema.SchemaService"], |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 64 | "print_options": { |
| 65 | "add_whitespace": false, |
Sergio Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 66 | "always_print_primitive_fields": true, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 67 | "always_print_enums_as_ints": false, |
Sergio Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 68 | "preserve_proto_field_names": true |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 69 | |
| 70 | } |
| 71 | } |
| 72 | }, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 73 | { |
| 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 Slobodrian | 6e270c1 | 2017-08-09 23:06:49 -0400 | [diff] [blame] | 100 | "name": "backend3", |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 101 | "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 Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 115 | "prefix": "/voltha.HealthService", |
| 116 | "cluster": "voltha-grpc" |
| 117 | }, |
| 118 | { |
| 119 | "timeout_ms": 0, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 120 | "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 Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 138 | "services": ["voltha.VolthaGlobalService","voltha.HealthService","schema.SchemaService"], |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 139 | "print_options": { |
| 140 | "add_whitespace": false, |
Sergio Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 141 | "always_print_primitive_fields": true, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 142 | "always_print_enums_as_ints": false, |
Sergio Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 143 | "preserve_proto_field_names": true |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 144 | |
| 145 | } |
| 146 | } |
| 147 | }, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 148 | { |
| 149 | "type": "decoder", |
| 150 | "name": "router", |
| 151 | "config": {} |
| 152 | } |
| 153 | ] |
| 154 | } |
| 155 | } |
| 156 | ] |
| 157 | }, |
| 158 | { |
| 159 | "address": "tcp://0.0.0.0:{{- .GrpcPort }}", |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 160 | "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 Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 169 | "path": "/envoy/voltha_access2_log.log" |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 170 | } |
| 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 Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 190 | "prefix": "/voltha.HealthService", |
| 191 | "cluster": "voltha-grpc" |
| 192 | }, |
| 193 | { |
| 194 | "timeout_ms": 0, |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 195 | "prefix": "/voltha.", |
| 196 | "cluster": "voltha-grpc" |
Sergio Slobodrian | 58adc12 | 2017-07-31 14:36:42 -0400 | [diff] [blame] | 197 | }, |
| 198 | { |
| 199 | "timeout_ms": 0, |
| 200 | "prefix": "/schema.SchemaService", |
| 201 | "cluster": "voltha-grpc" |
Sergio Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 202 | } |
| 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 Slobodrian | 9c874d4 | 2017-09-05 12:58:07 -0400 | [diff] [blame] | 232 | {{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 Slobodrian | be82927 | 2017-07-17 14:45:45 -0400 | [diff] [blame] | 241 | ] |
| 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 | |