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