blob: 6bbd501d25000775bdc8d967d91067aaef69442a [file] [log] [blame]
# Copyright 2019-present Open Networking Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
{{- if not .Values.therecanbeonlyone }}
---
{{- $root := . }}
apiVersion: v1
data:
arouter.voltha.json: |
{
"servers": [
{
"name": "grpc_command",
"port": 55555,
"address": "",
"type": "grpc",
"routers": [
{
"_TODO": "Suport a router list, remove the package and service from the router",
"package": "voltha",
"service": "VolthaService",
"router": "vcore"
},
{
"package": "afrouter",
"service": "Configuration",
"router": "local"
}
]
}
],
"routers": [
{
"name": "vcore",
"package": "voltha",
"service": "VolthaService",
"proto_descriptor": "voltha.pb",
"routes": [
{
"name": "dev_manager",
"proto_descriptor": "voltha.pb",
"type": "rpc_affinity_message",
"association": "round_robin",
"routing_field": "id",
"backend_cluster": "vcore",
"_COMMENT": "Methods here MUST be specified above, this overrides thier default beahvior",
"methods": [
"CreateDevice",
"GetCoreInstance",
"EnableLogicalDevicePort",
"DisableLogicalDevicePort",
"EnableDevice",
"DisableDevice",
"RebootDevice",
"DeleteDevice",
"DownloadImage",
"CancelImageDownload",
"ActivateImageUpdate",
"RevertImageUpdate",
"UpdateDevicePmConfigs",
"CreateAlarmFilter",
"UpdateAlarmFilter",
"DeleteAlarmFilter",
"SelfTest"
],
"nb_binding_methods": [
"CreateDevice"
],
"_TODO": "Overrides not implemented yet, config ignored",
"overrides": [ ]
},
{
"name": "logger",
"proto_descriptor": "voltha.pb",
"type": "source",
"routing_field": "component_name",
"backend_cluster": "ro_vcore",
"methods": [
"UpdateLogLevel",
"GetLogLevels"
]
},
{
"name": "read_only",
"type": "round_robin",
"association": "round_robin",
"backend_cluster": "ro_vcore",
"methods": [
"ListDevicePorts",
"ListDevicePmConfigs",
"GetImages",
"GetImageDownloadStatus",
"GetImageDownload",
"ListImageDownloads",
"ListDeviceFlows",
"ListDeviceFlowGroups",
"ListLogicalDeviceFlows",
"ListLogicalDeviceFlowGroups",
"ListDevices",
"GetDevice",
"ListLogicalDevices",
"GetLogicalDevices",
"GetDeviceType",
"GetDeviceGroup",
"GetLogicalDevice",
"GetAlarmFilter",
"ListLogicalDevicePorts",
"GetLogicalDevicePort",
"ListAdapters",
"GetVoltha"
]
},
{
"name": "dev_manager_ofagent",
"type": "binding",
"_association": "round_robin",
"binding": {
"type": "header",
"field": "voltha_backend_name",
"method": "Subscribe",
"association": "round_robin"
},
"backend_cluster": "vcore",
"methods": [
"StreamPacketsOut",
"ReceivePacketsIn",
"ReceiveChangeEvents",
"Subscribe",
"UpdateLogicalDeviceFlowTable",
"UpdateLogicalDeviceFlowGroupTable",
"GetLogicalDevice",
"GetLogicalDevicePort",
"EnableLogicalDevicePort",
"DisableLogicalDevicePort",
"ListLogicalDevices",
"ListLogicalDeviceFlows",
"ListLogicalDeviceFlowGroups",
"ListLogicalDevicePorts",
"ListLogicalDeviceMeters",
"UpdateLogicalDeviceMeterTable"
],
"_TODO": "Overrides not implemented yet, config ignored",
"overrides": [ ]
}
]
},
{
"name": "local",
"package": "afrouter",
"service": "Configuration",
"proto_descriptor": "voltha.pb",
"routes": [
{
"name": "logger-local",
"proto_descriptor": "voltha.pb",
"type": "source",
"routing_field": "component_name",
"backend_cluster": "api_server",
"methods": [
"UpdateLogLevel",
"GetLogLevels"
]
}
]
}
],
"backend_clusters": [
{
"name": "vcore",
"backends": [
{{- /*
The conversion of the the recplicas.rw_core (number) to a string
and then back to an int is a work-a-round required for helm
v.2.15. It is currently considered a regression bug in helm
(https://github.com/helm/helm/issues/6708). The need for this
work-a-round should be re-checked against helm occationally and
removed if no longer needed.
*/ -}}
{{- range $i, $e := until (int (toString .Values.replicas.rw_core)) }}
{{- $cluster := add1 $i }}
{
"name": "vcore{{ $cluster }}",
"type": "active_active",
"association": {
"strategy": "serial_number",
"location": "header",
"_TODO": "The key below needs to be implemented, currently hard coded",
"key": "voltha_serial_number"
},
"connections": [
{
"name": "vcore{{ $cluster }}1",
"addr": "voltha-rw-core-{{ $cluster }}1.{{ $root.Release.Namespace }}.svc.cluster.local",
"port": "50057"
},
{
"name": "vcore{{ $cluster }}2",
"addr": "voltha-rw-core-{{ $cluster }}2.{{ $root.Release.Namespace }}.svc.cluster.local",
"port": "50057"
}
]
{{- /*
The conversion of the the recplicas.rw_core (number) to a string
and then back to an int is a work-a-round required for helm
v.2.15. It is currently considered a regression bug in helm
(https://github.com/helm/helm/issues/6708). The need for this
work-a-round should be re-checked against helm occationally and
removed if no longer needed.
*/ -}}
}{{ if lt $cluster (int (toString $root.Values.replicas.rw_core)) }},{{ end }}
{{- end}}
]
},
{
"name": "ro_vcore",
"backends": [
{{- /*
The conversion of the the recplicas.rw_core (number) to a string
and then back to an int is a work-a-round required for helm
v.2.15. It is currently considered a regression bug in helm
(https://github.com/helm/helm/issues/6708). The need for this
work-a-round should be re-checked against helm occationally and
removed if no longer needed.
*/ -}}
{{- range $core_idx, $e := until (int (toString .Values.replicas.rw_core)) }}
{
"name": "ro_vcore{{ $core_idx }}",
"type": "server",
"connections": [
{
"name": "ro_vcore{{ $core_idx }}1",
"addr": "voltha-ro-core-{{ $core_idx }}.voltha-ro-core.{{ $root.Release.Namespace }}.svc.cluster.local",
"port": "50057"
}
]
{{- /*
The conversion of the the recplicas.rw_core (number) to a string
and then back to an int is a work-a-round required for helm
v.2.15. It is currently considered a regression bug in helm
(https://github.com/helm/helm/issues/6708). The need for this
work-a-round should be re-checked against helm occationally and
removed if no longer needed.
*/ -}}
}{{ if lt (add1 $core_idx) (int (toString $root.Values.replicas.rw_core)) }},{{ end }}
{{- end}}
]
},
{
"_COMMENT": "This allows api-server to route to its own configuration api endpoint",
"name": "api_server",
"backends": [
{
"name": "api_server0",
"type": "server",
"connections": [
{
"name": "api_server01",
"addr": "localhost",
"port": "55554"
}
]
}
]
}
],
"api": {
"_comment": "If this isn't defined then no api is available for dynamic configuration and queries",
"address": "",
"port": 55554,
"probeHost": "",
"probePort": 8080
}
}
kind: ConfigMap
metadata:
name: afrouter-config
serviceAccountName: {{ .Values.serviceaccount }}
{{- end}}