[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/.gitignore b/.gitignore
index 48f8698..5983ce0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -4,5 +4,8 @@
# lockfiles for requirements.yaml for dependent charts
requirements.lock
-# sub charts directoies, created by helm dep ...
+# sub charts directories, created by helm dep ...
charts
+
+# misc files
+.*.swp
diff --git a/LICENSE b/LICENSE
new file mode 100644
index 0000000..261eeb9
--- /dev/null
+++ b/LICENSE
@@ -0,0 +1,201 @@
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ 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.
diff --git a/README.md b/README.md
index edfb844..3ff2914 100644
--- a/README.md
+++ b/README.md
@@ -1,17 +1,198 @@
-# voltha-helm-charts
+# Helm Charts to Deploy VOLTHA 2.x
-This repo contains charts used with helm to start VOLTHA 2.0 and later.
+This repository defines [Kubernetes Helm](https://helm.sh/) charts that can be
+used to deploy a [VOLTHA](https://www.opennetworking.org/voltha/) instance.
-## Testing
+## Installing charts
+
+To deploy VOLTHA a [Kubernetes](https://kubernetes.io/) environment is
+required. There are many mechanisms to deploy a Kubernetes environment and how
+to do so is out of scope for this project. A Simple search on the Internet will
+lead to the many possibilities.
+
+In addition to a base Kubernetes in order to pass traffic to an OLT additional
+services that are external to VOLTHA are required, such as an OpenFlow
+Controller with applications to support authentication (`EAPOL`) and IP address
+allocation (`DHCP`) as examplified by the [SEBA
+Project](https://www.opennetworking.org/seba/).
+
+### Example deployment
+
+The [VOLTHA Access Edge
+Repository](https://github.com/ciena/voltha-access-edge) is one example of
+deploying a Kubernetes environment as well deploying external component
+required to perform authentication and IP address allocation. It was build
+around deploying VOLTHA 1.x, but by skipping some steps and using the charts in
+this repository it can be used to deploy VOLTHA 2.x.
+
+#### Deploying Kubernetes and OpenFlow Controller
+
+Follow the directions in the
+[README.md](https://github.com/ciena/voltha-access-edge/blob/master/README.md#deploy-voltha)
+file to deploy a Kubernetes cluster on top of a set of
+[Vagrant](https://www.vagrantup.com/) virtual machines connected using an
+instance of the [Trellis](https://www.opennetworking.org/trellis/) spine - leaf
+networking fabric on top of a [Mininet](http://mininet.org/) virtual network.
+
+**DO NOT** deploy VOLTHA following those directions, so **STOP** after the
+[Initialize
+Helm](https://github.com/ciena/voltha-access-edge/blob/master/README.md#initialize-helm)
+step.
+
+Once helm is initialized deploy the [ONOS OpenFlow
+Controller](https://onosproject.org/) using the `make helm-onos` command.
+
+#### Deploy VOLTHA
+
+Clone the [VOLTHA Helm Chart](https://github.com/ciena/voltha-helm-charts)
+repository and build the chart dependencies as follows:
+
+```shell
+git clone https://github.com/ciena/voltha-helm-charts
+cd volth-helm-charts
+helm dependency build voltha
+```
+
+At this point the VOLTHA Helm charts can be used to deploy the VOLTHA core
+components:
+
+```shell
+helm install --namespace voltha --name voltha voltha
+```
+
+After that is complete the adapters for the simulated devices can be deployed:
+
+```shell
+helm install --namespace voltha --name voltha-adapters voltha-adapter-simulated
+```
+
+### Kafka and Etcd
+
+VOLTHA relies on [Kafka](https://kafka.apache.org/) for inter-component
+communication and [Etcd](https://coreos.com/etcd/) for persistent storage. By
+default the VOLTHA Helm charts will deploy private instances of both Kafka and
+Etcd in the same namespace into which VOLTHA is deployed. The settings that
+control if private instances of these services are deployed can be overridden
+using the `--set` or the `--values` options to the `helm install`. The relevant
+property keys are:
+
+- `private_etcd_cluster` - if `true` an instance of `etcd-operator` and an
+ `etcd-cluster` will be deployed, else neither will be deployed
+- `private_kafka_cluster` - if `true` an instance of Kafka will be deployed,
+ else it won't be deployed
+
+#### Using alternate Kafka and Etcd instances
+
+If using alternate instance of Kafka or Etcd values **MUST** be overridden when
+deploying VOLTHA so that the VOLTHA components can locate the required
+services. These values **MUST** be overridden when installing both the `voltha`
+and the `voltha-adapter-simulated` chart. The relevant property keys are:
+
+```shell
+services:
+ kafka:
+ adapter:
+ service: voltha-kafka.voltha.svc.cluster.local
+ port: 9092
+ cluster:
+ service: voltha-kafka.voltha.svc.cluster.local
+ port: 9092
+
+ etcd:
+ service: voltha-etcd-cluster-client.voltha.svc.cluster.local
+ port: 2379
+
+ controller:
+ service: onos-openflow.default.svc.cluster.local
+ port: 6653
+```
+
+#### Configuring the number of Read-Only and Read-Write VOLTAH cores
+
+By default the charts will create one R/O core and two R/W cores. This can be
+configured by overriding two values:
+
+- `replicas.ro_core` specifies the number of R/O core replicas
+- `replicas.rw_core` specifies the number of **pairs** of R/W cores, so a value
+ of one (1) gets you one (1) pair which is two (2) instances. A value of two
+ (2) gets you two (2) pairs which is four (4) instances.
+
+## Delete VOLTHA charts
+
+To remove the VOLTHA and Simulated Adapter deployments standard Helm commands
+can be utilized:
+
+```shell
+helm delete --purge voltha voltha-adapters
+```
+
+## Installing and Configuring `voltctl`
+
+[`voltctl`](https://github.com/ciena/voltctl) is a replacement for the
+`voltha-cli` container in VOLTHA that provides access to the VOLTHA CLI when a
+user connects to the container via `SSH`. `voltctl` provides a use model
+similar to `docker`, `etcdctl`, or `kubectl` for VOLTHA.
+
+As `voltctl` is a binary executable as opposed to a Docker container it must be
+installed separately onto the machine(s) on which it is to be run. The [Release
+Page](https://github.com/ciena/voltctl/releases) for `voltctl` maintains of
+pre-built binaries that can be installed. The following is an example of how,
+in the example environment, `voltctl` can be installed with bash completion and
+configured:
+
+```shell
+sudo wget https://github.com/ciena/voltctl/releases/download/0.0.0-dev/voltctl-0.0.0-dev-linux-x86_64 -O /usr/bin/voltctl
+source <(voltctl completion bash | sudo tee /etc/bash_completion.d/voltctl)
+mkdir $HOME/.volt
+voltctl -a v2 -s voltha-api.voltha.svc.cluster.local:55555 config > $HOME/.volt/config
+```
+
+If you are using `voltctl` and do not wish to deploy the `voltha-cli`
+container, then you can disable deployment of this container by adding the
+`--set replicas.cli=0` option when installing the `voltha` chart.
+
+## Troubleshooting
+
+### Restart voltha-api-server (f.n.a. afrouter)
+
+If you are getting an error similar to the following:
+
+```shell
+$ voltctl version
+rpc error: code = Unknown desc = Unable to route method 'GetVoltha'
+panic: rpc error: code = Unknown desc = Unable to route method 'GetVoltha'
+
+goroutine 1 [running]:
+main.main()
+ /home/ubuntu/voltha-access-edge/voltctl/src/github.com/ciena/voltctl/cmd/voltctl.go:48 +0x56d
+```
+
+Then you can restart the API server by scaling it to 0 and then back to 1
+
+```shell
+kubectl scale --replicas=0 deployment -n voltha voltha-api-server
+kubectl scale --replicas=1 deployment -n voltha voltha-api-server
+```
+
+Before scaling back to `1` be sure the current instance is gone using `kubectl
+get -n voltha pods`
+
+## Known issues
+
+Known VOLTHA issues are tracked in [JIRA](https://jira.opencord.org). Issues
+that may specifically be observed, or at the very least were discovered, in
+this environment can be found in JIRA via a [JIRA Issue
+Search](https://jira.opencord.org/issues/?jql=status%20not%20in%20%28closed%2C%20Done%2CResolved%29%20and%20labels%20in%20%28helm%29%20and%20affectedVersion%20in%20%28%22VOLTHA%20v2.0%22%29).
+
+## Pre-patchset submission Checks
On patchset submission, jobs are run in Jenkins that validate the correctness
of the helm charts.
The code for these jobs can be found in
-[helm-repo-tools](https://gerrit.opencord.org/gitweb?p=helm-repo-tools.git;a=tree)
+[helm-repo-tools](http://gerrit.opencord.org/helm-repo-tools)
The two scripts that should be run to test are:
- - `helm_lint.sh`
- - `chart_version_check.sh`
-
+- `helmlint.sh`
+- `chart_version_check.sh`
diff --git a/voltha-adapter-simulated/.helmignore b/voltha-adapter-simulated/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/voltha-adapter-simulated/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/voltha-adapter-simulated/Chart.yaml b/voltha-adapter-simulated/Chart.yaml
new file mode 100644
index 0000000..06213b7
--- /dev/null
+++ b/voltha-adapter-simulated/Chart.yaml
@@ -0,0 +1,21 @@
+# 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.
+
+---
+name: voltha-adapter-simulated
+description: A Helm chart for Voltha Simulated Adaptyer based on K8S resources in Voltha project
+icon: https://guide.opencord.org/logos/cord.svg
+
+version: 2.0.0
+appVersion: 2.0.0
diff --git a/voltha-adapter-simulated/templates/adapters-simulated.yaml b/voltha-adapter-simulated/templates/adapters-simulated.yaml
new file mode 100644
index 0000000..0721b88
--- /dev/null
+++ b/voltha-adapter-simulated/templates/adapters-simulated.yaml
@@ -0,0 +1,131 @@
+# 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: adapter-simulated-olt
+ namespace: {{ .Release.Namespace }}
+spec:
+ clusterIP: None
+ selector:
+ app: adapter-simulated-olt
+
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: adapter-simulated-olt
+ namespace: {{ .Release.Namespace }}
+spec:
+ replicas: {{ .Values.replicas.adapter_simulated_olt }}
+ selector:
+ matchLabels:
+ app: adapter-simulated-olt
+ template:
+ metadata:
+ labels:
+ app: adapter-simulated-olt
+ annotations:
+ cni: "calico"
+ spec:
+ containers:
+ - name: adapter-simulated-olt
+ image: {{ .Values.registry }}{{ .Values.images.adapter_simulated_olt.repository }}:{{ tpl .Values.images.adapter_simulated_olt.tag . }}
+ imagePullPolicy: {{ .Values.images.adapter_simulated_olt.pullPolicy }}
+ env:
+ - name: NAMESPACE
+ value: {{ quote .Release.Namespace }}
+ - name: ETCD_SERVICE
+ value: "{{ .Values.services.etcd.service }}"
+ - name: ETCD_SERVICE_PORT
+ value: "{{ .Values.services.etcd.port }}"
+ - name: ADAPTER_KAFKA_SERVICE
+ value: "{{ .Values.services.kafka.adapter.service }}"
+ - name: ADAPTER_KAFKA_SERVICE_PORT
+ value: "{{ .Values.services.kafka.adapter.port }}"
+ - name: CLUSTER_KAFKA_SERVICE
+ value: "{{ .Values.services.kafka.cluster.service }}"
+ - name: CLUSTER_KAFKA_SERVICE_PORT
+ value: "{{ .Values.services.kafka.cluster.port }}"
+ args:
+ - "/app/simulated_olt"
+ - "-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)"
+ - "-core_topic=rwcore"
+ - "-simulator_topic=simulated_olt"
+ - "-kv_store_host=$(ETCD_SERVICE)"
+ - "-kv_store_port=$(ETCD_SERVICE_PORT)"
+ - "-onu_number=100"
+---
+apiVersion: v1
+kind: Service
+metadata:
+ name: adapter-simulated-onu
+ namespace: {{ .Release.Namespace }}
+spec:
+ clusterIP: None
+ selector:
+ app: adapter-simulated-onu
+
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+ name: adapter-simulated-onu
+ namespace: {{ .Release.Namespace }}
+spec:
+ replicas: {{ .Values.replicas.adapter_simulated_onu }}
+ selector:
+ matchLabels:
+ app: adapter-simulated-onu
+ template:
+ metadata:
+ labels:
+ app: adapter-simulated-onu
+ annotations:
+ cni: "calico"
+ spec:
+ containers:
+ - name: adapter-simulated-onu
+ image: {{ .Values.registry }}{{ .Values.images.adapter_simulated_onu.repository }}:{{ tpl .Values.images.adapter_simulated_onu.tag . }}
+ imagePullPolicy: {{ .Values.images.adapter_simulated_onu.pullPolicy }}
+ env:
+ - name: NAMESPACE
+ value: {{ quote .Release.Namespace }}
+ - name: ETCD_SERVICE
+ value: "{{ .Values.services.etcd.service }}"
+ - name: ETCD_SERVICE_PORT
+ value: "{{ .Values.services.etcd.port }}"
+ - name: ADAPTER_KAFKA_SERVICE
+ value: "{{ .Values.services.kafka.adapter.service }}"
+ - name: ADAPTER_KAFKA_SERVICE_PORT
+ value: "{{ .Values.services.kafka.adapter.port }}"
+ - name: CLUSTER_KAFKA_SERVICE
+ value: "{{ .Values.services.kafka.cluster.service }}"
+ - name: CLUSTER_KAFKA_SERVICE_PORT
+ value: "{{ .Values.services.kafka.cluster.port }}"
+ args:
+ - "/app/simulated_onu"
+ - "-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)"
+ - "-core_topic=rwcore"
+ - "-kv_store_host=$(ETCD_SERVICE)"
+ - "-kv_store_port=$(ETCD_SERVICE_PORT)"
+ - "-simulator_topic=simulated_onu"
diff --git a/voltha-adapter-simulated/templates/onu.yaml b/voltha-adapter-simulated/templates/onu.yaml
new file mode 100644
index 0000000..e44466b
--- /dev/null
+++ b/voltha-adapter-simulated/templates/onu.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: Service
+metadata:
+ name: onu
+ labels:
+ name: onu
+spec:
+ ports:
+ - name: grpc
+ port: 50061
+ targetPort: 50061
+ selector:
+ app: onu
+
+---
+apiVersion: apps/v1beta1
+kind: Deployment
+metadata:
+ name: onu
+spec:
+ replicas: {{ .Values.replicas.onu }}
+ template:
+ metadata:
+ labels:
+ app: onu
+ annotations:
+ cni: "calico,pon0"
+ spec:
+ containers:
+ - name: onu
+ image: {{ .Values.registry }}{{ .Values.images.ponsim.repository }}:{{ tpl .Values.images.ponsim.tag . }}
+ imagePullPolicy: {{ .Values.images.ponsim.pullPolicy }}
+ env:
+ - name: POD_IP
+ valueFrom:
+ fieldRef:
+ fieldPath: status.podIP
+ - name: NAMESPACE
+ value: {{ quote .Release.Namespace }}
+
+ args:
+ - "/app/ponsim"
+ - "-device_type"
+ - "ONU"
+ - "-parent_addr"
+ - "olt"
+ - "-grpc_port"
+ - "50061"
+ - "-internal_if"
+ - "eth0"
+ - "-external_if"
+ - "eth1"
+ - "-promiscuous"
+
+ ports:
+ - containerPort: 50061
+ name: grpc-port
diff --git a/voltha-adapter-simulated/values.yaml b/voltha-adapter-simulated/values.yaml
new file mode 100644
index 0000000..2dd877f
--- /dev/null
+++ b/voltha-adapter-simulated/values.yaml
@@ -0,0 +1,54 @@
+# 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.
+
+---
+# Globally define a registry
+registry: ''
+
+# Define connectivity to required services
+services:
+ kafka:
+ adapter:
+ service: voltha-kafka.voltha.svc.cluster.local
+ port: 9092
+ cluster:
+ service: voltha-kafka.voltha.svc.cluster.local
+ port: 9092
+
+ # Define connectivity to etcd
+ etcd:
+ service: voltha-etcd-cluster-client.voltha.svc.cluster.local
+ port: 2379
+
+# Define the recplica count for everything
+replicas:
+ adapter_simulated_olt: 1
+ adapter_simulated_onu: 1
+ onu: 1
+
+images:
+ adapter_simulated_olt:
+ repository: 'volthacore/voltha-adapter-simulated-olt'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ adapter_simulated_onu:
+ repository: 'volthacore/voltha-adapter-simulated-onu'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ ponsim:
+ repository: 'volthacore/voltha-ponsim'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
diff --git a/voltha-etcd-cluster/.helmignore b/voltha-etcd-cluster/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/voltha-etcd-cluster/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/voltha-etcd-cluster/Chart.yaml b/voltha-etcd-cluster/Chart.yaml
new file mode 100644
index 0000000..dd67ced
--- /dev/null
+++ b/voltha-etcd-cluster/Chart.yaml
@@ -0,0 +1,19 @@
+# Copyright 2017-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
+appVersion: "0.9.2"
+description: Create an etcd-cluster using etcd-operator provided CRD
+name: voltha-etcd-cluster
+version: 2.0.0
diff --git a/voltha-etcd-cluster/templates/etcd-cluster-service.yaml b/voltha-etcd-cluster/templates/etcd-cluster-service.yaml
new file mode 100644
index 0000000..08f294e
--- /dev/null
+++ b/voltha-etcd-cluster/templates/etcd-cluster-service.yaml
@@ -0,0 +1,30 @@
+{{- if .Values.etcdNodePort -}}
+---
+# Copyright 2017-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: {{ .Values.clusterName }}-external
+spec:
+ type: NodePort
+ ports:
+ - port: 2379
+ targetPort: 2379
+ nodePort: {{ .Values.etcdNodePort }}
+ protocol: TCP
+ selector:
+ app: "etcd"
+{{- end -}}
diff --git a/voltha-etcd-cluster/templates/etcd-cluster.yaml b/voltha-etcd-cluster/templates/etcd-cluster.yaml
new file mode 100644
index 0000000..7939a39
--- /dev/null
+++ b/voltha-etcd-cluster/templates/etcd-cluster.yaml
@@ -0,0 +1,30 @@
+# Copyright 2017-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: "etcd.database.coreos.com/v1beta2"
+kind: "EtcdCluster"
+metadata:
+ name: {{ quote .Values.clusterName }}
+spec:
+ size: {{ .Values.clusterSize }}
+ pod:
+ resources:
+ limits:
+ memory: {{ .Values.memoryLimit }}
+ etcdEnv:
+ - name: ETCD_AUTO_COMPACTION_RETENTION
+ value: {{ quote .Values.autoCompactionRetention }}
+ busyboxImage: {{ .Values.registry }}{{ .Values.images.busybox.repository }}:{{ tpl .Values.images.busybox.tag . }}
+ version: {{ tpl .Values.images.etcd.tag . }}
+ repository: {{ .Values.registry }}{{ .Values.images.etcd.repository }}
diff --git a/voltha-etcd-cluster/values.yaml b/voltha-etcd-cluster/values.yaml
new file mode 100644
index 0000000..aece130
--- /dev/null
+++ b/voltha-etcd-cluster/values.yaml
@@ -0,0 +1,36 @@
+# Copyright 2017-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.
+
+# Default values for etcd-cluster.
+# This is a YAML-formatted file.
+# Declare variables to be passed into your templates.
+
+registry: ""
+clusterName: "voltha-etcd-cluster"
+clusterSize: 3
+memoryLimit: 1024Mi
+autoCompactionRetention: "12"
+
+# expose the etcd-cluster as a nodePort
+# etcdNodePort: 32379
+etcdNodePort: ""
+
+images:
+ etcd:
+ repository: "quay.io/coreos/etcd"
+ tag: "v3.2.18"
+ busybox:
+ repository: "busybox"
+ tag: "1.28.1-glibc"
+
diff --git a/voltha/.helmignore b/voltha/.helmignore
new file mode 100644
index 0000000..f0c1319
--- /dev/null
+++ b/voltha/.helmignore
@@ -0,0 +1,21 @@
+# Patterns to ignore when building packages.
+# This supports shell glob matching, relative path matching, and
+# negation (prefixed with !). Only one pattern per line.
+.DS_Store
+# Common VCS dirs
+.git/
+.gitignore
+.bzr/
+.bzrignore
+.hg/
+.hgignore
+.svn/
+# Common backup files
+*.swp
+*.bak
+*.tmp
+*~
+# Various IDEs
+.project
+.idea/
+*.tmproj
diff --git a/voltha/Chart.yaml b/voltha/Chart.yaml
new file mode 100644
index 0000000..5e199c8
--- /dev/null
+++ b/voltha/Chart.yaml
@@ -0,0 +1,21 @@
+# 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.
+
+---
+name: voltha
+description: A Helm chart for Voltha based on K8S resources in Voltha project
+icon: https://guide.opencord.org/logos/cord.svg
+
+version: 2.0.0
+appVersion: 2.0.0
diff --git a/voltha/requirements.yaml b/voltha/requirements.yaml
new file mode 100644
index 0000000..a441106
--- /dev/null
+++ b/voltha/requirements.yaml
@@ -0,0 +1,28 @@
+# 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.
+
+---
+dependencies:
+ - name: kafka
+ repository: https://kubernetes-charts-incubator.storage.googleapis.com
+ version: 0.15.3
+ condition: private_kafka_cluster
+ - name: etcd-operator
+ repository: https://kubernetes-charts.storage.googleapis.com
+ version: 0.8.3
+ condition: private_etcd_cluster
+ - name: voltha-etcd-cluster
+ repository: file://../voltha-etcd-cluster
+ version: 2.0.0
+ condition: private_etcd_cluster
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}}
diff --git a/voltha/values.yaml b/voltha/values.yaml
new file mode 100644
index 0000000..27da6d9
--- /dev/null
+++ b/voltha/values.yaml
@@ -0,0 +1,99 @@
+# 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.
+
+---
+registry: ''
+serviceaccount: voltha-serviceaccount
+private_etcd_cluster: true
+private_kafka_cluster: true
+
+# Configure the Kafka sub-chart (if it is used)
+kafka:
+ configurationOverrides:
+ "offsets.topic.replication.factor": 1
+ "log.retention.hours": 4
+ "log.message.timestamp.type": "LogAppendTime"
+ persistence:
+ enabled: false
+ zookeeper:
+ replicaCount: 1
+ persistence:
+ enabled: false
+ replicas: 1
+
+# Define connectivity to services on which VOLTHA depends
+services:
+ kafka:
+ adapter:
+ service: voltha-kafka.voltha.svc.cluster.local
+ port: 9092
+ cluster:
+ service: voltha-kafka.voltha.svc.cluster.local
+ port: 9092
+
+ # Define connectivity to etcd
+ etcd:
+ service: voltha-etcd-cluster-client.voltha.svc.cluster.local
+ port: 2379
+
+ # Define controller to which to connect
+ controller:
+ service: onos-openflow.default.svc.cluster.local
+ port: 6653
+
+# Define the recplica count for everything
+replicas:
+ # For R/W cores the templates translate the number of replicas
+ # into the number of RW core pairs with two pods per pair
+ rw_core: 1
+
+ # For everything else replicas are replicas
+ cli: 1
+ ofagent: 1
+ ro_core: 1
+ afrouter: 1
+ afrouterd: 1
+
+# Define Docker images to be used
+images:
+ cli:
+ repository: 'volthacore/voltha-cli'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ ofagent:
+ repository: 'volthacore/voltha-ofagent'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ ro_core:
+ repository: 'volthacore/voltha-ro-core'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ rw_core:
+ repository: 'volthacore/voltha-rw-core'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ afrouter:
+ repository: 'volthacore/voltha-afrouter'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+
+ afrouterd:
+ repository: 'volthacore/voltha-afrouterd'
+ tag: '{{ .Chart.AppVersion }}'
+ pullPolicy: 'Always'
+ restartPolicy: 'Always'