blob: 669c7116fca888302ff3369c66e5ce772bd9555e [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
David Bainbridgee5887072019-11-14 23:01:01 +000015{{- if not .Values.therecanbeonlyone }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070016---
Kent Hagerman1b333b92019-07-22 16:57:20 -040017{{- $root := . }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -070018apiVersion: v1
19data:
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 Bakerbe5a6462019-08-22 16:35:15 -070034 },
35 {
36 "package": "afrouter",
37 "service": "Configuration",
38 "router": "local"
David Bainbridge2f9b76f2019-05-15 13:48:11 -070039 }
40 ]
41 }
42 ],
43 "routers": [
44 {
45 "name": "vcore",
46 "package": "voltha",
47 "service": "VolthaService",
Kent Hagerman4bb90282019-08-30 13:11:32 -040048 "proto_descriptor": "voltha.pb",
David Bainbridge2f9b76f2019-05-15 13:48:11 -070049 "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 Bakerbe5a6462019-08-22 16:35:15 -070084 "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 Bainbridge2f9b76f2019-05-15 13:48:11 -070095 "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 Baker9601c1d2019-08-13 15:20:35 -0700149 "ListLogicalDevicePorts",
150 "ListLogicalDeviceMeters",
151 "UpdateLogicalDeviceMeterTable"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700152 ],
153 "_TODO": "Overrides not implemented yet, config ignored",
154 "overrides": [ ]
155 }
156 ]
Scott Bakerbe5a6462019-08-22 16:35:15 -0700157 },
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700176 }
177 ],
178 "backend_clusters": [
179 {
180 "name": "vcore",
181 "backends": [
David Bainbridge03706e62019-10-18 17:59:24 +0000182{{- /*
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 Hagerman1b333b92019-07-22 16:57:20 -0400191{{- $cluster := add1 $i }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700192 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400193 "name": "vcore{{ $cluster }}",
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700194 "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 Hagerman1b333b92019-07-22 16:57:20 -0400203 "name": "vcore{{ $cluster }}1",
204 "addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local",
205 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700206 },
207 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400208 "name": "vcore{{ $cluster }}2",
209 "addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local",
210 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700211 }
212 ]
David Bainbridge03706e62019-10-18 17:59:24 +0000213{{- /*
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700222{{- end}}
223 ]
224 },
225 {
226 "name": "ro_vcore",
227 "backends": [
David Bainbridge03706e62019-10-18 17:59:24 +0000228{{- /*
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700237 {
238 "name": "ro_vcore{{ $core_idx }}",
239 "type": "server",
240 "connections": [
241 {
242 "name": "ro_vcore{{ $core_idx }}1",
Kent Hagerman1b333b92019-07-22 16:57:20 -0400243 "addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local",
244 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700245 }
246 ]
David Bainbridge03706e62019-10-18 17:59:24 +0000247{{- /*
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700256{{- end}}
257 ]
Scott Bakerbe5a6462019-08-22 16:35:15 -0700258 },
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 Bainbridge2f9b76f2019-05-15 13:48:11 -0700275 }
276 ],
277 "api": {
278 "_comment": "If this isn't defined then no api is available for dynamic configuration and queries",
279 "address": "",
280 "port": 55554
281 }
282 }
283
284kind: ConfigMap
285metadata:
286 name: afrouter-config
287 serviceAccountName: {{ .Values.serviceaccount }}
David Bainbridgee5887072019-11-14 23:01:01 +0000288{{- end}}