Adding node ports to specify static node port numbers for XOS services

Change-Id: Ib0a1ecd32d54d6aef3fa97f88a6626b1c234d6c2
diff --git a/xos-core/templates/_helpers.tpl b/xos-core/templates/_helpers.tpl
index 399c79a..2d2afb7 100644
--- a/xos-core/templates/_helpers.tpl
+++ b/xos-core/templates/_helpers.tpl
@@ -1,3 +1,20 @@
+
+{{- /* 
+ 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. 
+ */ -}}
+
 {{- define "xos-core.release_labels" }}
 app: {{ printf "%s-%s" .Release.Name .Chart.Name | trunc 63 }}
 version: {{ .Chart.Version }}
diff --git a/xos-core/templates/certchain-secret.yaml b/xos-core/templates/certchain-secret.yaml
index 3441992..65e8a9c 100644
--- a/xos-core/templates/certchain-secret.yaml
+++ b/xos-core/templates/certchain-secret.yaml
@@ -1,3 +1,17 @@
+# 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:
diff --git a/xos-core/templates/chameleon-deployment.yaml b/xos-core/templates/chameleon-deployment.yaml
index e86853f..6fcc8d5 100644
--- a/xos-core/templates/chameleon-deployment.yaml
+++ b/xos-core/templates/chameleon-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/chameleon-service.yaml b/xos-core/templates/chameleon-service.yaml
index 0b9da59..02ac016 100644
--- a/xos-core/templates/chameleon-service.yaml
+++ b/xos-core/templates/chameleon-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -6,7 +20,8 @@
   type: NodePort
   ports:
   - port: 9101
-    targetPort: 9101 
+    targetPort: 9101
+    nodePort: {{ .Values.node_ports.chameleon_service_port }}
     protocol: TCP
   selector:
     app: "xos-chameleon"
diff --git a/xos-core/templates/core-configmap.yaml b/xos-core/templates/core-configmap.yaml
index bf07f4e..299d678 100644
--- a/xos-core/templates/core-configmap.yaml
+++ b/xos-core/templates/core-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/core-deployment.yaml b/xos-core/templates/core-deployment.yaml
index b22639e..6515de8 100644
--- a/xos-core/templates/core-deployment.yaml
+++ b/xos-core/templates/core-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/core-service.yaml b/xos-core/templates/core-service.yaml
index 7e56013..d365e93 100644
--- a/xos-core/templates/core-service.yaml
+++ b/xos-core/templates/core-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -9,11 +23,13 @@
   ports:
   - port: 50051
     name: secure 
-    targetPort: 50051 
+    targetPort: 50051
+    nodePort: {{ .Values.node_ports.core_secure_service_port }}
     protocol: TCP
   - port: 50055
     name: insecure 
-    targetPort: 50055 
+    targetPort: 50055
+    nodePort: {{ .Values.node_ports.core_insecure_service_port }}
     protocol: TCP
   selector:
     app: "xos-core"
diff --git a/xos-core/templates/coreapi-cert-secret.yaml b/xos-core/templates/coreapi-cert-secret.yaml
index 84712e5..4296da5 100644
--- a/xos-core/templates/coreapi-cert-secret.yaml
+++ b/xos-core/templates/coreapi-cert-secret.yaml
@@ -1,3 +1,17 @@
+# 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:
diff --git a/xos-core/templates/db-configmap.yaml b/xos-core/templates/db-configmap.yaml
index 45183b2..ef0fa9b 100644
--- a/xos-core/templates/db-configmap.yaml
+++ b/xos-core/templates/db-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/db-deployment.yaml b/xos-core/templates/db-deployment.yaml
index ca34b69..df06309 100644
--- a/xos-core/templates/db-deployment.yaml
+++ b/xos-core/templates/db-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/db-service.yaml b/xos-core/templates/db-service.yaml
index 8afaf64..a011362 100644
--- a/xos-core/templates/db-service.yaml
+++ b/xos-core/templates/db-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -8,7 +22,8 @@
   type: NodePort
   ports:
   - port: 5432 
-    targetPort: 5432 
+    targetPort: 5432
+    nodePort: {{ .Values.node_ports.db_service_port }}
     protocol: TCP
   selector:
     app: "xos-db"
diff --git a/xos-core/templates/gateway-configmap.yaml b/xos-core/templates/gateway-configmap.yaml
index c526d53..98b6b54 100644
--- a/xos-core/templates/gateway-configmap.yaml
+++ b/xos-core/templates/gateway-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/gui-app-configmap.yaml b/xos-core/templates/gui-app-configmap.yaml
index a6b6213..d49738b 100644
--- a/xos-core/templates/gui-app-configmap.yaml
+++ b/xos-core/templates/gui-app-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/gui-deployment.yaml b/xos-core/templates/gui-deployment.yaml
index 7a7d8f2..7c29fb7 100644
--- a/xos-core/templates/gui-deployment.yaml
+++ b/xos-core/templates/gui-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/gui-service.yaml b/xos-core/templates/gui-service.yaml
index ccf6c83..04e7799 100644
--- a/xos-core/templates/gui-service.yaml
+++ b/xos-core/templates/gui-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -6,7 +20,8 @@
   type: NodePort
   ports:
   - port: 4000
-    targetPort: 4000 
+    targetPort: 4000
+    nodePort: {{ .Values.node_ports.gui_service_port }}
     protocol: TCP
   selector:
     app: "xos-gui"
diff --git a/xos-core/templates/gui-style-configmap.yaml b/xos-core/templates/gui-style-configmap.yaml
index ac11d3a..8b05847 100644
--- a/xos-core/templates/gui-style-configmap.yaml
+++ b/xos-core/templates/gui-style-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/initial-data-configmap.yaml b/xos-core/templates/initial-data-configmap.yaml
index 05d5283..ab66f7a 100644
--- a/xos-core/templates/initial-data-configmap.yaml
+++ b/xos-core/templates/initial-data-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/redis-deployment.yaml b/xos-core/templates/redis-deployment.yaml
index 38a9c8b..6f4a6af 100644
--- a/xos-core/templates/redis-deployment.yaml
+++ b/xos-core/templates/redis-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/redis-service.yaml b/xos-core/templates/redis-service.yaml
index 47e9a38..567896d 100644
--- a/xos-core/templates/redis-service.yaml
+++ b/xos-core/templates/redis-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -6,7 +20,8 @@
   type: NodePort
   ports:
   - port: 6379
-    targetPort: 6379 
+    targetPort: 6379
+    nodePort: {{ .Values.node_ports.redis_service_port }}
     protocol: TCP
   selector:
     app: "xos-redis"
diff --git a/xos-core/templates/tosca-configmap.yaml b/xos-core/templates/tosca-configmap.yaml
index 2f85692..8f23e4f 100644
--- a/xos-core/templates/tosca-configmap.yaml
+++ b/xos-core/templates/tosca-configmap.yaml
@@ -1,3 +1,17 @@
+# 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: ConfigMap
 metadata:
diff --git a/xos-core/templates/tosca-deployment.yaml b/xos-core/templates/tosca-deployment.yaml
index f4c4ab8..4957ef4 100644
--- a/xos-core/templates/tosca-deployment.yaml
+++ b/xos-core/templates/tosca-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/tosca-service.yaml b/xos-core/templates/tosca-service.yaml
index 5fdfbef..f57299a 100644
--- a/xos-core/templates/tosca-service.yaml
+++ b/xos-core/templates/tosca-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -6,7 +20,8 @@
   type: NodePort
   ports:
   - port: 9102
-    targetPort: 9102 
+    targetPort: 9102
+    nodePort: {{ .Values.node_ports.tosca_service_port }}
     protocol: TCP
   selector:
     app: "xos-tosca"
diff --git a/xos-core/templates/ws-deployment.yaml b/xos-core/templates/ws-deployment.yaml
index fd49a1a..ebd428e 100644
--- a/xos-core/templates/ws-deployment.yaml
+++ b/xos-core/templates/ws-deployment.yaml
@@ -1,3 +1,17 @@
+# 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: extensions/v1beta1
 kind: Deployment
 metadata:
diff --git a/xos-core/templates/ws-service.yaml b/xos-core/templates/ws-service.yaml
index b3374c3..8e54a5b 100644
--- a/xos-core/templates/ws-service.yaml
+++ b/xos-core/templates/ws-service.yaml
@@ -1,3 +1,17 @@
+# 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:
@@ -6,7 +20,8 @@
   type: NodePort
   ports:
   - port: 3000
-    targetPort: 3000 
+    targetPort: 3000
+    nodePort: {{ .Values.node_ports.ws_service_port }}
     protocol: TCP
   selector:
     app: "xos-ws"