Run all components in one namespace

Change-Id: I5fcd4d577c1fda4de27842807c7cf7a5d372756e
Issue-ID: OOM-722
Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
diff --git a/kubernetes/mso/templates/all-services.yaml b/kubernetes/mso/templates/all-services.yaml
index 44e47c1..6eefe65 100644
--- a/kubernetes/mso/templates/all-services.yaml
+++ b/kubernetes/mso/templates/all-services.yaml
@@ -2,17 +2,17 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: mariadb
-  namespace: "{{ .Values.nsPrefix }}-mso"
+  name: mso-mariadb
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
-    app: mariadb
+    app: mso-mariadb
 spec:
   ports:
-    - port: 3306
-      nodePort: {{ .Values.nodePortPrefix }}52
+  - port: 3306
+    name: mso-mariadb-3306
   selector:
-    app: mariadb
-  type: NodePort
+    app: mso-mariadb
+  clusterIP: None
 #{{ end }}
 #{{ if not .Values.disableMsoMso }}
 ---
@@ -20,7 +20,7 @@
 kind: Service
 metadata:
   name: mso
-  namespace: "{{ .Values.nsPrefix }}-mso"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: mso
   annotations:
@@ -63,4 +63,4 @@
       port: 8787
       nodePort: {{ .Values.nodePortPrefix }}50
   type: NodePort
-#{{ end }}
\ No newline at end of file
+#{{ end }}
diff --git a/kubernetes/mso/templates/db-deployment-configmap.yaml b/kubernetes/mso/templates/db-deployment-configmap.yaml
index ac3c3bf..51c106c 100644
--- a/kubernetes/mso/templates/db-deployment-configmap.yaml
+++ b/kubernetes/mso/templates/db-deployment-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: mso-confd-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/conf.d/*").AsConfig . | indent 2 }}
 ---
@@ -11,7 +11,7 @@
 kind: ConfigMap
 metadata:
   name: mso-docker-entry-initd-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/*").AsConfig . | indent 2 }}
 ---
@@ -19,7 +19,7 @@
 kind: ConfigMap
 metadata:
   name: mso-automated-tests-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/automated-tests/*").AsConfig . | indent 2 }}
 ---
@@ -27,7 +27,7 @@
 kind: ConfigMap
 metadata:
   name: mso-bulkload-default-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/default/*").AsConfig . | indent 2 }}
 ---
@@ -35,7 +35,7 @@
 kind: ConfigMap
 metadata:
   name: mso-demo-dns-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-dns/*").AsConfig . | indent 2 }}
 ---
@@ -43,7 +43,7 @@
 kind: ConfigMap
 metadata:
   name: mso-demo-vfw-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/bulkload-files/demo-vfw/*").AsConfig . | indent 2 }}
 ---
@@ -51,7 +51,7 @@
 kind: ConfigMap
 metadata:
   name: mso-scripts-camunda-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/camunda/*").AsConfig . | indent 2 }}
 ---
@@ -59,7 +59,7 @@
 kind: ConfigMap
 metadata:
   name: mso-main-schemas-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mariadb/docker-entrypoint-initdb.d/db-sql-scripts/main-schemas/*").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/mso/templates/db-deployment.yaml b/kubernetes/mso/templates/db-deployment.yaml
index cc4c656..a906c1c 100644
--- a/kubernetes/mso/templates/db-deployment.yaml
+++ b/kubernetes/mso/templates/db-deployment.yaml
@@ -2,25 +2,25 @@
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
-  name: mariadb
-  namespace: "{{ .Values.nsPrefix }}-mso"
+  name: mso-mariadb
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.dbReplicas }}
   selector:
     matchLabels:
-      app: mariadb
+      app: mso-mariadb
   template:
     metadata:
       labels:
-        app: mariadb
-      name: mariadb
+        app: mso-mariadb
+      name: mso-mariadb
     spec:
-      hostname: mariadb
+      hostname: mso-mariadb
       containers:
       - args:
         image: {{ .Values.image.mariadb }}
         imagePullPolicy: {{ .Values.pullPolicy }}
-        name: "mariadb"
+        name: "mso-mariadb"
         env:
           - name: MYSQL_ROOT_PASSWORD
             value: password
@@ -52,7 +52,7 @@
           name: mso-mariadb-data
         ports:
         - containerPort: 3306
-          name: mariadb
+          name: mso-mariadb
         readinessProbe:
           tcpSocket:
             port: 3306
diff --git a/kubernetes/mso/templates/mso-deployment-configmap.yaml b/kubernetes/mso/templates/mso-deployment-configmap.yaml
index 55b9f81..15c6141 100644
--- a/kubernetes/mso/templates/mso-deployment-configmap.yaml
+++ b/kubernetes/mso/templates/mso-deployment-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: mso-config-mso-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/mso/*").AsConfig . | indent 2 }}
 ---
@@ -11,7 +11,15 @@
 kind: ConfigMap
 metadata:
   name: mso-docker-file-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/docker-files/scripts/start-jboss-server.sh").AsConfig . | indent 2 }}
+---
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: mso-jboss-configmap
+  namespace: {{ .Values.nsPrefix }}
+data:
+{{ tpl (.Files.Glob "resources/config/mso/jboss/standalone-full-ha-mso.xml").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/mso/templates/mso-deployment.yaml b/kubernetes/mso/templates/mso-deployment.yaml
index b414640..2e5497c 100644
--- a/kubernetes/mso/templates/mso-deployment.yaml
+++ b/kubernetes/mso/templates/mso-deployment.yaml
@@ -3,7 +3,7 @@
 kind: Deployment
 metadata:
   name: mso
-  namespace: "{{ .Values.nsPrefix }}-mso"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.msoReplicas }}
   selector:
@@ -20,7 +20,7 @@
         - /root/ready.py
         args:
         - --container-name
-        - mariadb
+        - mso-mariadb
         env:
         - name: NAMESPACE
           valueFrom:
@@ -45,6 +45,9 @@
         - mountPath: /tmp/start-jboss-server.sh
           name: mso-docker-files
           subPath: start-jboss-server.sh
+        - mountPath: /opt/jboss/standalone/configuration/standalone-full-ha-mso.xml
+          name: mso-jboss-config
+          subPath: standalone-full-ha-mso.xml
         - mountPath: /var/log/onap
           name: mso-logs
         - mountPath: /var/berks-cookbooks/mso-config/files/default/mso-po-adapter-config/logback.network.xml
@@ -139,6 +142,9 @@
             - key: start-jboss-server.sh
               path: start-jboss-server.sh
               mode: 0755
+        - name: mso-jboss-config
+          configMap:
+            name: mso-jboss-configmap
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
 #{{ end }}
diff --git a/kubernetes/mso/templates/mso-log-configmap.yaml b/kubernetes/mso/templates/mso-log-configmap.yaml
index 3bf8412..273c22f 100644
--- a/kubernetes/mso/templates/mso-log-configmap.yaml
+++ b/kubernetes/mso/templates/mso-log-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: mso-log-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }}
 ---
@@ -11,7 +11,7 @@
 kind: ConfigMap
 metadata:
   name: mso-filebeat-configmap
-  namespace: {{ .Values.nsPrefix }}-mso
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/mso/templates/mso-pv-pvc.yaml b/kubernetes/mso/templates/mso-pv-pvc.yaml
index af42c01..04f5c60 100644
--- a/kubernetes/mso/templates/mso-pv-pvc.yaml
+++ b/kubernetes/mso/templates/mso-pv-pvc.yaml
@@ -2,10 +2,10 @@
 apiVersion: v1
 kind: PersistentVolume
 metadata:
-  name: "{{ .Values.nsPrefix }}-mso-db"
-  namespace: "{{ .Values.nsPrefix }}-mso"
+  name: "{{ .Values.nsPrefix }}-mso"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
-    name: "{{ .Values.nsPrefix }}-mso-db"
+    name: "{{ .Values.nsPrefix }}-mso"
 spec:
   capacity:
     storage: 2Gi
@@ -19,7 +19,7 @@
 apiVersion: v1
 metadata:
   name: mso-db
-  namespace: "{{ .Values.nsPrefix }}-mso"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   accessModes:
     - ReadWriteMany
@@ -28,5 +28,5 @@
       storage: 2Gi
   selector:
     matchLabels:
-      name: "{{ .Values.nsPrefix }}-mso-db"
+      name: "{{ .Values.nsPrefix }}-mso"
 #{{ end }}