blob: 1b57d5dabbe86e01a6fd4accd3a35f9b9d743cde [file] [log] [blame]
David Bainbridge2f9b76f2019-05-15 13:48:11 -07001# 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 Hagerman1b333b92019-07-22 16:57:20 -040016{{- $root := . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070017apiVersion: v1
18data:
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 Bakerbe5a6462019-08-22 16:35:15 -070033 },
34 {
35 "package": "afrouter",
36 "service": "Configuration",
37 "router": "local"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070038 }
39 ]
40 }
41 ],
42 "routers": [
43 {
44 "name": "vcore",
45 "package": "voltha",
46 "service": "VolthaService",
Kent Hagerman4bb90282019-08-30 13:11:32 -040047 "proto_descriptor": "voltha.pb",
David Bainbridge2f9b76f2019-05-15 13:48:11 -070048 "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 Bakerbe5a6462019-08-22 16:35:15 -070083 "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 Bainbridge2f9b76f2019-05-15 13:48:11 -070094 "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 Baker9601c1d2019-08-13 15:20:35 -0700148 "ListLogicalDevicePorts",
149 "ListLogicalDeviceMeters",
150 "UpdateLogicalDeviceMeterTable"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700151 ],
152 "_TODO": "Overrides not implemented yet, config ignored",
153 "overrides": [ ]
154 }
155 ]
Scott Bakerbe5a6462019-08-22 16:35:15 -0700156 },
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700175 }
176 ],
177 "backend_clusters": [
178 {
179 "name": "vcore",
180 "backends": [
David Bainbridge03706e62019-10-18 17:59:24 +0000181{{- /*
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 Hagerman1b333b92019-07-22 16:57:20 -0400190{{- $cluster := add1 $i }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700191 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400192 "name": "vcore{{ $cluster }}",
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700193 "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 Hagerman1b333b92019-07-22 16:57:20 -0400202 "name": "vcore{{ $cluster }}1",
203 "addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local",
204 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700205 },
206 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400207 "name": "vcore{{ $cluster }}2",
208 "addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local",
209 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700210 }
211 ]
David Bainbridge03706e62019-10-18 17:59:24 +0000212{{- /*
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700221{{- end}}
222 ]
223 },
224 {
225 "name": "ro_vcore",
226 "backends": [
David Bainbridge03706e62019-10-18 17:59:24 +0000227{{- /*
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700236 {
237 "name": "ro_vcore{{ $core_idx }}",
238 "type": "server",
239 "connections": [
240 {
241 "name": "ro_vcore{{ $core_idx }}1",
Kent Hagerman1b333b92019-07-22 16:57:20 -0400242 "addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local",
243 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700244 }
245 ]
David Bainbridge03706e62019-10-18 17:59:24 +0000246{{- /*
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700255{{- end}}
256 ]
Scott Bakerbe5a6462019-08-22 16:35:15 -0700257 },
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700274 }
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
283kind: ConfigMap
284metadata:
285 name: afrouter-config
286 serviceAccountName: {{ .Values.serviceaccount }}