CORD-3118 Mount node key in ONOS container for VTN (optional)

Change-Id: I61fd1f94c59db0992e640167e4cc28325f7d8be0
diff --git a/onos/templates/deployment.yaml b/onos/templates/deployment.yaml
index 585b250..9915686 100644
--- a/onos/templates/deployment.yaml
+++ b/onos/templates/deployment.yaml
@@ -57,6 +57,16 @@
               containerPort: {{ .Values.services.cluster.port }}
           resources:
 {{ toYaml .Values.resources | indent 12 }}
+          volumeMounts:
+            - name: node-key
+              mountPath: /root/vtn
+              readOnly: true
+      volumes:
+        - name: node-key
+          secret:
+            secretName: node-key
+            defaultMode: 256
+            optional: true
     {{- with .Values.nodeSelector }}
       nodeSelector:
 {{ toYaml . | indent 8 }}
diff --git a/xos-profiles/base-openstack/files/node_key b/xos-profiles/base-openstack/files/node_key
new file mode 100644
index 0000000..de2efc7
--- /dev/null
+++ b/xos-profiles/base-openstack/files/node_key
@@ -0,0 +1,18 @@
+# Copyright 2018-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.
+
+##########################################################
+# Overwrite this file with a private SSH key for logging #
+#           into the OpenStack compute nodes             #
+##########################################################
diff --git a/xos-profiles/base-openstack/templates/secret.yaml b/xos-profiles/base-openstack/templates/secret.yaml
new file mode 100644
index 0000000..01cf74b
--- /dev/null
+++ b/xos-profiles/base-openstack/templates/secret.yaml
@@ -0,0 +1,23 @@
+---
+# 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: Secret
+metadata:
+  name: node-key
+  namespace: default
+type: Opaque
+data:
+  node_key: {{ .Files.Get .Values.nodeKeyFile | b64enc }}
\ No newline at end of file
diff --git a/xos-profiles/base-openstack/values.yaml b/xos-profiles/base-openstack/values.yaml
index 1a28a72..a56e377 100644
--- a/xos-profiles/base-openstack/values.yaml
+++ b/xos-profiles/base-openstack/values.yaml
@@ -37,6 +37,8 @@
 keystoneAdminTenant: "admin"
 keystoneDomain: "Default"
 
+nodeKeyFile: "files/node_key"
+
 # List of compute nodes to add to XOS
 computeNodes:
   master:
diff --git a/xos-services/vtn-service/templates/_tosca.tpl b/xos-services/vtn-service/templates/_tosca.tpl
index f1d630a..49f0ba8 100644
--- a/xos-services/vtn-service/templates/_tosca.tpl
+++ b/xos-services/vtn-service/templates/_tosca.tpl
@@ -35,7 +35,7 @@
           localManagementIp: 172.27.0.1/24
           ovsdbPort: 6641
           sshUser: {{ .sshUser }}
-          sshKeyFile: /root/node_key
+          sshKeyFile: /root/vtn/node_key
           sshPort: {{ .sshPort }}
           xosEndpoint: xos-chameleon:9101
           xosUser: {{ .xosAdminUser }}