[VOL-4648] Add NETCONF server to voltha-northbound-bbf-adapter
Change-Id: I2d1fa9edb58757deffd92f847c440fe10ce239d6
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 }}"