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/sdnc/resources/config/conf/aaiclient.properties b/kubernetes/sdnc/resources/config/conf/aaiclient.properties
index 4f66294..81f63ec 100755
--- a/kubernetes/sdnc/resources/config/conf/aaiclient.properties
+++ b/kubernetes/sdnc/resources/config/conf/aaiclient.properties
@@ -40,7 +40,7 @@
 #
 # Configuration file for A&AI Client
 #
-org.onap.ccsdk.sli.adaptors.aai.uri=https://aai-service.onap-aai:8443
+org.onap.ccsdk.sli.adaptors.aai.uri=https://aai-service.{{.Values.nsPrefix}}:8443
 
 
 # query
@@ -134,8 +134,8 @@
 
 # UBB Notify
 org.onap.ccsdk.sli.adaptors.aai.path.notify=/aai/v11/actions/notify
-org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=https://aai-service.onap-aai:8443/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id}
-org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=https://aai-service.onap-aai:8543/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information
+org.onap.ccsdk.sli.adaptors.aai.notify.selflink.fqdn=https://aai-service.{{.Values.nsPrefix}}:8443/restconf/config/L3SDN-API:services/layer3-service-list/{service-instance-id}
+org.onap.ccsdk.sli.adaptors.aai.notify.selflink.avpn=https://aai-service.{{.Values.nsPrefix}}:8543/restconf/config/L3AVPN-EVC-API:services/service-list/{service-instance-id}/service-data/avpn-logicalchannel-information
 
 # Service
 org.onap.ccsdk.sli.adaptors.aai.path.service=/aai/v11/service-design-and-creation/services/service/{service-id}
diff --git a/kubernetes/sdnc/resources/config/conf/admportal.json b/kubernetes/sdnc/resources/config/conf/admportal.json
index f6f59ae..ee575c2 100755
--- a/kubernetes/sdnc/resources/config/conf/admportal.json
+++ b/kubernetes/sdnc/resources/config/conf/admportal.json
@@ -39,8 +39,8 @@
   "dbPassword": "gamma",
   "dbName": "sdnctl",
   "odlProtocol": "http",
-  "odlHost": "sdnhost.onap-sdnc",
-  "odlConexusHost": "sdnhost.onap-sdnc",
+  "odlHost": "sdnhost.{{.Values.nsPrefix}}",
+  "odlConexusHost": "sdnhost.{{.Values.nsPrefix}}",
   "odlPort": "8181",
   "odlConexusPort": "8181",
   "odlUser": "admin",
diff --git a/kubernetes/sdnc/resources/config/dmaap/dhcpalert.properties b/kubernetes/sdnc/resources/config/dmaap/dhcpalert.properties
index 34fceab..cfc8e13 100644
--- a/kubernetes/sdnc/resources/config/dmaap/dhcpalert.properties
+++ b/kubernetes/sdnc/resources/config/dmaap/dhcpalert.properties
@@ -14,7 +14,7 @@
 contenttype =application/json
 authKey=fxoW4jZrO7mdLWWa:f4KxkoBtToyoEG7suMoV8KhnkwM=
 authDate=2016-02-18T13:57:37-0800
-host=dmaap.onap-message-router:3904
+host=dmaap.{{.Values.nsPrefix}}:3904
 topic=VCPE-DHCP-EVENT
 group=jmsgrp
 id=sdnc1
@@ -32,4 +32,4 @@
 DME2preferredRouterFilePath=/opt/onap/sdnc/data/properties/dmaap-listener.preferredRoute.txt
 sdnc.odl.user=admin
 sdnc.odl.password=admin
-sdnc.odl.url-base=https://sdnhost.onap-sdnc:8443/restconf/operations
\ No newline at end of file
+sdnc.odl.url-base=https://sdnhost.{{.Values.nsPrefix}}:8443/restconf/operations
diff --git a/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml b/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml
index 79c9a08..2cd63e1 100644
--- a/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml
+++ b/kubernetes/sdnc/resources/config/log/filebeat/log4j/filebeat.yml
@@ -29,7 +29,7 @@
   #List of logstash server ip addresses with port number.
   #But, in our case, this will be the loadbalancer IP address.
   #For the below property to work the loadbalancer or logstash should expose 5044 port to listen the filebeat events or port in the property should be changed appropriately.
-  hosts: ["logstash.onap-log:5044"]
+  hosts: ["logstash.{{.Values.nsPrefix}}:5044"]
   #If enable will do load balancing among availabe Logstash, automatically.
   loadbalance: true
 
diff --git a/kubernetes/sdnc/resources/config/ueb/ueb-listener.properties b/kubernetes/sdnc/resources/config/ueb/ueb-listener.properties
index 0ced08b..fb6e26d 100644
--- a/kubernetes/sdnc/resources/config/ueb/ueb-listener.properties
+++ b/kubernetes/sdnc/resources/config/ueb/ueb-listener.properties
@@ -1,4 +1,4 @@
-org.onap.ccsdk.sli.northbound.uebclient.asdc-address=sdc-be.onap-sdc:8443
+org.onap.ccsdk.sli.northbound.uebclient.asdc-address=sdc-be.{{.Values.nsPrefix}}:8443
 org.onap.ccsdk.sli.northbound.uebclient.consumer-group=sdc-OpenSource-Env1-sdnc-dockero
 org.onap.ccsdk.sli.northbound.uebclient.consumer-id=sdc-COpenSource-Env11-sdnc-dockero
 org.onap.ccsdk.sli.northbound.uebclient.environment-name=AUTO
@@ -6,7 +6,7 @@
 org.onap.ccsdk.sli.northbound.uebclient.user=sdnc
 org.onap.ccsdk.sli.northbound.uebclient.sdnc-user=admin
 org.onap.ccsdk.sli.northbound.uebclient.sdnc-passwd=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
-org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://sdnhost.onap-sdnc:8282/restconf/operations/
+org.onap.ccsdk.sli.northbound.uebclient.asdc-api-base-url=http://sdnhost.{{.Values.nsPrefix}}:8282/restconf/operations/
 org.onap.ccsdk.sli.northbound.uebclient.asdc-api-namespace=org:onap:ccsdk
 org.onap.ccsdk.sli.northbound.uebclient.spool.incoming=/opt/onap/sdnc/ueb-listener/spool/incoming
 org.onap.ccsdk.sli.northbound.uebclient.spool.archive=/opt/onap/sdnc/ueb-listener/spool/archive
@@ -18,4 +18,4 @@
 org.onap.ccsdk.sli.northbound.uebclient.keystore-path=
 org.onap.ccsdk.sli.northbound.uebclient.keystore-password=
 org.onap.ccsdk.sli.northbound.uebclient.xslt-path-list=
-org.onap.ccsdk.sli.northbound.uebclient.artifact-map=/opt/onap/sdnc/data/properties/artifact.map
\ No newline at end of file
+org.onap.ccsdk.sli.northbound.uebclient.artifact-map=/opt/onap/sdnc/data/properties/artifact.map
diff --git a/kubernetes/sdnc/templates/all-services.yaml b/kubernetes/sdnc/templates/all-services.yaml
index 9425ef4..c309f48 100644
--- a/kubernetes/sdnc/templates/all-services.yaml
+++ b/kubernetes/sdnc/templates/all-services.yaml
@@ -3,7 +3,7 @@
 kind: Service
 metadata:
   name: dbhost
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc-dbhost
 spec:
@@ -19,7 +19,7 @@
 kind: Service
 metadata:
   name: dbhost-read
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc-dbhost
 spec:
@@ -33,7 +33,7 @@
 kind: Service
 metadata:
   name: sdnctldb01
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc-dbhost
 spec:
@@ -47,7 +47,7 @@
 kind: Service
 metadata:
   name: sdnctldb02
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc-dbhost
 spec:
@@ -63,7 +63,7 @@
 kind: Service
 metadata:
   name: sdnc-dgbuilder
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc-dgbuilder
 spec:
@@ -80,7 +80,7 @@
 kind: Service
 metadata:
   name: sdnhost
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc
   annotations:
@@ -117,7 +117,7 @@
 apiVersion: v1
 metadata:
   name: nfs-provisioner
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: nfs-provisioner
 spec:
@@ -140,7 +140,7 @@
 kind: Service
 metadata:
   name: sdnc-portal
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc-portal
   annotations:
@@ -169,7 +169,7 @@
 kind: Service
 metadata:
   name: sdnhost-cluster
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: sdnc
   annotations:
diff --git a/kubernetes/sdnc/templates/db-statefulset.yaml b/kubernetes/sdnc/templates/db-statefulset.yaml
index f2e079d..399eb42 100644
--- a/kubernetes/sdnc/templates/db-statefulset.yaml
+++ b/kubernetes/sdnc/templates/db-statefulset.yaml
@@ -3,7 +3,7 @@
 kind: StatefulSet
 metadata:
   name: sdnc-dbhost
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   serviceName: "dbhost"
   replicas: {{ .Values.numberOfDbReplicas }}
@@ -61,7 +61,7 @@
           echo ${BASH_REMATCH}
           [[ $ordinal -eq 0 ]] && exit 0
           # Clone data from previous peer.
-          ncat --recv-only sdnc-dbhost-$(($ordinal-1)).dbhost.{{ .Values.nsPrefix }}-sdnc 3307 | xbstream -x -C /var/lib/mysql
+          ncat --recv-only sdnc-dbhost-$(($ordinal-1)).dbhost.{{ .Values.nsPrefix }} 3307 | xbstream -x -C /var/lib/mysql
           # Prepare the backup.
           xtrabackup --user=root --password=$MYSQL_ROOT_PASSWORD --prepare --target-dir=/var/lib/mysql
           ls -l /var/lib/mysql
@@ -150,7 +150,7 @@
             mv change_master_to.sql.in change_master_to.sql.orig
             mysql --user=root --password=$MYSQL_ROOT_PASSWORD -h 127.0.0.1 <<EOF
           $(<change_master_to.sql.orig),
-            MASTER_HOST="sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}-sdnc",
+            MASTER_HOST="sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}",
             MASTER_USER="root",
             MASTER_PASSWORD="$MYSQL_ROOT_PASSWORD",
             MASTER_CONNECT_RETRY=10;
@@ -176,10 +176,15 @@
         emptyDir: {}
       - name: config-map
         configMap:
-          name: mysql
+          name: sdnc-mysql
       - name: localtime
         hostPath:
           path: /etc/localtime
+#{{ if .Values.disableNfsProvisioner }}
+      - name: sdnc-data
+        hostPath:
+          path: /dockerdata-nfs/{{ .Values.nsPrefix }}/sdnc/data
+#{{ else }}
   volumeClaimTemplates:
   - metadata:
       name: sdnc-data
@@ -191,3 +196,4 @@
         requests:
           storage: 1Gi
 #{{ end }}
+#{{ end }}
diff --git a/kubernetes/sdnc/templates/dgbuilder-deployment.yaml b/kubernetes/sdnc/templates/dgbuilder-deployment.yaml
index b9ec155..78e20da 100644
--- a/kubernetes/sdnc/templates/dgbuilder-deployment.yaml
+++ b/kubernetes/sdnc/templates/dgbuilder-deployment.yaml
@@ -3,7 +3,7 @@
 kind: Deployment
 metadata:
   name: sdnc-dgbuilder
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.dgbuilderReplicas }}
   selector:
diff --git a/kubernetes/sdnc/templates/dmaap-deployment-configmap.yaml b/kubernetes/sdnc/templates/dmaap-deployment-configmap.yaml
index efd7d6d..c27ae72 100644
--- a/kubernetes/sdnc/templates/dmaap-deployment-configmap.yaml
+++ b/kubernetes/sdnc/templates/dmaap-deployment-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: sdnc-dmaap-configmap
-  namespace: {{ .Values.nsPrefix }}-sdnc
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/dmaap/*").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/sdnc/templates/dmaap-deployment.yaml b/kubernetes/sdnc/templates/dmaap-deployment.yaml
index eb6f354..97dc773 100644
--- a/kubernetes/sdnc/templates/dmaap-deployment.yaml
+++ b/kubernetes/sdnc/templates/dmaap-deployment.yaml
@@ -2,8 +2,8 @@
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
-  name: dmaap-listener
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  name: sdnc-dmaap-listener
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.dmaapReplicas }}
   selector:
@@ -13,7 +13,7 @@
     metadata:
       labels:
         app: dmaap-listener
-      name: dmaap-listener
+      name: sdnc-dmaap-listener
     spec:
       initContainers:
       - command:
diff --git a/kubernetes/sdnc/templates/mysql-configmap.yaml b/kubernetes/sdnc/templates/mysql-configmap.yaml
index deaa997..6b4cdcb 100644
--- a/kubernetes/sdnc/templates/mysql-configmap.yaml
+++ b/kubernetes/sdnc/templates/mysql-configmap.yaml
@@ -1,8 +1,8 @@
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: mysql
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  name: sdnc-mysql
+  namespace: "{{ .Values.nsPrefix }}"
   labels:
     app: mysql
 data:
diff --git a/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml b/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml
index 9e78bf3..bd161d5 100644
--- a/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml
+++ b/kubernetes/sdnc/templates/nfs-provisoner-deployment.yaml
@@ -1,9 +1,10 @@
 #{{ if not .Values.disableSdncSdncDbhost }}
+#{{ if not .Values.disableNfsProvisioner }}
 kind: Deployment
 apiVersion: extensions/v1beta1
 metadata:
-  name: nfs-provisioner
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  name: sdnc-nfs-provisioner
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.nfsReplicas }}
   strategy:
@@ -12,6 +13,7 @@
     metadata:
       labels:
         app: nfs-provisioner
+      name: sdnc-nfs-provisioner
     spec:
       containers:
         - name: nfs-provisioner
@@ -53,3 +55,4 @@
           hostPath:
             path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/sdnc/data
 #{{ end }}
+#{{ end }}
diff --git a/kubernetes/sdnc/templates/sdnc-conf-configmap.yaml b/kubernetes/sdnc/templates/sdnc-conf-configmap.yaml
index e7cde3b..d60cae7 100644
--- a/kubernetes/sdnc/templates/sdnc-conf-configmap.yaml
+++ b/kubernetes/sdnc/templates/sdnc-conf-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: sdnc-conf-configmap
-  namespace: {{ .Values.nsPrefix }}-sdnc
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/conf/*").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml b/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml
index 7c46cf4..d6d4eae 100644
--- a/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml
+++ b/kubernetes/sdnc/templates/sdnc-data-storageclass.yaml
@@ -1,8 +1,10 @@
 #{{ if not .Values.disableSdncSdncDbhost }}
+#{{ if not .Values.disableNfsProvisioner }}
 kind: StorageClass
 apiVersion: storage.k8s.io/v1
 metadata:
   name: "{{ .Values.nsPrefix }}-sdnc-data"
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
 provisioner: sdnc/nfs
 #{{ end }}
+#{{ end }}
diff --git a/kubernetes/sdnc/templates/sdnc-log-configmap.yaml b/kubernetes/sdnc/templates/sdnc-log-configmap.yaml
index d13daac..a7cada8 100644
--- a/kubernetes/sdnc/templates/sdnc-log-configmap.yaml
+++ b/kubernetes/sdnc/templates/sdnc-log-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: sdnc-log-configmap
-  namespace: {{ .Values.nsPrefix }}-sdnc
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/log/filebeat/log4j/*").AsConfig . | indent 2 }}
 ---
@@ -11,7 +11,7 @@
 kind: ConfigMap
 metadata:
   name: sdnc-logging-cfg-configmap
-  namespace: {{ .Values.nsPrefix }}-sdnc
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/sdnc/templates/sdnc-statefulset.yaml b/kubernetes/sdnc/templates/sdnc-statefulset.yaml
index 02950ba..1f02037 100644
--- a/kubernetes/sdnc/templates/sdnc-statefulset.yaml
+++ b/kubernetes/sdnc/templates/sdnc-statefulset.yaml
@@ -3,7 +3,7 @@
 kind: StatefulSet
 metadata:
   name: sdnc
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   serviceName: "sdnhost-cluster"
   replicas: {{ .Values.numberOfODLReplicas }}
@@ -37,8 +37,8 @@
         - bash
         - "-c"
         - |
-          sed -i 's/dbhost/sdnc-dbhost-0.dbhost.onap-sdnc.svc.cluster.local/g' /opt/onap/sdnc/data/properties/svclogic.properties
-          sed -i 's/^\(org.onap.ccsdk.sli.jdbc.hosts=\).*/\1sdnc-dbhost-0.dbhost.onap-sdnc.svc.cluster.local/' /opt/onap/sdnc/data/properties/dblib.properties
+          sed -i 's/dbhost/sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}.svc.cluster.local/g' /opt/onap/sdnc/data/properties/svclogic.properties
+          sed -i 's/^\(org.onap.ccsdk.sli.jdbc.hosts=\).*/\1sdnc-dbhost-0.dbhost.{{ .Values.nsPrefix }}.svc.cluster.local/' /opt/onap/sdnc/data/properties/dblib.properties
           /opt/onap/sdnc/bin/startODL.sh
         env:
         - name: MYSQL_ROOT_PASSWORD
diff --git a/kubernetes/sdnc/templates/ueb-deployment-configmap.yaml b/kubernetes/sdnc/templates/ueb-deployment-configmap.yaml
index 4970de0..6aeaa9f 100644
--- a/kubernetes/sdnc/templates/ueb-deployment-configmap.yaml
+++ b/kubernetes/sdnc/templates/ueb-deployment-configmap.yaml
@@ -3,7 +3,7 @@
 kind: ConfigMap
 metadata:
   name: sdnc-ueb-configmap
-  namespace: {{ .Values.nsPrefix }}-sdnc
+  namespace: {{ .Values.nsPrefix }}
 data:
 {{ tpl (.Files.Glob "resources/config/ueb/*").AsConfig . | indent 2 }}
 #{{ end }}
diff --git a/kubernetes/sdnc/templates/ueb-deployment.yaml b/kubernetes/sdnc/templates/ueb-deployment.yaml
index c109acd..b869ca9 100644
--- a/kubernetes/sdnc/templates/ueb-deployment.yaml
+++ b/kubernetes/sdnc/templates/ueb-deployment.yaml
@@ -2,8 +2,8 @@
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
-  name: ueb-listener
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  name: sdnc-ueb-listener
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.uebReplicas }}
   selector:
@@ -13,7 +13,7 @@
     metadata:
       labels:
         app: ueb-listener
-      name: ueb-listener
+      name: sdnc-ueb-listener
     spec:
       initContainers:
       - command:
diff --git a/kubernetes/sdnc/templates/web-deployment.yaml b/kubernetes/sdnc/templates/web-deployment.yaml
index 73d8e0a..968ec8d 100644
--- a/kubernetes/sdnc/templates/web-deployment.yaml
+++ b/kubernetes/sdnc/templates/web-deployment.yaml
@@ -3,7 +3,7 @@
 kind: Deployment
 metadata:
   name: sdnc-portal
-  namespace: "{{ .Values.nsPrefix }}-sdnc"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
   replicas: {{ .Values.portalReplicas }}
   selector:
diff --git a/kubernetes/sdnc/values.yaml b/kubernetes/sdnc/values.yaml
index 523db5a..b502a74 100644
--- a/kubernetes/sdnc/values.yaml
+++ b/kubernetes/sdnc/values.yaml
@@ -22,3 +22,5 @@
 portalReplicas: 1
 disableSdncSdncDgbuilder: false
 disableSdncSdncPortal: false
+disableNfsProvisioner: false
+