Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 1 | { |
| 2 | "listeners": [ |
| 3 | { |
| 4 | "address": "tcp://0.0.0.0:{{- .HttpsPort }}", |
| 5 | "ssl_context": { |
| 6 | "cert_chain_file": "/envoy/pki/voltha.crt", |
| 7 | "private_key_file": "/envoy/pki/voltha.key", |
| 8 | "ca_cert_file": "/envoy/pik/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:{{- .GrpcPort }}", |
| 85 | "filters": [ |
| 86 | { |
| 87 | "type": "read", |
| 88 | "name": "http_connection_manager", |
| 89 | "config": { |
| 90 | "codec_type": "http2", |
| 91 | "stat_prefix": "ingress_http2", |
| 92 | "access_log": [ |
| 93 | { |
| 94 | "path": "/envoy/voltha_access2_log.log" |
| 95 | } |
| 96 | ], |
| 97 | "route_config": { |
| 98 | "virtual_hosts": [ |
| 99 | { |
| 100 | "name": "backend", |
| 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": "decoder", |
| 135 | "name": "router", |
| 136 | "config": {} |
| 137 | } |
| 138 | ] |
| 139 | } |
| 140 | } |
| 141 | ] |
| 142 | } |
| 143 | ], |
| 144 | "admin": { |
| 145 | "access_log_path": "/envoy/access.log", |
| 146 | "address": "tcp://0.0.0.0:8001" |
| 147 | }, |
| 148 | "cluster_manager": { |
| 149 | "clusters": [ |
| 150 | { |
| 151 | "name": "voltha-grpc", |
| 152 | "connect_timeout_ms": 250, |
| 153 | "type": "static", |
| 154 | "lb_type": "round_robin", |
| 155 | "features": "http2", |
| 156 | "hosts": [ |
Sergio Slobodrian | 1962874 | 2017-09-05 19:52:54 -0400 | [diff] [blame] | 157 | {{block "viplist" .VolthaRR}} |
| 158 | {{- range .}} |
| 159 | {{- if isFirst2}} |
| 160 | {{- printf "{\"url\": \"tcp://%s\"}" . }} |
| 161 | {{- else }} |
| 162 | {{- printf ",{\"url\": \"tcp://%s\"}" . }} |
| 163 | {{- end }} |
| 164 | {{- end}} |
| 165 | {{- end}} |
Sergio Slobodrian | 6570c74 | 2017-08-07 23:11:33 -0400 | [diff] [blame] | 166 | ] |
| 167 | }, |
| 168 | { |
| 169 | "name": "voltha-grpc-RR", |
| 170 | "connect_timeout_ms": 250, |
| 171 | "type": "static", |
| 172 | "lb_type": "round_robin", |
| 173 | "features": "http2", |
| 174 | "hosts": [ |
| 175 | {{block "addrlist" .VolthaRR}} |
| 176 | {{- range .}} |
| 177 | {{- if isFirst}} |
| 178 | {{- printf "{\"url\": \"tcp://%s\"}" . }} |
| 179 | {{- else }} |
| 180 | {{- printf ",{\"url\": \"tcp://%s\"}" . }} |
| 181 | {{- end }} |
| 182 | {{- end}} |
| 183 | {{- end}} |
| 184 | ] |
| 185 | } |
| 186 | ] |
| 187 | } |
| 188 | } |
| 189 | |