blob: a29c6e3da557afd26a56835c33bef04a7882e701 [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---
16{{- $rw_count := mul .Values.replicas.rw_core 2 | int }}
17{{- $ro_count := .Values.replicas.ro_core | int }}
18apiVersion: 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"
34 }
35 ]
36 }
37 ],
38 "routers": [
39 {
40 "name": "vcore",
41 "package": "voltha",
42 "service": "VolthaService",
43 "routes": [
44 {
45 "name": "dev_manager",
46 "proto_descriptor": "voltha.pb",
47 "type": "rpc_affinity_message",
48 "association": "round_robin",
49 "routing_field": "id",
50 "backend_cluster": "vcore",
51 "_COMMENT": "Methods here MUST be specified above, this overrides thier default beahvior",
52 "methods": [
53 "CreateDevice",
54 "GetCoreInstance",
55 "EnableLogicalDevicePort",
56 "DisableLogicalDevicePort",
57 "EnableDevice",
58 "DisableDevice",
59 "RebootDevice",
60 "DeleteDevice",
61 "DownloadImage",
62 "CancelImageDownload",
63 "ActivateImageUpdate",
64 "RevertImageUpdate",
65 "UpdateDevicePmConfigs",
66 "CreateAlarmFilter",
67 "UpdateAlarmFilter",
68 "DeleteAlarmFilter",
69 "SelfTest"
70 ],
71 "nb_binding_methods": [
72 "CreateDevice"
73 ],
74 "_TODO": "Overrides not implemented yet, config ignored",
75 "overrides": [ ]
76 },
77 {
78 "name": "read_only",
79 "type": "round_robin",
80 "association": "round_robin",
81 "backend_cluster": "ro_vcore",
82 "methods": [
83 "ListDevicePorts",
84 "ListDevicePmConfigs",
85 "GetImages",
86 "GetImageDownloadStatus",
87 "GetImageDownload",
88 "ListImageDownloads",
89 "ListDeviceFlows",
90 "ListDeviceFlowGroups",
91 "ListLogicalDeviceFlows",
92 "ListLogicalDeviceFlowGroups",
93 "ListDevices",
94 "GetDevice",
95 "ListLogicalDevices",
96 "GetLogicalDevices",
97 "GetDeviceType",
98 "GetDeviceGroup",
99 "GetLogicalDevice",
100 "GetAlarmFilter",
101 "ListLogicalDevicePorts",
102 "GetLogicalDevicePort",
103 "ListAdapters",
104 "GetVoltha"
105 ]
106 },
107 {
108 "name": "dev_manager_ofagent",
109 "type": "binding",
110 "_association": "round_robin",
111 "binding": {
112 "type": "header",
113 "field": "voltha_backend_name",
114 "method": "Subscribe",
115 "association": "round_robin"
116 },
117 "backend_cluster": "vcore",
118 "methods": [
119 "StreamPacketsOut",
120 "ReceivePacketsIn",
121 "ReceiveChangeEvents",
122 "Subscribe",
123 "UpdateLogicalDeviceFlowTable",
124 "UpdateLogicalDeviceFlowGroupTable",
125 "GetLogicalDevice",
126 "GetLogicalDevicePort",
127 "EnableLogicalDevicePort",
128 "DisableLogicalDevicePort",
129 "ListLogicalDevices",
130 "ListLogicalDeviceFlows",
131 "ListLogicalDeviceFlowGroups",
132 "ListLogicalDevicePorts"
133 ],
134 "_TODO": "Overrides not implemented yet, config ignored",
135 "overrides": [ ]
136 }
137 ]
138 }
139 ],
140 "backend_clusters": [
141 {
142 "name": "vcore",
143 "backends": [
144{{- range $i, $e := until $rw_count }}
145{{- $core_idx := add $i 1 }}
146 {
147 "name": "vcore{{ $core_idx }}",
148 "type": "active_active",
149 "association": {
150 "strategy": "serial_number",
151 "location": "header",
152 "_TODO": "The key below needs to be implemented, currently hard coded",
153 "key": "voltha_serial_number"
154 },
155 "connections": [
156 {
157 "name": "vcore{{ $core_idx }}1",
158 "addr": "",
159 "port": ""
160 },
161 {
162 "name": "vcore{{ $core_idx }}2",
163 "addr": "",
164 "port": ""
165 }
166 ]
167 }{{ if lt $core_idx $rw_count }},{{ end }}
168{{- end}}
169 ]
170 },
171 {
172 "name": "ro_vcore",
173 "backends": [
174{{- range $i, $e := until $ro_count }}
175{{- $core_idx := add $i 1 }}
176 {
177 "name": "ro_vcore{{ $core_idx }}",
178 "type": "server",
179 "connections": [
180 {
181 "name": "ro_vcore{{ $core_idx }}1",
182 "addr": "",
183 "port": ""
184 }
185 ]
186 }{{ if lt $core_idx $ro_count }},{{ end }}
187{{- end}}
188 ]
189 }
190 ],
191 "api": {
192 "_comment": "If this isn't defined then no api is available for dynamic configuration and queries",
193 "address": "",
194 "port": 55554
195 }
196 }
197
198kind: ConfigMap
199metadata:
200 name: afrouter-config
201 serviceAccountName: {{ .Values.serviceaccount }}