[VOL-1615] Create VOLTHA 2.0 Helm Charts
Squashed version of David Bainbridge's patches at commit:
https://github.com/ciena/voltha-helm-charts/commit/120fb4b719e0492e6a0a24cc78d08b806e3698fa
Linted the README, fixed whitespace and incubator repo address
Change-Id: I7c5b1c3478450bbefbed09a75e9029e6371cae3a
diff --git a/voltha/templates/10-rbac.yaml b/voltha/templates/10-rbac.yaml
new file mode 100644
index 0000000..430f842
--- /dev/null
+++ b/voltha/templates/10-rbac.yaml
@@ -0,0 +1,72 @@
+# 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.
+
+---
+apiVersion: v1
+kind: ServiceAccount
+metadata:
+ name: voltha-serviceaccount
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRole
+metadata:
+ name: pod-reader
+rules:
+ - apiGroups: [""]
+ resources: ["pods", "nodes"]
+ verbs: ["get", "watch", "list"]
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: Role
+metadata:
+ name: voltha-role
+ namespace: {{ .Release.Namespace }}
+rules:
+ - apiGroups: [""]
+ resources: ["pods", "secrets", "namespaces", "endpoints"]
+ verbs: ["get"]
+ - apiGroups: [""]
+ resources: ["configmaps"]
+ verbs: ["get", "update", "create"]
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: RoleBinding
+metadata:
+ name: voltha-role-nisa-binding
+ namespace: {{ .Release.Namespace }}
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: Role
+ name: voltha-role
+subjects:
+ - kind: ServiceAccount
+ name: voltha-serviceaccount
+ namespace: {{ .Release.Namespace }}
+
+---
+apiVersion: rbac.authorization.k8s.io/v1beta1
+kind: ClusterRoleBinding
+metadata:
+ name: voltha-clusterrole-nisa-binding
+roleRef:
+ apiGroup: rbac.authorization.k8s.io
+ kind: ClusterRole
+ name: pod-reader
+subjects:
+ - kind: ServiceAccount
+ name: voltha-serviceaccount
+ namespace: {{ .Release.Namespace }}
diff --git a/voltha/templates/affinity-router.yaml b/voltha/templates/affinity-router.yaml
new file mode 100644
index 0000000..ab8b4b2
--- /dev/null
+++ b/voltha/templates/affinity-router.yaml
@@ -0,0 +1,71 @@
+# 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.
+
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: voltha-api
+ serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+ serviceAccountName: {{ .Values.serviceaccount }}
+ ports:
+ - name: grpc
+ port: 55555
+ targetPort: 55555
+ selector:
+ app: voltha-api-server
+
+---
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ name: voltha-api-server
+ serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+ replicas: {{ .Values.replicas.afrouter }}
+ template:
+ metadata:
+ labels:
+ app: voltha-api-server
+ annotations:
+ cni: "calico"
+ spec:
+ serviceAccountName: {{ .Values.serviceaccount }}
+ containers:
+ - name: arouter
+ image: {{ .Values.registry }}{{ .Values.images.afrouter.repository }}:{{ tpl .Values.images.afrouter.tag . }}
+ imagePullPolicy: {{ .Values.images.afrouter.pullPolicy }}
+ volumeMounts:
+ - name: config-volume
+ mountPath: /app/config
+ ports:
+ - containerPort: 55555
+ env:
+ - name: POD_NAMESPACE
+ value: {{ .Release.Namespace }}
+ command: ["/app/afrouter"]
+ args: ["-config", "/app/config/arouter.voltha.json"]
+ - name: arouterd
+ env:
+ - name: POD_NAMESPACE
+ value: {{ .Release.Namespace }}
+ image: {{ .Values.registry }}{{ .Values.images.afrouterd.repository }}:{{ tpl .Values.images.afrouterd.tag . }}
+ imagePullPolicy: {{ .Values.images.afrouterd.pullPolicy }}
+ command: ["/app/arouterd"]
+ restartPolicy: Always
+ volumes:
+ - name: config-volume
+ configMap:
+ name: afrouter-config
diff --git a/voltha/templates/afrouter-config.yaml b/voltha/templates/afrouter-config.yaml
new file mode 100644
index 0000000..a29c6e3
--- /dev/null
+++ b/voltha/templates/afrouter-config.yaml
@@ -0,0 +1,201 @@
+# 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.
+
+---
+{{- $rw_count := mul .Values.replicas.rw_core 2 | int }}
+{{- $ro_count := .Values.replicas.ro_core | int }}
+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"
+ }
+ ]
+ }
+ ],
+ "routers": [
+ {
+ "name": "vcore",
+ "package": "voltha",
+ "service": "VolthaService",
+ "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": "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"
+ ],
+ "_TODO": "Overrides not implemented yet, config ignored",
+ "overrides": [ ]
+ }
+ ]
+ }
+ ],
+ "backend_clusters": [
+ {
+ "name": "vcore",
+ "backends": [
+{{- range $i, $e := until $rw_count }}
+{{- $core_idx := add $i 1 }}
+ {
+ "name": "vcore{{ $core_idx }}",
+ "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{{ $core_idx }}1",
+ "addr": "",
+ "port": ""
+ },
+ {
+ "name": "vcore{{ $core_idx }}2",
+ "addr": "",
+ "port": ""
+ }
+ ]
+ }{{ if lt $core_idx $rw_count }},{{ end }}
+{{- end}}
+ ]
+ },
+ {
+ "name": "ro_vcore",
+ "backends": [
+{{- range $i, $e := until $ro_count }}
+{{- $core_idx := add $i 1 }}
+ {
+ "name": "ro_vcore{{ $core_idx }}",
+ "type": "server",
+ "connections": [
+ {
+ "name": "ro_vcore{{ $core_idx }}1",
+ "addr": "",
+ "port": ""
+ }
+ ]
+ }{{ if lt $core_idx $ro_count }},{{ end }}
+{{- end}}
+ ]
+ }
+ ],
+ "api": {
+ "_comment": "If this isn't defined then no api is available for dynamic configuration and queries",
+ "address": "",
+ "port": 55554
+ }
+ }
+
+kind: ConfigMap
+metadata:
+ name: afrouter-config
+ serviceAccountName: {{ .Values.serviceaccount }}
diff --git a/voltha/templates/cli.yaml b/voltha/templates/cli.yaml
new file mode 100644
index 0000000..244c4ca
--- /dev/null
+++ b/voltha/templates/cli.yaml
@@ -0,0 +1,64 @@
+# 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 .Values.replicas.cli }}
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: voltha-cli
+ serviceAccountName: {{ .Values.serviceaccount }}
+ labels:
+ name: vcli
+spec:
+ serviceAccountName: {{ .Values.serviceaccount }}
+ ports:
+ - name: ssh
+ port: 5022
+ targetPort: 22
+ selector:
+ app: vcli
+
+---
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ name: voltha-cli-server
+ serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+ replicas: {{ .Values.replicas.cli }}
+ template:
+ metadata:
+ labels:
+ app: vcli
+ annotations:
+ cni: "calico"
+ spec:
+ serviceAccountName: {{ .Values.serviceaccount }}
+ containers:
+ - name: vcli
+ image: {{ .Values.registry }}{{ .Values.images.cli.repository }}:{{ tpl .Values.images.cli.tag . }}
+ imagePullPolicy: {{ .Values.images.cli.pullPolicy }}
+ env:
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ args:
+ - "/voltha/python/cli/setup.sh"
+ - "-g voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
+ ports:
+ - containerPort: 22
+ name: ssh-port
+{{- end}}
diff --git a/voltha/templates/ofagent.yaml b/voltha/templates/ofagent.yaml
new file mode 100644
index 0000000..2dd9e74
--- /dev/null
+++ b/voltha/templates/ofagent.yaml
@@ -0,0 +1,43 @@
+# 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.
+
+---
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ name: ofagent
+ serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+ replicas: {{ .Values.replicas.ofagent }}
+ template:
+ metadata:
+ labels:
+ app: ofagent
+ annotations:
+ cni: "calico"
+ spec:
+ terminationGracePeriodSeconds: 10
+ serviceAccountName: {{ .Values.serviceaccount }}
+ containers:
+ - name: ofagent
+ image: {{ .Values.registry }}{{ .Values.images.ofagent.repository }}:{{ tpl .Values.images.ofagent.tag . }}
+ imagePullPolicy: {{ .Values.images.ofagent.pullPolicy }}
+ env:
+ - name: CONTROLLER_SERVICE
+ value: "{{ .Values.services.controller.service }}:{{ .Values.services.controller.port }}"
+ args:
+ - "/ofagent/ofagent/main.py"
+ - "-v"
+ - "--controller=$(CONTROLLER_SERVICE)"
+ - "--grpc-endpoint=voltha-api.{{ .Release.Namespace }}.svc.cluster.local:55555"
diff --git a/voltha/templates/ro-core.yaml b/voltha/templates/ro-core.yaml
new file mode 100644
index 0000000..8225e00
--- /dev/null
+++ b/voltha/templates/ro-core.yaml
@@ -0,0 +1,73 @@
+# 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.
+
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: ro-core
+ serviceAccountName: {{ .Values.serviceaccount }}
+spec:
+ replicas: {{ .Values.replicas.ro_core }}
+ selector:
+ matchLabels:
+ app: ro-core
+ template:
+ metadata:
+ labels:
+ app: ro-core
+ annotations:
+ cni: "calico"
+ spec:
+ affinity:
+ podAntiAffinity:
+ preferredDuringSchedulingIgnoredDuringExecution:
+ - weight: 100
+ podAffinityTerm:
+ labelSelector:
+ matchExpressions:
+ - key: app
+ operator: In
+ values:
+ - ro-core
+ topologyKey: "kubernetes.io/hostname"
+ serviceAccountName: {{ .Values.serviceaccount }}
+ containers:
+ - name: voltha
+ image: {{ .Values.registry }}{{ .Values.images.ro_core.repository }}:{{ tpl .Values.images.ro_core.tag . }}
+ imagePullPolicy: {{ .Values.images.ro_core.pullPolicy }}
+ env:
+ - name: NAMESPACE
+ value: {{ quote .Release.Namespace }}
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: ETCD_SERVICE
+ value: {{ quote .Values.services.etcd.service }}
+ - name: ETCD_SERVICE_PORT
+ value: {{ quote .Values.services.etcd.port }}
+ args:
+ - "/app/ro_core"
+ - "-kv_store_type=etcd"
+ - "-kv_store_host=$(ETCD_SERVICE)"
+ - "-kv_store_port=$(ETCD_SERVICE_PORT)"
+ - "-grpc_host=$(POD_IP)"
+ - "-grpc_port=50057"
+ - "-banner=true"
+ - "-ro_core_topic=rocore"
+ - "-log_level=0"
+ ports:
+ - containerPort: 50057
+ name: grpc-port
diff --git a/voltha/templates/rw-core.yaml b/voltha/templates/rw-core.yaml
new file mode 100644
index 0000000..4dd0e06
--- /dev/null
+++ b/voltha/templates/rw-core.yaml
@@ -0,0 +1,95 @@
+# 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.
+
+{{- $root := . -}}
+{{- $count := mul .Values.replicas.rw_core 2 | int }}
+{{- $tag := tpl .Values.images.rw_core.tag . }}
+{{- range $i, $e := until $count }}
+{{- $core_idx := add $i 1 }}
+{{- $pair_idx := div $i 2 | int }}
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: rw-core{{ $core_idx }}
+ serviceAccountName: {{ $root.Values.serviceaccount }}
+spec:
+ replicas: 1
+ selector:
+ matchLabels:
+ app: rw-core
+ template:
+ metadata:
+ labels:
+ app: rw-core
+ affinity-index: anti-affinity-{{ $pair_idx }}
+ annotations:
+ cni: "calico"
+ spec:
+ affinity:
+ podAntiAffinity:
+ requiredDuringSchedulingIgnoredDuringExecution:
+ - labelSelector:
+ matchExpressions:
+ - key: affinity-index
+ operator: In
+ values:
+ - anti-affinity-{{ $pair_idx }}
+ topologyKey: "kubernetes.io/hostname"
+ serviceAccountName: {{ $root.Values.serviceaccount }}
+ containers:
+ - name: voltha
+ image: {{ $root.Values.registry }}{{ $root.Values.images.rw_core.repository }}:{{ $tag }}
+ imagePullPolicy: {{ $root.Values.images.rw_core.pullPolicy }}
+ env:
+ - name: NAMESPACE
+ value: {{ quote $root.Release.Namespace }}
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: ETCD_SERVICE
+ value: {{ quote $root.Values.services.etcd.service }}
+ - name: ETCD_SERVICE_PORT
+ value: {{ quote $root.Values.services.etcd.port }}
+ - name: ADAPTER_KAFKA_SERVICE
+ value: {{ quote $root.Values.services.kafka.adapter.service }}
+ - name: ADAPTER_KAFKA_SERVICE_PORT
+ value: {{ quote $root.Values.services.kafka.adapter.port }}
+ - name: CLUSTER_KAFKA_SERVICE
+ value: {{ quote $root.Values.services.kafka.cluster.service }}
+ - name: CLUSTER_KAFKA_SERVICE_PORT
+ value: {{ quote $root.Values.services.kafka.cluster.port }}
+ args:
+ - "/app/rw_core"
+ - "-kv_store_type=etcd"
+ - "-kv_store_host=$(ETCD_SERVICE)"
+ - "-kv_store_port=$(ETCD_SERVICE_PORT)"
+ - "-grpc_host=$(POD_IP)"
+ - "-grpc_port=50057"
+ - "-banner=true"
+ - "-kafka_adapter_host=$(ADAPTER_KAFKA_SERVICE)"
+ - "-kafka_adapter_port=$(ADAPTER_KAFKA_SERVICE_PORT)"
+ - "-kafka_cluster_host=$(CLUSTER_KAFKA_SERVICE)"
+ - "-kafka_cluster_port=$(CLUSTER_KAFKA_SERVICE_PORT)"
+ - "-rw_core_topic=rwcore"
+ - "-kv_store_data_prefix=service/voltha"
+ - "-in_competing_mode=true"
+ - "-timeout_long_request=8000"
+ - "-timeout_request=6000"
+ - "-log_level=4"
+ ports:
+ - containerPort: 50057
+ name: grpc-port
+{{end}}