Make all services independent of helm Release.Name

Issue-ID: OOM-906
Change-Id: Ic65127d3981cb0a696c784392cab59fbf06b1e66
Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
diff --git a/kubernetes/policy/charts/brmsgw/resources/config/pe/brmsgw.conf b/kubernetes/policy/charts/brmsgw/resources/config/pe/brmsgw.conf
index ab8ce5e..e7c6298 100644
--- a/kubernetes/policy/charts/brmsgw/resources/config/pe/brmsgw.conf
+++ b/kubernetes/policy/charts/brmsgw/resources/config/pe/brmsgw.conf
@@ -18,8 +18,8 @@
 COMPONENT_X_MX_MB=1024
 COMPONENT_X_MS_MB=1024
 
-REST_PAP_URL=http://{{ .Release.Name }}-{{ .Values.global.pap.nameOverride }}:{{.Values.config.papPort}}/pap/
-REST_PDP_ID=http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}:{{.Values.config.pdpPort}}/pdp/
+REST_PAP_URL=http://{{ .Values.global.pap.nameOverride }}:{{.Values.config.papPort}}/pap/
+REST_PDP_ID=http://{{ .Values.global.pdp.nameOverride }}:{{.Values.config.pdpPort}}/pdp/
 
 PDP_HTTP_USER_ID=testpdp
 PDP_HTTP_PASSWORD=alpha123
@@ -29,13 +29,13 @@
 M2_HOME=/usr/share/maven
 snapshotRepositoryID=policy-nexus-snapshots
 snapshotRepositoryName=Snapshots
-snapshotRepositoryURL=http://{{ .Release.Name }}-{{ .Values.global.nexus.nameOverride }}:{{.Values.config.nexusPort}}/nexus/content/repositories/snapshots
+snapshotRepositoryURL=http://{{ .Values.global.nexus.nameOverride }}:{{.Values.config.nexusPort}}/nexus/content/repositories/snapshots
 releaseRepositoryID=policy-nexus-releases
 releaseRepositoryName=Releases
-releaseRepositoryURL=http://{{ .Release.Name }}-{{ .Values.global.nexus.nameOverride }}:{{.Values.config.nexusPort}}/nexus/content/repositories/releases
+releaseRepositoryURL=http://{{ .Values.global.nexus.nameOverride }}:{{.Values.config.nexusPort}}/nexus/content/repositories/releases
 repositoryUsername=admin
 repositoryPassword=admin123
-UEB_URL=dmaap
+UEB_URL=message-router
 UEB_TOPIC=PDPD-CONFIGURATION
 UEB_API_KEY=
 UEB_API_SECRET=
@@ -54,7 +54,7 @@
 
 #Notification Properties... type can be either websocket, ueb, or dmaap
 BRMS_NOTIFICATION_TYPE=websocket
-BRMS_UEB_URL=dmaap
+BRMS_UEB_URL=message-router
 BRMS_UEB_TOPIC=PDPD-CONFIGURATION
 BRMS_UEB_DELAY=
 BRMS_CLIENT_ID=python
diff --git a/kubernetes/policy/charts/brmsgw/templates/service.yaml b/kubernetes/policy/charts/brmsgw/templates/service.yaml
index ebec058..594950e 100644
--- a/kubernetes/policy/charts/brmsgw/templates/service.yaml
+++ b/kubernetes/policy/charts/brmsgw/templates/service.yaml
@@ -15,7 +15,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.servicename" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -28,11 +28,11 @@
     {{if eq .Values.service.type "NodePort" -}}
     - port: {{ .Values.service.externalPort }}
       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
     {{- else -}}
     - port: {{ .Values.service.externalPort }}
       targetPort: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
     {{- end}}
   selector:
     app: {{ include "common.name" . }}
diff --git a/kubernetes/policy/charts/brmsgw/values.yaml b/kubernetes/policy/charts/brmsgw/values.yaml
index e436c0e..4d6c9fd 100644
--- a/kubernetes/policy/charts/brmsgw/values.yaml
+++ b/kubernetes/policy/charts/brmsgw/values.yaml
@@ -60,6 +60,7 @@
 service:
   type: NodePort
   name: brmsgw
+  portName: brmsgw
   externalPort: 9989
   nodePort: 16
 
diff --git a/kubernetes/policy/charts/drools/charts/nexus/templates/service.yaml b/kubernetes/policy/charts/drools/charts/nexus/templates/service.yaml
index 5447d91..ded4657 100644
--- a/kubernetes/policy/charts/drools/charts/nexus/templates/service.yaml
+++ b/kubernetes/policy/charts/drools/charts/nexus/templates/service.yaml
@@ -15,7 +15,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.servicename" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -25,7 +25,7 @@
 spec:
   ports:
     - port: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
   selector:
     app: {{ include "common.name" . }}
     release: {{ .Release.Name }}
diff --git a/kubernetes/policy/charts/drools/charts/nexus/values.yaml b/kubernetes/policy/charts/drools/charts/nexus/values.yaml
index d197ef6..250f0a7 100644
--- a/kubernetes/policy/charts/drools/charts/nexus/values.yaml
+++ b/kubernetes/policy/charts/drools/charts/nexus/values.yaml
@@ -58,6 +58,7 @@
 service:
   type: NodePort
   name: nexus
+  portName: nexus
   internalPort: 8081
 
 ingress:
diff --git a/kubernetes/policy/charts/drools/resources/config/drools/settings.xml b/kubernetes/policy/charts/drools/resources/config/drools/settings.xml
index 8b110bd..8de7e11 100755
--- a/kubernetes/policy/charts/drools/resources/config/drools/settings.xml
+++ b/kubernetes/policy/charts/drools/resources/config/drools/settings.xml
@@ -47,7 +47,7 @@
       <repositories>
         <repository>
           <id>policy-nexus-snapshots</id>
-          <url>http://{{.Release.Name}}-{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/snapshots/</url>
+          <url>http://{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/snapshots/</url>
           <releases>
             <enabled>false</enabled>
             <updatePolicy>always</updatePolicy>
@@ -60,7 +60,7 @@
 
         <repository>
           <id>policy-nexus-releases</id>
-          <url>http://{{.Release.Name}}-{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/releases/</url>
+          <url>http://{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/releases/</url>
           <releases>
             <enabled>true</enabled>
             <updatePolicy>always</updatePolicy>
diff --git a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf
index a7ab3ee..3b2c1f0 100644
--- a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf
+++ b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf
@@ -29,22 +29,22 @@
 # nexus repository
 
 snapshotRepositoryID=policy-nexus-snapshots
-snapshotRepositoryUrl=http://{{.Release.Name}}-{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/snapshots/
+snapshotRepositoryUrl=http://{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/snapshots/
 releaseRepositoryID=policy-nexus-releases
-releaseRepositoryUrl=http://{{.Release.Name}}-{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/releases/
+releaseRepositoryUrl=http://{{.Values.global.nexus.nameOverride}}:{{.Values.config.nexusPort}}/nexus/content/repositories/releases/
 repositoryUsername=admin
 repositoryPassword=admin123
 
 # Relational (SQL) DB access 
 
-SQL_HOST={{.Release.Name}}-{{.Values.global.mariadb.nameOverride}}
+SQL_HOST={{.Values.global.mariadb.nameOverride}}
 SQL_USER=policy_user
 SQL_PASSWORD=policy_user
 
 # PDP-D DMaaP configuration channel
 
 PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION
-PDPD_CONFIGURATION_SERVERS=dmaap
+PDPD_CONFIGURATION_SERVERS=message-router
 PDPD_CONFIGURATION_API_KEY=
 PDPD_CONFIGURATION_API_SECRET=
 PDPD_CONFIGURATION_CONSUMER_GROUP=
@@ -53,13 +53,13 @@
 
 # PAP
 
-PAP_HOST={{.Release.Name}}-{{.Values.global.pap.nameOverride}}
+PAP_HOST={{.Values.global.pap.nameOverride}}
 PAP_USERNAME=testpap
 PAP_PASSWORD=alpha123
 
 # PDP-X
 
-PDP_HOST={{.Release.Name}}-{{.Values.global.pdp.nameOverride}}
+PDP_HOST={{.Values.global.pdp.nameOverride}}
 PDP_USERNAME=testpdp
 PDP_PASSWORD=alpha123
 PDP_CLIENT_USERNAME=python
@@ -69,11 +69,11 @@
 # DCAE DMaaP
 
 DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT
-DCAE_SERVERS=dmaap
+DCAE_SERVERS=message-router
 
 # Open DMaaP
 
-DMAAP_SERVERS=dmaap
+DMAAP_SERVERS=message-router
 
 # AAI
 
diff --git a/kubernetes/policy/charts/drools/templates/service.yaml b/kubernetes/policy/charts/drools/templates/service.yaml
index 4335f7c..116de09 100644
--- a/kubernetes/policy/charts/drools/templates/service.yaml
+++ b/kubernetes/policy/charts/drools/templates/service.yaml
@@ -15,7 +15,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.servicename" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -28,14 +28,14 @@
     {{if eq .Values.service.type "NodePort" -}}
     - port: {{ .Values.service.externalPort }}
       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
-      name: {{ .Values.service.name }}-{{ .Values.service.externalPort }}
+      name: {{ .Values.service.portName }}-{{ .Values.service.externalPort }}
     - port: {{ .Values.service.externalPort2 }}
       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }}
-      name: {{ .Values.service.name }}-{{ .Values.service.externalPort2 }}
+      name: {{ .Values.service.portName }}-{{ .Values.service.externalPort2 }}
     {{- else -}}
     - port: {{ .Values.service.type.externalPort }}
       targetPort: {{ .Values.service.type.internalPort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
     {{- end}}
   selector:
     app: {{ include "common.name" . }}
diff --git a/kubernetes/policy/charts/drools/values.yaml b/kubernetes/policy/charts/drools/values.yaml
index 5006bc0..c2504a6 100644
--- a/kubernetes/policy/charts/drools/values.yaml
+++ b/kubernetes/policy/charts/drools/values.yaml
@@ -61,6 +61,7 @@
 service:
   type: NodePort
   name: drools
+  portName: drools
   externalPort: 6969
   nodePort: 17
   externalPort2: 9696
diff --git a/kubernetes/policy/charts/mariadb/templates/service.yaml b/kubernetes/policy/charts/mariadb/templates/service.yaml
index 5447d91..ded4657 100644
--- a/kubernetes/policy/charts/mariadb/templates/service.yaml
+++ b/kubernetes/policy/charts/mariadb/templates/service.yaml
@@ -15,7 +15,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.servicename" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -25,7 +25,7 @@
 spec:
   ports:
     - port: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
   selector:
     app: {{ include "common.name" . }}
     release: {{ .Release.Name }}
diff --git a/kubernetes/policy/charts/mariadb/values.yaml b/kubernetes/policy/charts/mariadb/values.yaml
index 23970cf..eb62715 100644
--- a/kubernetes/policy/charts/mariadb/values.yaml
+++ b/kubernetes/policy/charts/mariadb/values.yaml
@@ -67,7 +67,8 @@
 
 service:
   type: ClusterIP
-  name: mariadb
+  name: policydb
+  portName: policydb
   internalPort: 3306
 
 ingress:
diff --git a/kubernetes/policy/charts/pdp/resources/config/pe/pdp.conf b/kubernetes/policy/charts/pdp/resources/config/pe/pdp.conf
index 8325d42..48fafcb 100644
--- a/kubernetes/policy/charts/pdp/resources/config/pe/pdp.conf
+++ b/kubernetes/policy/charts/pdp/resources/config/pe/pdp.conf
@@ -27,9 +27,9 @@
 
 # pdp properties
 
-UEB_CLUSTER=dmaap
+UEB_CLUSTER=message-router
 
-REST_PAP_URL=http://{{ .Release.Name }}-{{ .Values.global.pap.nameOverride }}:{{.Values.config.papPort}}/pap/
+REST_PAP_URL=http://{{ .Values.global.pap.nameOverride }}:{{.Values.config.papPort}}/pap/
 REST_PDP_ID=http://{{ include "common.fullname" . }}:{{.Values.service.externalPort}}/pdp/
 REST_PDP_CONFIG=/opt/app/policy/servers/pdp/bin/config
 REST_PDP_WEBAPPS=/opt/app/policy/servers/pdp/webapps
diff --git a/kubernetes/policy/charts/pdp/templates/service.yaml b/kubernetes/policy/charts/pdp/templates/service.yaml
index df63d38..fc608d5 100644
--- a/kubernetes/policy/charts/pdp/templates/service.yaml
+++ b/kubernetes/policy/charts/pdp/templates/service.yaml
@@ -15,7 +15,7 @@
 apiVersion: v1
 kind: Service
 metadata:
-  name: {{ include "common.fullname" . }}
+  name: {{ include "common.servicename" . }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.name" . }}
@@ -25,7 +25,7 @@
   annotations:
     msb.onap.org/service-info: '[
       {
-          "serviceName": "{{ include "common.fullname" . }}",
+          "serviceName": "{{ include "common.servicename" . }}",
           "version": "v1",
           "url": "/pdp",
           "protocol": "REST",
@@ -39,11 +39,11 @@
     {{if eq .Values.service.type "NodePort" -}}
     - port: {{ .Values.service.externalPort }}
       nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
     {{- else -}}
     - port: {{ .Values.service.externalPort }}
       targetPort: {{ .Values.service.internalPort }}
-      name: {{ .Values.service.name }}
+      name: {{ .Values.service.portName }}
     {{- end}}
   selector:
     app: {{ include "common.name" . }}
diff --git a/kubernetes/policy/charts/pdp/values.yaml b/kubernetes/policy/charts/pdp/values.yaml
index 9595b9d..4f63e32 100644
--- a/kubernetes/policy/charts/pdp/values.yaml
+++ b/kubernetes/policy/charts/pdp/values.yaml
@@ -60,6 +60,7 @@
 service:
   type: NodePort
   name: pdp
+  portName: pdp
   externalPort: 8081
   #Example internal target port if required
   #internalPort: <80>
diff --git a/kubernetes/policy/charts/policy-common/resources/config/pe/base.conf b/kubernetes/policy/charts/policy-common/resources/config/pe/base.conf
index 4549406..ce8a030 100644
--- a/kubernetes/policy/charts/policy-common/resources/config/pe/base.conf
+++ b/kubernetes/policy/charts/policy-common/resources/config/pe/base.conf
@@ -18,8 +18,8 @@
 KEYSTORE_PASSWD=Pol1cy_0nap
 
 JDBC_DRIVER=org.mariadb.jdbc.Driver
-JDBC_URL=jdbc:mariadb://{{ .Release.Name }}-{{ .Values.global.mariadb.nameOverride }}:{{.Values.config.mariadbPort}}/onap_sdk?failOverReadOnly=false&autoReconnect=true
-JDBC_LOG_URL=jdbc:mariadb://{{ .Release.Name }}-{{ .Values.global.mariadb.nameOverride }}:{{.Values.config.mariadbPort}}/log?failOverReadOnly=false&autoReconnect=true
+JDBC_URL=jdbc:mariadb://{{ .Values.global.mariadb.nameOverride }}:{{.Values.config.mariadbPort}}/onap_sdk?failOverReadOnly=false&autoReconnect=true
+JDBC_LOG_URL=jdbc:mariadb://{{ .Values.global.mariadb.nameOverride }}:{{.Values.config.mariadbPort}}/log?failOverReadOnly=false&autoReconnect=true
 JDBC_USER=policy_user
 JDBC_PASSWORD=policy_user
 
diff --git a/kubernetes/policy/charts/policy-common/resources/config/scripts/do-start.sh b/kubernetes/policy/charts/policy-common/resources/config/scripts/do-start.sh
index 35842e4..defae52 100644
--- a/kubernetes/policy/charts/policy-common/resources/config/scripts/do-start.sh
+++ b/kubernetes/policy/charts/policy-common/resources/config/scripts/do-start.sh
@@ -74,7 +74,7 @@
 		# (which does nothing if the db is already up-to-date)
 		dbuser=$(echo $(grep '^JDBC_USER=' base.conf | cut -f2 -d=))
 		dbpw=$(echo $(grep '^JDBC_PASSWORD=' base.conf | cut -f2 -d=))
-		db_upgrade_remote.sh $dbuser $dbpw {{.Release.Name}}-{{.Values.global.mariadb.nameOverride}}
+		db_upgrade_remote.sh $dbuser $dbpw {{.Values.global.mariadb.nameOverride}}
 	fi
 
 fi