Merge "Integration w common/postgres"
diff --git a/kubernetes/dcaegen2/Makefile b/kubernetes/dcaegen2/Makefile
new file mode 100644
index 0000000..c16f23b
--- /dev/null
+++ b/kubernetes/dcaegen2/Makefile
@@ -0,0 +1,2 @@
+make-dmaap:
+	cd charts && helm dep up dcae-bootstrap
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml
index d031e2e..9f53d90 100644
--- a/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/requirements.yaml
@@ -20,3 +20,6 @@
   - name: common
     version: ~2.0.0
     repository: '@local'
+  - name: postgres
+    version: ~2.0.0
+    repository: '@local'
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml
index 6205f1e..dac0ffa 100644
--- a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_engine-inputs.yaml
@@ -23,6 +23,6 @@
   "msb_hostname": "{{ .Values.config.address.msb_discovery }}.{{include "common.namespace" . }}",
   "dcae_CL_publish_url": "http://{{ .Values.config.address.message_router }}.{{include "common.namespace" . }}:3904/events/unauthenticated.DCAE_CL_OUTPUT",
   "ves_fault_publish_url": "http://{{ .Values.config.address.message_router }}.{{include "common.namespace" . }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT",
-  "pgaas_cluster_name" : "pgvm",
+  "pgaas_cluster_name" : "{{ .Values.postgres.service.name2 }}.{{include "common.namespace" . }}",
   "database_name":"holmes"
 }
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-input.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-input.yaml
index 75dbbf9..1a808d4 100644
--- a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-input.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-holmes_rules-input.yaml
@@ -18,6 +18,6 @@
 
 {
   "msb_hostname": "{{ .Values.config.address.msb_discovery }}.{{include "common.namespace" . }}",
-  "pgaas_cluster_name" : "pgvm",
+  "pgaas_cluster_name" : "{{ .Values.postgres.service.name2 }}.{{include "common.namespace" . }}",
   "database_name":"holmes"
 }
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-pgaas-initdb-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-pgaas-initdb-inputs.yaml
new file mode 100644
index 0000000..b201247
--- /dev/null
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-pgaas-initdb-inputs.yaml
@@ -0,0 +1,19 @@
+#=================================================================================
+# Copyright (c) 2018 AT&T Intellectual Property. All rights reserved.
+# Copyright © 2018 Amdocs, Bell Canada
+# ================================================================================
+# 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.
+# ============LICENSE_END=========================================================
+
+k8s_pgaas_instance_fqdn: {{ .Values.postgres.service.name2 }}.{{include "common.namespace" . }}
+k8s_initial_password: {{ .Values.postgres.config.pgRootPassword }}
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml
index 7dc66f4..f3a6cca 100644
--- a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-tca-inputs.yaml
@@ -22,3 +22,7 @@
 dmaap_host: {{ .Values.config.address.message_router }}.{{include "common.namespace" . }}
 consul_host: {{ .Values.config.address.consul.host }}.{{include "common.namespace" . }}
 cbs_host: config-binding-service
+enableRedisCaching:  {{ .Values.config.redisCaching }}
+{{ if .Values.config.redisHosts }}
+redisHosts: {{ .Values.config.redisHosts }}
+{{ end }}
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml
index 5385d07..2e41d1c 100644
--- a/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/resources/inputs/k8s-ves-inputs.yaml
@@ -19,7 +19,7 @@
 {{ if .Values.componentImages.ves }}
 tag_version: {{ .Values.componentImages.ves }}
 {{ end }}
-external_port : "30280"
+external_port : "30235"
 ves_other_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.SEC_OTHER_OUTPUT/"
 ves_heartbeat_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.SEC_HEARTBEAT_OUTPUT/"
 ves_fault_publish_url: "http://{{ .Values.config.address.message_router }}:3904/events/unauthenticated.SEC_FAULT_OUTPUT/"
diff --git a/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml b/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml
index 16de112..6df05b1 100644
--- a/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-bootstrap/values.yaml
@@ -40,11 +40,28 @@
     msb_discovery: msb-discovery
     policy_pdp: pdp
     sdc: sdc-be
+  # redisCaching is a string not a boolean!
+  redisCaching: "false"
+
+# postgres values--overriding defaults in the postgres subchart
+postgres:
+  nameOverride: dcae-db
+  service:
+    name: dcae-postgres
+    name2: dcae-pg-primary
+    name3: dcae-pg-replica
+  container:
+    name:
+      primary: dcae-pg-primary
+      replica: dcae-pg-replica
+  config:
+    pgPrimaryPassword: onapdemodb
+    pgRootPassword: onapdemodb
 
 
 # application image
 repository: nexus3.onap.org:10001
-image: onap/org.onap.dcaegen2.deployments.k8s-bootstrap-container:1.1.6
+image: onap/org.onap.dcaegen2.deployments.k8s-bootstrap-container:1.1.8
 
 # DCAE component images to be deployed via Cloudify Manager
 # Use to override default setting in blueprints
diff --git a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml
index c6b24ee..4b76523 100644
--- a/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml
+++ b/kubernetes/dcaegen2/charts/dcae-cloudify-manager/templates/service.yaml
@@ -63,4 +63,13 @@
   type: ExternalName
   externalName: {{ .Values.service.name }}.{{ include "common.namespace" . }}.svc.cluster.local
 {{ end }}
-
+# Provide alternate name for consul in common namespace to support CM plugin discovery
+apiVersion: v1
+kind: Service
+metadata:
+  name: consul
+  namespace: {{ include "common.namespace" . }}
+spec:
+  type: ExternalName
+  externalName: {{ .Values.config.address.consul.host }}.{{ include "common.namespace" . }}.svc.cluster.local
+---
diff --git a/kubernetes/onap/resources/environments/dev.yaml b/kubernetes/onap/resources/environments/dev.yaml
index a8dd524..651cb91 100644
--- a/kubernetes/onap/resources/environments/dev.yaml
+++ b/kubernetes/onap/resources/environments/dev.yaml
@@ -93,10 +93,6 @@
   config:
     enableClustering: false
 
-  dmaap-listener:
-    config:
-      dmaapPort: 3904
-
   mysql:
     disableNfsProvisioner: false
     replicaCount: 1
diff --git a/kubernetes/onap/values.yaml b/kubernetes/onap/values.yaml
index a242771..470fdfb 100644
--- a/kubernetes/onap/values.yaml
+++ b/kubernetes/onap/values.yaml
@@ -94,10 +94,6 @@
   config:
     enableClustering: false
 
-  dmaap-listener:
-    config:
-      dmaapPort: 3904
-
   mysql:
     disableNfsProvisioner: true
     replicaCount: 1
diff --git a/kubernetes/sdnc/charts/dmaap-listener/resources/config/dhcpalert.properties b/kubernetes/sdnc/charts/dmaap-listener/resources/config/dhcpalert.properties
index dc0deb2..de1346a 100644
--- a/kubernetes/sdnc/charts/dmaap-listener/resources/config/dhcpalert.properties
+++ b/kubernetes/sdnc/charts/dmaap-listener/resources/config/dhcpalert.properties
@@ -14,7 +14,7 @@
 contenttype =application/json
 authKey=fxoW4jZrO7mdLWWa:f4KxkoBtToyoEG7suMoV8KhnkwM=
 authDate=2016-02-18T13:57:37-0800
-host=dmaap.{{.Release.Namespace}}:3904
+host=message-router.{{.Release.Namespace}}:{{.Values.config.dmaapPort}}
 topic=VCPE-DHCP-EVENT
 group=jmsgrp
 id=sdnc1
diff --git a/kubernetes/sdnc/charts/dmaap-listener/templates/deployment.yaml b/kubernetes/sdnc/charts/dmaap-listener/templates/deployment.yaml
index e712a41..733b21e 100644
--- a/kubernetes/sdnc/charts/dmaap-listener/templates/deployment.yaml
+++ b/kubernetes/sdnc/charts/dmaap-listener/templates/deployment.yaml
@@ -38,6 +38,8 @@
         - {{ .Values.config.mysqlChartName }}
         - --container-name
         - {{ .Values.config.sdncChartName }}
+        - --container-name
+        - {{ .Values.config.msgRouterContainerName }}
         env:
         - name: NAMESPACE
           valueFrom:
diff --git a/kubernetes/sdnc/charts/dmaap-listener/values.yaml b/kubernetes/sdnc/charts/dmaap-listener/values.yaml
index 1a5ca2c..189aa72 100644
--- a/kubernetes/sdnc/charts/dmaap-listener/values.yaml
+++ b/kubernetes/sdnc/charts/dmaap-listener/values.yaml
@@ -39,6 +39,7 @@
   dmaapPort: 3904
   mysqlChartName: sdnc-dbhost
   sdncChartName: sdnc
+  msgRouterContainerName: dmaap
   configDir: /opt/onap/sdnc/data/properties
 
 # default number of instances
@@ -64,7 +65,7 @@
   enabled: false
 
 service:
-  name: dmaap-listener
+  name: sdnc-dmaap-listener
 
 resources: {}
 #resources:
diff --git a/kubernetes/sdnc/charts/ueb-listener/resources/config/dblib.properties b/kubernetes/sdnc/charts/ueb-listener/resources/config/dblib.properties
new file mode 100644
index 0000000..15cb218
--- /dev/null
+++ b/kubernetes/sdnc/charts/ueb-listener/resources/config/dblib.properties
@@ -0,0 +1,37 @@
+###
+# ============LICENSE_START=======================================================
+# openECOMP : SDN-C
+# ================================================================================
+# Copyright (C) 2017 AT&T Intellectual Property. All rights
+# 						reserved.
+# ================================================================================
+# 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.
+# ============LICENSE_END=========================================================
+###
+
+# dblib.properties
+org.onap.ccsdk.sli.dbtype=jdbc
+
+org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:{{.Values.mysql.service.internalPort}}/sdnctl
+org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver
+org.onap.ccsdk.sli.jdbc.database=sdnctl
+org.onap.ccsdk.sli.jdbc.user=sdnctl
+org.onap.ccsdk.sli.jdbc.password=gamma
+org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01
+org.onap.ccsdk.sli.jdbc.connection.timeout=50
+org.onap.ccsdk.sli.jdbc.request.timeout=100
+org.onap.ccsdk.sli.jdbc.limit.init=10
+org.onap.ccsdk.sli.jdbc.limit.min=10
+org.onap.ccsdk.sli.jdbc.limit.max=20
+org.onap.dblib.connection.recovery=false
diff --git a/kubernetes/sdnc/charts/ueb-listener/resources/config/ueb-listener.properties b/kubernetes/sdnc/charts/ueb-listener/resources/config/ueb-listener.properties
index 72dee15..cd184bf 100644
--- a/kubernetes/sdnc/charts/ueb-listener/resources/config/ueb-listener.properties
+++ b/kubernetes/sdnc/charts/ueb-listener/resources/config/ueb-listener.properties
@@ -19,3 +19,4 @@
 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
+org.onap.ccsdk.sli.northbound.uebclient.msg-bus-address=message-router.{{.Release.Namespace}}
diff --git a/kubernetes/sdnc/charts/ueb-listener/templates/deployment.yaml b/kubernetes/sdnc/charts/ueb-listener/templates/deployment.yaml
index b11cf95..e3f324e 100644
--- a/kubernetes/sdnc/charts/ueb-listener/templates/deployment.yaml
+++ b/kubernetes/sdnc/charts/ueb-listener/templates/deployment.yaml
@@ -38,6 +38,10 @@
         - {{ .Values.config.mysqlChartName }}
         - --container-name
         - {{ .Values.config.sdncChartName }}
+        - --container-name
+        - {{ .Values.config.sdcbeChartName }}
+        - --container-name
+        - {{ .Values.config.msgRouterContainerName }}
         env:
         - name: NAMESPACE
           valueFrom:
diff --git a/kubernetes/sdnc/charts/ueb-listener/values.yaml b/kubernetes/sdnc/charts/ueb-listener/values.yaml
index d04ba09..a6722eb 100644
--- a/kubernetes/sdnc/charts/ueb-listener/values.yaml
+++ b/kubernetes/sdnc/charts/ueb-listener/values.yaml
@@ -39,6 +39,8 @@
   uebPort: 3904
   mysqlChartName: sdnc-dbhost
   sdncChartName: sdnc
+  sdcbeChartName: sdc-be
+  msgRouterContainerName: dmaap
   configDir: /opt/onap/sdnc/data/properties
 
 
@@ -62,7 +64,12 @@
   periodSeconds: 10
 
 service:
-  name: ueb-listener
+  name: sdnc-ueb-listener
+
+mysql:
+  service:
+    name: sdnc-dbhost
+    internalPort: 3306
 
 ingress:
   enabled: false
diff --git a/kubernetes/sdnc/resources/config/conf/dblib.properties b/kubernetes/sdnc/resources/config/conf/dblib.properties
index 499834e..15cb218 100644
--- a/kubernetes/sdnc/resources/config/conf/dblib.properties
+++ b/kubernetes/sdnc/resources/config/conf/dblib.properties
@@ -19,7 +19,7 @@
 # ============LICENSE_END=========================================================
 ###
 
-# dblib.properrties
+# dblib.properties
 org.onap.ccsdk.sli.dbtype=jdbc
 
 org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01