VOL-1701 - modify existing open olt template to support either go or python impl
Change-Id: I6fc52bdd524c5684634a5b51ad69e5f922b696a7
diff --git a/README.md b/README.md
index 1f38483..a521d28 100644
--- a/README.md
+++ b/README.md
@@ -89,15 +89,30 @@
any adapter. But by deploying the simulated olt/onu adapters it is possible to
create devices in VOLTHA and enable them without having access to hardware.
```shell
-helm install --namespace voltha --name voltha-adapters-simulated voltha-adapter-simulated
+helm install --namespace voltha --name voltha-adapter-simulated ./voltha-adapter-simulated
```
##### Adapters for OpenOLT and OpenONU
-The adapters for the OpenOLT and OpenONU are in separate helm charts to deploy
-the adapters use the following commands:
+The adapters for the OpenOLT and OpenONU are in separate helm charts. There are currently
+two versions of the OpenOLT adapter, one implemented in **Python** and one
+implemented in **Go**. The same chart is used to deploy either the Python or Go
+implementation and which one is used is determined by a value setting.
+
+To install the **Python** implementation of the OpenOLT adapter use:
```shell
-helm install --namespace voltha --name voltha-adapters-openolt voltha-adapters-openolt
-helm install --namespace voltha --name voltha-adapters-openonu voltha-adapters-openonu
+helm install --namespace voltha --name voltha-adapter-openolt ./voltha-adapter-openolt
+```
+
+To install the **Go** implementation of the OpenOLT adapter use:
+```shell
+helm install --set use_go=true --namespace voltha --name voltha-adapter-openolt ./voltha-adapter-openolt
+```
+
+**NOTE:** The Python and Go implementations are exclusive and should not be started in the same cluster.
+
+To install the OpenONU adapter use:
+```shell
+helm install --namespace voltha --name voltha-adapter-openonu ./voltha-adapter-openonu
```
### Kafka and Etcd
@@ -157,7 +172,7 @@
can be utilized:
```shell
-helm delete --purge voltha voltha-adapters voltha-etcd-operator
+helm delete --purge voltha voltha-adapter-simulated voltha-adapter-openolt voltha-adapter-openonu voltha-etcd-operator
```
## Installing and Configuring `voltctl`
diff --git a/voltha-adapter-openolt/Chart.yaml b/voltha-adapter-openolt/Chart.yaml
index f62d422..2735672 100644
--- a/voltha-adapter-openolt/Chart.yaml
+++ b/voltha-adapter-openolt/Chart.yaml
@@ -17,5 +17,5 @@
description: A Helm chart for Voltha OpenOLT Adapter
icon: https://guide.opencord.org/logos/cord.svg
-version: 2.0.0
+version: 2.0.1
appVersion: 2.0.0
diff --git a/voltha-adapter-openolt/templates/adapters-openolt.yaml b/voltha-adapter-openolt/templates/adapters-openolt.yaml
index 4e9c798..1047629 100644
--- a/voltha-adapter-openolt/templates/adapters-openolt.yaml
+++ b/voltha-adapter-openolt/templates/adapters-openolt.yaml
@@ -31,9 +31,23 @@
spec:
containers:
- name: adapter-open-olt
+ {{- if .Values.use_go }}
+ image: {{ tpl .Values.images.adapter_open_olt.registry . }}{{ tpl .Values.images.adapter_open_olt.repository . }}:{{ tpl .Values.images.adapter_open_olt.tag_go . }}
+ {{- else }}
image: {{ tpl .Values.images.adapter_open_olt.registry . }}{{ tpl .Values.images.adapter_open_olt.repository . }}:{{ tpl .Values.images.adapter_open_olt.tag . }}
+ {{- end }}
imagePullPolicy: {{ tpl .Values.images.adapter_open_olt.pullPolicy . }}
args:
+ {{- if .Values.use_go }}
+ - "/app/openolt"
+ - "--kafka_adapter_host={{ .Values.services.kafka.adapter.service }}"
+ - "--kafka_adapter_port={{ .Values.services.kafka.adapter.port }}"
+ - "--kafka_cluster_host={{ .Values.services.kafka.cluster.service }}"
+ - "--kafka_cluster_port={{ .Values.services.kafka.cluster.port }}"
+ - "--core_topic=rwcore"
+ - "--kv_store_host={{ .Values.services.etcd.service }}"
+ - "--kv_store_port={{ .Values.services.etcd.port }}"
+ {{- else}}
- "/voltha/adapters/openolt/main.py"
- "--verbose"
- "--kafka_adapter={{ .Values.services.kafka.adapter.service }}:{{ .Values.services.kafka.adapter.port }}"
@@ -41,3 +55,4 @@
- "--core_topic=rwcore"
- "--backend=etcd"
- "--etcd={{ .Values.services.etcd.service }}:{{ .Values.services.etcd.port }}"
+ {{- end}}
diff --git a/voltha-adapter-openolt/values.yaml b/voltha-adapter-openolt/values.yaml
index 467d5d6..7610fa4 100644
--- a/voltha-adapter-openolt/values.yaml
+++ b/voltha-adapter-openolt/values.yaml
@@ -13,6 +13,8 @@
# limitations under the License.
---
+use_go: false
+
# Default overrides
defaults:
image_registry:
@@ -43,5 +45,6 @@
adapter_open_olt:
registry: '{{ .Values.defaults.image_registry | default "" }}'
repository: '{{ .Values.defaults.image_org | default "voltha/" }}voltha-openolt-adapter'
+ tag_go: '{{ .Values.defaults.image_tag | default "master-go" }}'
tag: '{{ .Values.defaults.image_tag | default .Chart.AppVersion }}'
pullPolicy: '{{ .Values.defaults.image_pullPolicy | default "Always" }}'