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": [ |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 181 | {{- range $i, $e := until (int .Values.replicas.rw_core) }} |
| 182 | {{- $cluster := add1 $i }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 183 | { |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 184 | "name": "vcore{{ $cluster }}", |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 185 | "type": "active_active", |
| 186 | "association": { |
| 187 | "strategy": "serial_number", |
| 188 | "location": "header", |
| 189 | "_TODO": "The key below needs to be implemented, currently hard coded", |
| 190 | "key": "voltha_serial_number" |
| 191 | }, |
| 192 | "connections": [ |
| 193 | { |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 194 | "name": "vcore{{ $cluster }}1", |
| 195 | "addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local", |
| 196 | "port": "50057" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 197 | }, |
| 198 | { |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 199 | "name": "vcore{{ $cluster }}2", |
| 200 | "addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local", |
| 201 | "port": "50057" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 202 | } |
| 203 | ] |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 204 | }{{ if lt $cluster (int $root.Values.replicas.rw_core) }},{{ end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 205 | {{- end}} |
| 206 | ] |
| 207 | }, |
| 208 | { |
| 209 | "name": "ro_vcore", |
| 210 | "backends": [ |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 211 | {{- range $core_idx, $e := until (int .Values.replicas.rw_core) }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 212 | { |
| 213 | "name": "ro_vcore{{ $core_idx }}", |
| 214 | "type": "server", |
| 215 | "connections": [ |
| 216 | { |
| 217 | "name": "ro_vcore{{ $core_idx }}1", |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 218 | "addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local", |
| 219 | "port": "50057" |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 220 | } |
| 221 | ] |
Kent Hagerman | 1b333b9 | 2019-07-22 16:57:20 -0400 | [diff] [blame] | 222 | }{{ if lt (add1 $core_idx) (int $root.Values.replicas.rw_core) }},{{ end }} |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 223 | {{- end}} |
| 224 | ] |
Scott Baker | be5a646 | 2019-08-22 16:35:15 -0700 | [diff] [blame] | 225 | }, |
| 226 | { |
| 227 | "_COMMENT": "This allows api-server to route to its own configuration api endpoint", |
| 228 | "name": "api_server", |
| 229 | "backends": [ |
| 230 | { |
| 231 | "name": "api_server0", |
| 232 | "type": "server", |
| 233 | "connections": [ |
| 234 | { |
| 235 | "name": "api_server01", |
| 236 | "addr": "localhost", |
| 237 | "port": "55554" |
| 238 | } |
| 239 | ] |
| 240 | } |
| 241 | ] |
David Bainbridge | 2f9b76f | 2019-05-15 13:48:11 -0700 | [diff] [blame] | 242 | } |
| 243 | ], |
| 244 | "api": { |
| 245 | "_comment": "If this isn't defined then no api is available for dynamic configuration and queries", |
| 246 | "address": "", |
| 247 | "port": 55554 |
| 248 | } |
| 249 | } |
| 250 | |
| 251 | kind: ConfigMap |
| 252 | metadata: |
| 253 | name: afrouter-config |
| 254 | serviceAccountName: {{ .Values.serviceaccount }} |