[VOL-4648] Add NETCONF server to voltha-northbound-bbf-adapter

Change-Id: I2d1fa9edb58757deffd92f847c440fe10ce239d6
diff --git a/voltha-northbound-bbf-adapter/Chart.yaml b/voltha-northbound-bbf-adapter/Chart.yaml
index 1aae8ed..05d2f34 100644
--- a/voltha-northbound-bbf-adapter/Chart.yaml
+++ b/voltha-northbound-bbf-adapter/Chart.yaml
@@ -22,5 +22,5 @@
   - "voltha"
   - "bbf"
   - "adapter"
-version: 0.0.1-dev
+version: 0.0.1-dev2
 appVersion: 0.0.1
diff --git a/voltha-northbound-bbf-adapter/templates/configmap-startup.yaml b/voltha-northbound-bbf-adapter/templates/configmap-startup.yaml
new file mode 100644
index 0000000..5d7c66a
--- /dev/null
+++ b/voltha-northbound-bbf-adapter/templates/configmap-startup.yaml
@@ -0,0 +1,38 @@
+---
+# Copyright 2022-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.
+{{- $log_level := tpl .Values.voltha_northbound_bbf_adapter.log_level . }}
+
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: bbf-adapter-startup
+data:
+  startup.sh: |-
+    #!/bin/sh
+
+    netopeer2-server
+
+    exec /app/bbf-adapter \
+        --log_level={{ $log_level }} \
+        --probe_address=:8080 \
+        --trace_enabled={{ .Values.global.tracing.enabled }} \
+        --trace_agent_address={{ tpl .Values.services.tracing_agent.address . }} \
+        --log_correlation_enabled={{ .Values.global.log_correlation.enabled }} \
+        --voltha_nbi_endpoint={{ .Values.global.voltha_stack_name }}-voltha-api.{{ .Values.global.voltha_stack_namespace }}.svc:{{ .Values.voltha_northbound_bbf_adapter.voltha_nbi_port }} \
+        --tls_enabled={{ .Values.voltha_northbound_bbf_adapter.tls_enabled }} \
+        --tls_verify={{ .Values.voltha_northbound_bbf_adapter.tls_verify }} \
+        --onos_rest_endpoint={{ .Values.global.voltha_infra_name }}-onos-classic-hs.{{ .Values.global.voltha_infra_namespace }}.svc:{{ .Values.voltha_northbound_bbf_adapter.onos_rest_port }} \
+        --onos_user={{ .Values.voltha_northbound_bbf_adapter.onos_user }} \
+        --onos_pass={{ .Values.voltha_northbound_bbf_adapter.onos_pass }}
\ No newline at end of file
diff --git a/voltha-northbound-bbf-adapter/templates/deployment.yaml b/voltha-northbound-bbf-adapter/templates/deployment.yaml
index a3491c7..fe09d34 100644
--- a/voltha-northbound-bbf-adapter/templates/deployment.yaml
+++ b/voltha-northbound-bbf-adapter/templates/deployment.yaml
@@ -77,12 +77,10 @@
                 fieldRef:
                   fieldPath: metadata.labels['app.kubernetes.io/name']
           args:
-            - "/app/bbf-adapter"
-            - "--log_level={{ $log_level }}"
-            - "--probe_address=:8080"
-            - "--trace_enabled={{ .Values.global.tracing.enabled }}"
-            - "--trace_agent_address={{ tpl .Values.services.tracing_agent.address . }}"
-            - "--log_correlation_enabled={{ .Values.global.log_correlation.enabled }}"
+            - "/startup/startup.sh" #Defined in configmap-startup.yaml
+          ports:
+            - containerPort: 830
+              name: netopeer2-ssh
           {{- if .Values.securityContext.enabled }}
           securityContext:
             allowPrivilegeEscalation: false
@@ -99,3 +97,11 @@
               port: 8080
             initialDelaySeconds: {{ .Values.probe.readiness.initial_delay_seconds }}
             periodSeconds: {{ .Values.probe.readiness.period_seconds }}
+          volumeMounts:
+            - name: startup-script-volume
+              mountPath: /startup/
+      volumes:
+        - name: startup-script-volume
+          configMap:
+            name: bbf-adapter-startup
+            defaultMode: 0550
\ No newline at end of file
diff --git a/voltha-northbound-bbf-adapter/templates/netopeer2-svc.yaml b/voltha-northbound-bbf-adapter/templates/netopeer2-svc.yaml
new file mode 100644
index 0000000..b8f8ea5
--- /dev/null
+++ b/voltha-northbound-bbf-adapter/templates/netopeer2-svc.yaml
@@ -0,0 +1,27 @@
+# Copyright 2022-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: "{{ template "fullname" . }}-netopeer2"
+  namespace: "{{ .Release.Namespace }}"
+spec:
+  ports:
+    - name: netopeer2-ssh
+      port: 50830
+      targetPort: 830
+  selector:
+    app: bbf-adapter
+    release: "{{ .Release.Name }}"
diff --git a/voltha-northbound-bbf-adapter/values.yaml b/voltha-northbound-bbf-adapter/values.yaml
index da24485..6743265 100644
--- a/voltha-northbound-bbf-adapter/values.yaml
+++ b/voltha-northbound-bbf-adapter/values.yaml
@@ -22,6 +22,10 @@
   image_tag: ~
   image_org: "voltha/"
   image_pullPolicy: "Always"
+  voltha_infra_name: "voltha-infra"
+  voltha_infra_namespace: "infra"
+  voltha_stack_name: "voltha"
+  voltha_stack_namespace: "voltha"
 
   # Configure Log Correlation
   log_correlation:
@@ -42,7 +46,7 @@
 
 # Default security context under which the containers run
 securityContext:
-  enabled: true
+  enabled: false
   fsGroup: 1001
   runAsUser: 1001
   runAsGroup: 1001
@@ -59,6 +63,12 @@
 
 voltha_northbound_bbf_adapter:
   log_level: '{{ .Values.global.log_level }}'
+  voltha_nbi_port: 55555
+  tls_enabled: false
+  tls_verify: false
+  onos_rest_port: 8181
+  onos_user: onos
+  onos_pass: rocks
 
 images:
   voltha_northbound_bbf_adapter: