blob: eb2eba185d39653ccb1f501574b4f3b1082df8a0 [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"
33 }
34 ]
35 }
36 ],
37 "routers": [
38 {
39 "name": "vcore",
40 "package": "voltha",
41 "service": "VolthaService",
Kent Hagerman4bb90282019-08-30 13:11:32 -040042 "proto_descriptor": "voltha.pb",
David Bainbridge2f9b76f2019-05-15 13:48:11 -070043 "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",
Scott Baker9601c1d2019-08-13 15:20:35 -0700132 "ListLogicalDevicePorts",
133 "ListLogicalDeviceMeters",
134 "UpdateLogicalDeviceMeterTable"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700135 ],
136 "_TODO": "Overrides not implemented yet, config ignored",
137 "overrides": [ ]
138 }
139 ]
140 }
141 ],
142 "backend_clusters": [
143 {
144 "name": "vcore",
145 "backends": [
Kent Hagerman1b333b92019-07-22 16:57:20 -0400146{{- range $i, $e := until (int .Values.replicas.rw_core) }}
147{{- $cluster := add1 $i }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700148 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400149 "name": "vcore{{ $cluster }}",
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700150 "type": "active_active",
151 "association": {
152 "strategy": "serial_number",
153 "location": "header",
154 "_TODO": "The key below needs to be implemented, currently hard coded",
155 "key": "voltha_serial_number"
156 },
157 "connections": [
158 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400159 "name": "vcore{{ $cluster }}1",
160 "addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local",
161 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700162 },
163 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400164 "name": "vcore{{ $cluster }}2",
165 "addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local",
166 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700167 }
168 ]
Kent Hagerman1b333b92019-07-22 16:57:20 -0400169 }{{ if lt $cluster (int $root.Values.replicas.rw_core) }},{{ end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700170{{- end}}
171 ]
172 },
173 {
174 "name": "ro_vcore",
175 "backends": [
Kent Hagerman1b333b92019-07-22 16:57:20 -0400176{{- range $core_idx, $e := until (int .Values.replicas.rw_core) }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700177 {
178 "name": "ro_vcore{{ $core_idx }}",
179 "type": "server",
180 "connections": [
181 {
182 "name": "ro_vcore{{ $core_idx }}1",
Kent Hagerman1b333b92019-07-22 16:57:20 -0400183 "addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local",
184 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700185 }
186 ]
Kent Hagerman1b333b92019-07-22 16:57:20 -0400187 }{{ if lt (add1 $core_idx) (int $root.Values.replicas.rw_core) }},{{ end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700188{{- end}}
189 ]
190 }
191 ],
192 "api": {
193 "_comment": "If this isn't defined then no api is available for dynamic configuration and queries",
194 "address": "",
195 "port": 55554
196 }
197 }
198
199kind: ConfigMap
200metadata:
201 name: afrouter-config
202 serviceAccountName: {{ .Values.serviceaccount }}