David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 1 | # Copyright 2019-present Open Networking Foundation |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | --- |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 16 | {{- $root := . }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 17 | apiVersion: v1 |
| 18 | data: |
| 19 | arouter.voltha.json: | |
| 20 | { |
| 21 | "servers": [ |
| 22 | { |
| 23 | "name": "grpc_command", |
| 24 | "port": 55555, |
| 25 | "address": "", |
| 26 | "type": "grpc", |
| 27 | "routers": [ |
| 28 | { |
| 29 | "_TODO": "Suport a router list, remove the package and service from the router", |
| 30 | "package": "voltha", |
| 31 | "service": "VolthaService", |
| 32 | "router": "vcore" |
Scott Baker | be5a646 | 2019-08-22 16:35:15 -0700 | [diff] [blame] | 33 | }, |
| 34 | { |
| 35 | "package": "afrouter", |
| 36 | "service": "Configuration", |
| 37 | "router": "local" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 38 | } |
| 39 | ] |
| 40 | } |
| 41 | ], |
| 42 | "routers": [ |
| 43 | { |
| 44 | "name": "vcore", |
| 45 | "package": "voltha", |
| 46 | "service": "VolthaService", |
Kent Hagerman | 4bb9028 | 2019-08-30 13:11:32 -0400 | [diff] [blame] | 47 | "proto_descriptor": "voltha.pb", |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 48 | "routes": [ |
| 49 | { |
| 50 | "name": "dev_manager", |
| 51 | "proto_descriptor": "voltha.pb", |
| 52 | "type": "rpc_affinity_message", |
| 53 | "association": "round_robin", |
| 54 | "routing_field": "id", |
| 55 | "backend_cluster": "vcore", |
| 56 | "_COMMENT": "Methods here MUST be specified above, this overrides thier default beahvior", |
| 57 | "methods": [ |
| 58 | "CreateDevice", |
| 59 | "GetCoreInstance", |
| 60 | "EnableLogicalDevicePort", |
| 61 | "DisableLogicalDevicePort", |
| 62 | "EnableDevice", |
| 63 | "DisableDevice", |
| 64 | "RebootDevice", |
| 65 | "DeleteDevice", |
| 66 | "DownloadImage", |
| 67 | "CancelImageDownload", |
| 68 | "ActivateImageUpdate", |
| 69 | "RevertImageUpdate", |
| 70 | "UpdateDevicePmConfigs", |
| 71 | "CreateAlarmFilter", |
| 72 | "UpdateAlarmFilter", |
| 73 | "DeleteAlarmFilter", |
| 74 | "SelfTest" |
| 75 | ], |
| 76 | "nb_binding_methods": [ |
| 77 | "CreateDevice" |
| 78 | ], |
| 79 | "_TODO": "Overrides not implemented yet, config ignored", |
| 80 | "overrides": [ ] |
| 81 | }, |
| 82 | { |
Scott Baker | be5a646 | 2019-08-22 16:35:15 -0700 | [diff] [blame] | 83 | "name": "logger", |
| 84 | "proto_descriptor": "voltha.pb", |
| 85 | "type": "source", |
| 86 | "routing_field": "component_name", |
| 87 | "backend_cluster": "ro_vcore", |
| 88 | "methods": [ |
| 89 | "UpdateLogLevel", |
| 90 | "GetLogLevels" |
| 91 | ] |
| 92 | }, |
| 93 | { |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 94 | "name": "read_only", |
| 95 | "type": "round_robin", |
| 96 | "association": "round_robin", |
| 97 | "backend_cluster": "ro_vcore", |
| 98 | "methods": [ |
| 99 | "ListDevicePorts", |
| 100 | "ListDevicePmConfigs", |
| 101 | "GetImages", |
| 102 | "GetImageDownloadStatus", |
| 103 | "GetImageDownload", |
| 104 | "ListImageDownloads", |
| 105 | "ListDeviceFlows", |
| 106 | "ListDeviceFlowGroups", |
| 107 | "ListLogicalDeviceFlows", |
| 108 | "ListLogicalDeviceFlowGroups", |
| 109 | "ListDevices", |
| 110 | "GetDevice", |
| 111 | "ListLogicalDevices", |
| 112 | "GetLogicalDevices", |
| 113 | "GetDeviceType", |
| 114 | "GetDeviceGroup", |
| 115 | "GetLogicalDevice", |
| 116 | "GetAlarmFilter", |
| 117 | "ListLogicalDevicePorts", |
| 118 | "GetLogicalDevicePort", |
| 119 | "ListAdapters", |
| 120 | "GetVoltha" |
| 121 | ] |
| 122 | }, |
| 123 | { |
| 124 | "name": "dev_manager_ofagent", |
| 125 | "type": "binding", |
| 126 | "_association": "round_robin", |
| 127 | "binding": { |
| 128 | "type": "header", |
| 129 | "field": "voltha_backend_name", |
| 130 | "method": "Subscribe", |
| 131 | "association": "round_robin" |
| 132 | }, |
| 133 | "backend_cluster": "vcore", |
| 134 | "methods": [ |
| 135 | "StreamPacketsOut", |
| 136 | "ReceivePacketsIn", |
| 137 | "ReceiveChangeEvents", |
| 138 | "Subscribe", |
| 139 | "UpdateLogicalDeviceFlowTable", |
| 140 | "UpdateLogicalDeviceFlowGroupTable", |
| 141 | "GetLogicalDevice", |
| 142 | "GetLogicalDevicePort", |
| 143 | "EnableLogicalDevicePort", |
| 144 | "DisableLogicalDevicePort", |
| 145 | "ListLogicalDevices", |
| 146 | "ListLogicalDeviceFlows", |
| 147 | "ListLogicalDeviceFlowGroups", |
Scott Baker | 9601c1d | 2019-08-13 15:20:35 -0700 | [diff] [blame] | 148 | "ListLogicalDevicePorts", |
| 149 | "ListLogicalDeviceMeters", |
| 150 | "UpdateLogicalDeviceMeterTable" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 151 | ], |
| 152 | "_TODO": "Overrides not implemented yet, config ignored", |
| 153 | "overrides": [ ] |
| 154 | } |
| 155 | ] |
Scott Baker | be5a646 | 2019-08-22 16:35:15 -0700 | [diff] [blame] | 156 | }, |
| 157 | { |
| 158 | "name": "local", |
| 159 | "package": "afrouter", |
| 160 | "service": "Configuration", |
| 161 | "proto_descriptor": "voltha.pb", |
| 162 | "routes": [ |
| 163 | { |
| 164 | "name": "logger-local", |
| 165 | "proto_descriptor": "voltha.pb", |
| 166 | "type": "source", |
| 167 | "routing_field": "component_name", |
| 168 | "backend_cluster": "api_server", |
| 169 | "methods": [ |
| 170 | "UpdateLogLevel", |
| 171 | "GetLogLevels" |
| 172 | ] |
| 173 | } |
| 174 | ] |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 175 | } |
| 176 | ], |
| 177 | "backend_clusters": [ |
| 178 | { |
| 179 | "name": "vcore", |
| 180 | "backends": [ |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 181 | {{- /* |
| 182 | The conversion of the the recplicas.rw_core (number) to a string |
| 183 | and then back to an int is a work-a-round required for helm |
| 184 | v.2.15. It is currently considered a regression bug in helm |
| 185 | (https://github.com/helm/helm/issues/6708). The need for this |
| 186 | work-a-round should be re-checked against helm occationally and |
| 187 | removed if no longer needed. |
| 188 | */ -}} |
| 189 | {{- range $i, $e := until (int (toString .Values.replicas.rw_core)) }} |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 190 | {{- $cluster := add1 $i }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 191 | { |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 192 | "name": "vcore{{ $cluster }}", |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 193 | "type": "active_active", |
| 194 | "association": { |
| 195 | "strategy": "serial_number", |
| 196 | "location": "header", |
| 197 | "_TODO": "The key below needs to be implemented, currently hard coded", |
| 198 | "key": "voltha_serial_number" |
| 199 | }, |
| 200 | "connections": [ |
| 201 | { |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 202 | "name": "vcore{{ $cluster }}1", |
| 203 | "addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local", |
| 204 | "port": "50057" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 205 | }, |
| 206 | { |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 207 | "name": "vcore{{ $cluster }}2", |
| 208 | "addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local", |
| 209 | "port": "50057" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 210 | } |
| 211 | ] |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 212 | {{- /* |
| 213 | The conversion of the the recplicas.rw_core (number) to a string |
| 214 | and then back to an int is a work-a-round required for helm |
| 215 | v.2.15. It is currently considered a regression bug in helm |
| 216 | (https://github.com/helm/helm/issues/6708). The need for this |
| 217 | work-a-round should be re-checked against helm occationally and |
| 218 | removed if no longer needed. |
| 219 | */ -}} |
| 220 | }{{ if lt $cluster (int (toString $root.Values.replicas.rw_core)) }},{{ end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 221 | {{- end}} |
| 222 | ] |
| 223 | }, |
| 224 | { |
| 225 | "name": "ro_vcore", |
| 226 | "backends": [ |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 227 | {{- /* |
| 228 | The conversion of the the recplicas.rw_core (number) to a string |
| 229 | and then back to an int is a work-a-round required for helm |
| 230 | v.2.15. It is currently considered a regression bug in helm |
| 231 | (https://github.com/helm/helm/issues/6708). The need for this |
| 232 | work-a-round should be re-checked against helm occationally and |
| 233 | removed if no longer needed. |
| 234 | */ -}} |
| 235 | {{- range $core_idx, $e := until (int (toString .Values.replicas.rw_core)) }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 236 | { |
| 237 | "name": "ro_vcore{{ $core_idx }}", |
| 238 | "type": "server", |
| 239 | "connections": [ |
| 240 | { |
| 241 | "name": "ro_vcore{{ $core_idx }}1", |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 242 | "addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local", |
| 243 | "port": "50057" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 244 | } |
| 245 | ] |
David Bainbridge | 03706e6 | 2019-10-18 17:59:24 +0000 | [diff] [blame] | 246 | {{- /* |
| 247 | The conversion of the the recplicas.rw_core (number) to a string |
| 248 | and then back to an int is a work-a-round required for helm |
| 249 | v.2.15. It is currently considered a regression bug in helm |
| 250 | (https://github.com/helm/helm/issues/6708). The need for this |
| 251 | work-a-round should be re-checked against helm occationally and |
| 252 | removed if no longer needed. |
| 253 | */ -}} |
| 254 | }{{ if lt (add1 $core_idx) (int (toString $root.Values.replicas.rw_core)) }},{{ end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 255 | {{- end}} |
| 256 | ] |
Scott Baker | be5a646 | 2019-08-22 16:35:15 -0700 | [diff] [blame] | 257 | }, |
| 258 | { |
| 259 | "_COMMENT": "This allows api-server to route to its own configuration api endpoint", |
| 260 | "name": "api_server", |
| 261 | "backends": [ |
| 262 | { |
| 263 | "name": "api_server0", |
| 264 | "type": "server", |
| 265 | "connections": [ |
| 266 | { |
| 267 | "name": "api_server01", |
| 268 | "addr": "localhost", |
| 269 | "port": "55554" |
| 270 | } |
| 271 | ] |
| 272 | } |
| 273 | ] |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 274 | } |
| 275 | ], |
| 276 | "api": { |
| 277 | "_comment": "If this isn't defined then no api is available for dynamic configuration and queries", |
| 278 | "address": "", |
| 279 | "port": 55554 |
| 280 | } |
| 281 | } |
| 282 | |
| 283 | kind: ConfigMap |
| 284 | metadata: |
| 285 | name: afrouter-config |
| 286 | serviceAccountName: {{ .Values.serviceaccount }} |