Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 1 | { |
| 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, |
| 35 | "prefix": "/voltha.", |
| 36 | "cluster": "voltha-grpc" |
| 37 | }, |
| 38 | { |
| 39 | "timeout_ms": 0, |
| 40 | "prefix": "/schema.SchemaService", |
| 41 | "cluster": "voltha-grpc" |
| 42 | } |
| 43 | ] |
| 44 | } |
| 45 | ] |
| 46 | }, |
| 47 | "filters": [ |
| 48 | { |
| 49 | "type": "both", |
| 50 | "name": "grpc_json_transcoder", |
| 51 | "config": { |
| 52 | "proto_descriptor": "/envoy/proto.pb", |
| 53 | "services": ["voltha.VolthaGlobalService"], |
| 54 | "print_options": { |
| 55 | "add_whitespace": false, |
| 56 | "always_print_primitive_fields": false, |
| 57 | "always_print_enums_as_ints": false, |
| 58 | "preserve_proto_field_names": false |
| 59 | |
| 60 | } |
| 61 | } |
| 62 | }, |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 63 | { |
| 64 | "type": "decoder", |
| 65 | "name": "router", |
| 66 | "config": {} |
| 67 | } |
| 68 | ] |
| 69 | } |
| 70 | } |
| 71 | ] |
| 72 | }, |
| 73 | { |
| 74 | "address": "tcp://0.0.0.0:{{- .GrpcPort }}", |
| 75 | "filters": [ |
| 76 | { |
| 77 | "type": "read", |
| 78 | "name": "http_connection_manager", |
| 79 | "config": { |
| 80 | "codec_type": "http2", |
| 81 | "stat_prefix": "ingress_http2", |
| 82 | "access_log": [ |
| 83 | { |
| 84 | "path": "/envoy/voltha_access2_log.log" |
| 85 | } |
| 86 | ], |
| 87 | "route_config": { |
| 88 | "virtual_hosts": [ |
| 89 | { |
| 90 | "name": "backend", |
| 91 | "domains": ["*"], |
| 92 | "routes": [ |
| 93 | { |
| 94 | "timeout_ms": 0, |
| 95 | "prefix": "/voltha.VolthaGlobalService/CreateDevice", |
| 96 | "cluster": "voltha-grpc-RR" |
| 97 | }, |
| 98 | { |
| 99 | "timeout_ms": 0, |
| 100 | "prefix": "/voltha.VolthaGlobalService", |
| 101 | "cluster": "voltha-grpc" |
| 102 | }, |
| 103 | { |
| 104 | "timeout_ms": 0, |
| 105 | "prefix": "/voltha.", |
| 106 | "cluster": "voltha-grpc" |
| 107 | }, |
| 108 | { |
| 109 | "timeout_ms": 0, |
| 110 | "prefix": "/schema.SchemaService", |
| 111 | "cluster": "voltha-grpc" |
| 112 | } |
| 113 | ] |
| 114 | } |
| 115 | ] |
| 116 | }, |
| 117 | "filters": [ |
| 118 | { |
| 119 | "type": "decoder", |
| 120 | "name": "router", |
| 121 | "config": {} |
| 122 | } |
| 123 | ] |
| 124 | } |
| 125 | } |
| 126 | ] |
| 127 | } |
| 128 | ], |
| 129 | "admin": { |
| 130 | "access_log_path": "/envoy/access.log", |
| 131 | "address": "tcp://0.0.0.0:8001" |
| 132 | }, |
| 133 | "cluster_manager": { |
| 134 | "clusters": [ |
| 135 | { |
| 136 | "name": "voltha-grpc", |
| 137 | "connect_timeout_ms": 250, |
| 138 | "type": "static", |
| 139 | "lb_type": "round_robin", |
| 140 | "features": "http2", |
| 141 | "hosts": [ |
| 142 | { |
| 143 | "url": "tcp://{{- .VolthaVip }}" |
| 144 | } |
| 145 | ] |
| 146 | }, |
| 147 | { |
| 148 | "name": "voltha-grpc-RR", |
| 149 | "connect_timeout_ms": 250, |
| 150 | "type": "static", |
| 151 | "lb_type": "round_robin", |
| 152 | "features": "http2", |
| 153 | "hosts": [ |
| 154 | {{block "addrlist" .VolthaRR}} |
| 155 | {{- range .}} |
| 156 | {{- if isFirst}} |
| 157 | {{- printf "{\"url\": \"tcp://%s\"}" . }} |
| 158 | {{- else }} |
| 159 | {{- printf ",{\"url\": \"tcp://%s\"}" . }} |
| 160 | {{- end }} |
| 161 | {{- end}} |
| 162 | {{- end}} |
| 163 | ] |
| 164 | } |
| 165 | ] |
| 166 | } |
| 167 | } |
| 168 | |