blob: 230eafea58098583ac8734d09abc0e3aab3ee86c [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",
42 "routes": [
43 {
44 "name": "dev_manager",
45 "proto_descriptor": "voltha.pb",
46 "type": "rpc_affinity_message",
47 "association": "round_robin",
48 "routing_field": "id",
49 "backend_cluster": "vcore",
50 "_COMMENT": "Methods here MUST be specified above, this overrides thier default beahvior",
51 "methods": [
52 "CreateDevice",
53 "GetCoreInstance",
54 "EnableLogicalDevicePort",
55 "DisableLogicalDevicePort",
56 "EnableDevice",
57 "DisableDevice",
58 "RebootDevice",
59 "DeleteDevice",
60 "DownloadImage",
61 "CancelImageDownload",
62 "ActivateImageUpdate",
63 "RevertImageUpdate",
64 "UpdateDevicePmConfigs",
65 "CreateAlarmFilter",
66 "UpdateAlarmFilter",
67 "DeleteAlarmFilter",
68 "SelfTest"
69 ],
70 "nb_binding_methods": [
71 "CreateDevice"
72 ],
73 "_TODO": "Overrides not implemented yet, config ignored",
74 "overrides": [ ]
75 },
76 {
77 "name": "read_only",
78 "type": "round_robin",
79 "association": "round_robin",
80 "backend_cluster": "ro_vcore",
81 "methods": [
82 "ListDevicePorts",
83 "ListDevicePmConfigs",
84 "GetImages",
85 "GetImageDownloadStatus",
86 "GetImageDownload",
87 "ListImageDownloads",
88 "ListDeviceFlows",
89 "ListDeviceFlowGroups",
90 "ListLogicalDeviceFlows",
91 "ListLogicalDeviceFlowGroups",
92 "ListDevices",
93 "GetDevice",
94 "ListLogicalDevices",
95 "GetLogicalDevices",
96 "GetDeviceType",
97 "GetDeviceGroup",
98 "GetLogicalDevice",
99 "GetAlarmFilter",
100 "ListLogicalDevicePorts",
101 "GetLogicalDevicePort",
102 "ListAdapters",
103 "GetVoltha"
104 ]
105 },
106 {
107 "name": "dev_manager_ofagent",
108 "type": "binding",
109 "_association": "round_robin",
110 "binding": {
111 "type": "header",
112 "field": "voltha_backend_name",
113 "method": "Subscribe",
114 "association": "round_robin"
115 },
116 "backend_cluster": "vcore",
117 "methods": [
118 "StreamPacketsOut",
119 "ReceivePacketsIn",
120 "ReceiveChangeEvents",
121 "Subscribe",
122 "UpdateLogicalDeviceFlowTable",
123 "UpdateLogicalDeviceFlowGroupTable",
124 "GetLogicalDevice",
125 "GetLogicalDevicePort",
126 "EnableLogicalDevicePort",
127 "DisableLogicalDevicePort",
128 "ListLogicalDevices",
129 "ListLogicalDeviceFlows",
130 "ListLogicalDeviceFlowGroups",
131 "ListLogicalDevicePorts"
132 ],
133 "_TODO": "Overrides not implemented yet, config ignored",
134 "overrides": [ ]
135 }
136 ]
137 }
138 ],
139 "backend_clusters": [
140 {
141 "name": "vcore",
142 "backends": [
Kent Hagerman1b333b92019-07-22 16:57:20 -0400143{{- range $i, $e := until (int .Values.replicas.rw_core) }}
144{{- $cluster := add1 $i }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700145 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400146 "name": "vcore{{ $cluster }}",
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700147 "type": "active_active",
148 "association": {
149 "strategy": "serial_number",
150 "location": "header",
151 "_TODO": "The key below needs to be implemented, currently hard coded",
152 "key": "voltha_serial_number"
153 },
154 "connections": [
155 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400156 "name": "vcore{{ $cluster }}1",
157 "addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local",
158 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700159 },
160 {
Kent Hagerman1b333b92019-07-22 16:57:20 -0400161 "name": "vcore{{ $cluster }}2",
162 "addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local",
163 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700164 }
165 ]
Kent Hagerman1b333b92019-07-22 16:57:20 -0400166 }{{ if lt $cluster (int $root.Values.replicas.rw_core) }},{{ end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700167{{- end}}
168 ]
169 },
170 {
171 "name": "ro_vcore",
172 "backends": [
Kent Hagerman1b333b92019-07-22 16:57:20 -0400173{{- range $core_idx, $e := until (int .Values.replicas.rw_core) }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700174 {
175 "name": "ro_vcore{{ $core_idx }}",
176 "type": "server",
177 "connections": [
178 {
179 "name": "ro_vcore{{ $core_idx }}1",
Kent Hagerman1b333b92019-07-22 16:57:20 -0400180 "addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local",
181 "port": "50057"
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700182 }
183 ]
Kent Hagerman1b333b92019-07-22 16:57:20 -0400184 }{{ if lt (add1 $core_idx) (int $root.Values.replicas.rw_core) }},{{ end }}
David Bainbridge2f9b76f2019-05-15 13:48:11 -0700185{{- end}}
186 ]
187 }
188 ],
189 "api": {
190 "_comment": "If this isn't defined then no api is available for dynamic configuration and queries",
191 "address": "",
192 "port": 55554
193 }
194 }
195
196kind: ConfigMap
197metadata:
198 name: afrouter-config
199 serviceAccountName: {{ .Values.serviceaccount }}