Upgrade APPC to use common mariadb galera charts 97/63297/8
authorpramod <pramod.kumarsharma@amdocs.com>
Tue, 28 Aug 2018 15:41:45 +0000 (15:41 +0000)
committerpramod <pramod.kumarsharma@amdocs.com>
Fri, 7 Sep 2018 17:58:21 +0000 (17:58 +0000)
Change-Id: I3537415a9266bc388aca146f86984c8a1585ce4e
Issue-ID: OOM-1205
Signed-off-by: pramod <pramod.kumarsharma@amdocs.com>
22 files changed:
kubernetes/appc/requirements.yaml
kubernetes/appc/resources/config/appc/opt/onap/appc/bin/installAppcDb.sh
kubernetes/appc/resources/config/appc/opt/onap/appc/bin/startODL.sh
kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties
kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/dblib.properties
kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/svclogic.properties
kubernetes/appc/resources/config/appc/opt/onap/appc/svclogic/bin/showActiveGraphs.sh
kubernetes/appc/resources/config/appc/opt/onap/appc/svclogic/config/svclogic.properties
kubernetes/appc/resources/config/appc/opt/onap/ccsdk/bin/installSdncDb.sh
kubernetes/appc/resources/config/appc/opt/onap/ccsdk/bin/startODL.sh
kubernetes/appc/resources/config/appc/opt/onap/ccsdk/data/properties/dblib.properties
kubernetes/appc/resources/config/appc/opt/onap/ccsdk/data/properties/svclogic.properties
kubernetes/appc/resources/config/appc/opt/onap/ccsdk/svclogic/bin/showActiveGraphs.sh
kubernetes/appc/resources/config/appc/opt/onap/ccsdk/svclogic/config/svclogic.properties
kubernetes/appc/templates/pv.yaml
kubernetes/appc/templates/secrets.yaml
kubernetes/appc/templates/statefulset.yaml
kubernetes/appc/values.yaml
kubernetes/common/mariadb-galera/templates/pv.yaml
kubernetes/common/mariadb-galera/templates/service.yaml
kubernetes/common/mariadb-galera/templates/statefulset.yaml
kubernetes/common/mariadb-galera/values.yaml

index 1ca4de1..dab1ad6 100644 (file)
@@ -2,9 +2,9 @@ dependencies:
   - name: common
     version: ~2.0.0
     repository: '@local'
-  - name: mysql
+  - name: mariadb-galera
     version: ~2.0.0
     repository: '@local'
   - name: dgbuilder
     version: ~2.0.0
-    repository: '@local'
\ No newline at end of file
+    repository: '@local'
index abc2935..fffb155 100755 (executable)
@@ -20,7 +20,7 @@
 
 SDNC_HOME=${SDNC_HOME:-/opt/onap/ccsdk}
 APPC_HOME=${APPC_HOME:-/opt/onap/appc}
-MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
+MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.mariadbRootPassword}}}
 
 APPC_DB_USER=${APPC_DB_USER:-appcctl}
 APPC_DB_PASSWD=${APPC_DB_PASSWD:-appcctl}
@@ -28,7 +28,7 @@ APPC_DB_DATABASE=${SDN_DB_DATABASE:-appcctl}
 
 
 # Create tablespace and user account
-mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} mysql <<-END
+mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} mysql <<-END
 CREATE DATABASE ${APPC_DB_DATABASE};
 CREATE USER '${APPC_DB_USER}'@'localhost' IDENTIFIED BY '${APPC_DB_PASSWD}';
 CREATE USER '${APPC_DB_USER}'@'%' IDENTIFIED BY '${APPC_DB_PASSWD}';
@@ -39,16 +39,16 @@ END
 
 if [ -f ${APPC_HOME}/data/appcctl.dump ]
 then
-  mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} appcctl < ${APPC_HOME}/data/appcctl.dump
+  mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} appcctl < ${APPC_HOME}/data/appcctl.dump
 fi
 
 if [ -f ${APPC_HOME}/data/sdnctl.dump ]
 then
-  mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${APPC_HOME}/data/sdnctl.dump
+  mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${APPC_HOME}/data/sdnctl.dump
 fi
 
 if [ -f ${APPC_HOME}/data/sqlData.dump ]
 then
-  mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${APPC_HOME}/data/sqlData.dump
+  mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${APPC_HOME}/data/sqlData.dump
 fi
 
index 6e53ed1..96590ce 100755 (executable)
@@ -53,7 +53,7 @@ ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-admin}
 SDNC_HOME=${SDNC_HOME:-/opt/onap/ccsdk}
 APPC_HOME=${APPC_HOME:-/opt/onap/appc}
 SLEEP_TIME=${SLEEP_TIME:-120}
-MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
+MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.mariadbRootPassword}}}
 ENABLE_ODL_CLUSTER=${ENABLE_ODL_CLUSTER:-false}
 ENABLE_AAF=${ENABLE_AAF:-false}
 AAF_EXT_IP=${AAF_EXT_IP:-{{.Values.config.aafExtIP}}}
@@ -82,13 +82,13 @@ echo "" >> $APPC_HOME/data/properties/appc.properties
 #
 # Wait for database to init properly
 #
-echo "Waiting for mysql"
-until mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p{{.Values.config.dbRootPassword}} mysql &> /dev/null
+echo "Waiting for mariadbgalera"
+until mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p{{.Values.config.mariadbRootPassword}} mysql &> /dev/null
 do
   printf "."
   sleep 1
 done
-echo -e "\nmysql ready"
+echo -e "\nmariadbgalera ready"
 
 if [ ! -f ${SDNC_HOME}/.installed ]
 then
index 6631da4..9368514 100644 (file)
@@ -41,11 +41,11 @@ appc.topology.dg.method=topology-operation-all
 appc.topology.dg.version=2.0.0
 
 # TEMP - Properties that might be needed to make the AAI-APPC connection
-org.onap.appc.db.url.appcctl=jdbc:mysql://{{.Values.mysql.service.name}}:3306/appcctl
+org.onap.appc.db.url.appcctl=jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}:3306/appcctl
 org.onap.appc.db.user.appcctl=appcctl
 org.onap.appc.db.pass.appcctl=appcctl
 
-org.onap.appc.db.url.sdnctl=jdbc:mysql://{{.Values.mysql.service.name}}:3306/sdnctl
+org.onap.appc.db.url.sdnctl=jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}:3306/sdnctl
 org.onap.appc.db.user.sdnctl=sdnctl
 org.onap.appc.db.pass.sdnctl=gamma
 
index 17b7ffd..f5ae884 100644 (file)
@@ -21,8 +21,8 @@
 # dblib.properrties
 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}}:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.hosts=dbhost
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}:3306/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
index fd62b08..88bc419 100644 (file)
@@ -20,7 +20,7 @@
 
 org.onap.ccsdk.sli.dbtype = dblib
 #Note : the next 4 fields are only used if org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}:3306/sdnctl
 org.onap.ccsdk.sli.jdbc.database=sdnctl
 org.onap.ccsdk.sli.jdbc.user=sdnctl
 org.onap.ccsdk.sli.jdbc.password=gamma
index 03ad425..64ec40d 100755 (executable)
@@ -22,7 +22,7 @@
 MYSQL_USER=${MYSQL_USER:-sdnctl}
 MYSQL_PWD=${MYSQL_PWD:-gamma}
 MYSQL_DB=${MYSQL_DB:-sdnctl}
-MYSQL_HOST=${MYSQL_HOST:-{{.Values.mysql.service.name}}.{{.Release.Namespace}}}
+MYSQL_HOST=${MYSQL_HOST:-{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}}
 
 mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host=${MYSQL_HOST} ${MYSQL_DB} <<-END
 SELECT module, rpc, version, mode from SVC_LOGIC where active='Y';
index bd581e0..1319f97 100644 (file)
@@ -20,7 +20,7 @@
 ###
 
 org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}:3306/sdnctl
 org.onap.ccsdk.sli.jdbc.database = sdnctl
 org.onap.ccsdk.sli.jdbc.user = sdnctl
 org.onap.ccsdk.sli.jdbc.password = gamma
index deca2ff..728a67f 100755 (executable)
@@ -22,7 +22,7 @@
 ###
 
 SDNC_HOME=${SDNC_HOME:-/opt/onap/ccsdk}
-MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
+MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.mariadbRootPassword}}}
 
 SDNC_DB_USER=${SDNC_DB_USER:-sdnctl}
 SDNC_DB_PASSWD=${SDNC_DB_PASSWD:-gamma}
@@ -30,7 +30,7 @@ SDNC_DB_DATABASE=${SDN_DB_DATABASE:-sdnctl}
 
 
 # Create tablespace and user account
-mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} mysql <<-END
+mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} mysql <<-END
 CREATE DATABASE ${SDNC_DB_DATABASE};
 CREATE USER '${SDNC_DB_USER}'@'localhost' IDENTIFIED BY '${SDNC_DB_PASSWD}';
 CREATE USER '${SDNC_DB_USER}'@'%' IDENTIFIED BY '${SDNC_DB_PASSWD}';
@@ -41,6 +41,6 @@ END
 
 if [ -f ${SDNC_HOME}/data/odlsli.dump ]
 then
-mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${SDNC_HOME}/data/odlsli.dump
+mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p${MYSQL_PASSWD} sdnctl < ${SDNC_HOME}/data/odlsli.dump
 fi
 
index a84893c..5ea17d2 100755 (executable)
@@ -28,18 +28,18 @@ ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
 ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
 SDNC_HOME=${SDNC_HOME:-/opt/onap/sdnc}
 SLEEP_TIME=${SLEEP_TIME:-120}
-MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.dbRootPassword}}}
+MYSQL_PASSWD=${MYSQL_PASSWD:-{{.Values.config.mariadbRootPassword}}}
 
 #
 # Wait for database
 #
-echo "Waiting for mysql"
-until mysql -h {{.Values.mysql.service.name}}.{{.Release.Namespace}} -u root -p{{.Values.config.dbRootPassword}} mysql &> /dev/null
+echo "Waiting for mariadbgalera"
+until mysql -h {{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}} -u root -p{{.Values.config.mariadbRootPassword}} mysql &> /dev/null
 do
   printf "."
   sleep 1
 done
-echo -e "\nmysql ready"
+echo -e "\nmariadbgalera ready"
 
 if [ ! -f ${SDNC_HOME}/.installed ]
 then
index f603977..c680c2d 100644 (file)
@@ -22,8 +22,8 @@
 # dblib.properrties
 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}}:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.hosts=dbhost
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}:3306/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
index 908d60a..60b5233 100644 (file)
@@ -21,7 +21,7 @@
 
 org.onap.ccsdk.sli.dbtype = dblib
 #Note : the next 4 fields are only used if org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}:3306/sdnctl
 org.onap.ccsdk.sli.jdbc.database=sdnctl
 org.onap.ccsdk.sli.jdbc.user=sdnctl
 org.onap.ccsdk.sli.jdbc.password=gamma
index a568dfd..e5d06ff 100755 (executable)
@@ -22,7 +22,7 @@
 MYSQL_USER=${MYSQL_USER:-sdnctl}
 MYSQL_PWD=${MYSQL_PWD:-gamma}
 MYSQL_DB=${MYSQL_DB:-sdnctl}
-MYSQL_HOST=${MYSQL_HOST:-{{.Values.mysql.service.name}}.{{.Release.Namespace}}}
+MYSQL_HOST=${MYSQL_HOST:-{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}}
 
 mysql --user=${MYSQL_USER} --password=${MYSQL_PWD} --host=${MYSQL_HOST} ${MYSQL_DB} <<-END
 SELECT module, rpc, version, mode from SVC_LOGIC where active='Y';
index 44ae32f..73eafee 100644 (file)
@@ -20,7 +20,7 @@
 ###
 
 org.onap.ccsdk.sli.dbtype = jdbc
-org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://{{.Values.mysql.service.name}}.{{.Release.Namespace}}:3306/sdnctl
+org.onap.ccsdk.sli.jdbc.url = jdbc:mysql://{{.Values.config.mariadbGaleraSVCName}}.{{.Release.Namespace}}:3306/sdnctl
 org.onap.ccsdk.sli.jdbc.database = sdnctl
 org.onap.ccsdk.sli.jdbc.user = sdnctl
 org.onap.ccsdk.sli.jdbc.password = gamma
index 1021409..25257ea 100644 (file)
 # # See the License for the specific language governing permissions and
 # # limitations under the License.
 */}}
-{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
-{{ $pvNum := default 1 .Values.replicaCount | int }}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) -}}
+{{- range $i, $t := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" . }}-data0
-  namespace: {{ include "common.namespace" . }}
+  name: {{ include "common.fullname" $global }}-data{{$i}}
+  namespace: {{ include "common.namespace" $global }}
   labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
 spec:
   capacity:
-    storage: {{ .Values.persistence.size}}
+    storage: {{ $global.Values.persistence.size}}
   accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+    - {{ $global.Values.persistence.accessMode }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}0
-{{ if gt $pvNum 1 }}
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
 ---
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-data1
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}1
-{{ end }}
-{{ if gt $pvNum 2 }}
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-data2
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}2
-{{ end }}
-{{ if gt $pvNum 3 }}
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-data3
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}3
-{{ end }}
-{{ if gt $pvNum 4 }}
----
-kind: PersistentVolume
-apiVersion: v1
-metadata:
-  name: {{ include "common.fullname" . }}-data4
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
-spec:
-  capacity:
-    storage: {{ .Values.persistence.size}}
-  accessModes:
-    - {{ .Values.persistence.accessMode }}
-  storageClassName: "{{ include "common.fullname" . }}-data"
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
-  hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}4
-{{ end }}
+{{- end -}}
 {{- end -}}
index 345c194..03b2625 100644 (file)
@@ -10,4 +10,4 @@ metadata:
     heritage: {{ .Release.Service }}
 type: Opaque
 data:
-  db-root-password: {{ .Values.config.dbRootPassword | b64enc | quote }}
+  db-root-password: {{ .Values.config.mariadbRootPassword | b64enc | quote }}
index 791d933..d7d4dc1 100644 (file)
@@ -25,7 +25,7 @@ spec:
         - /root/ready.py
         args:
         - --container-name
-        - {{ .Values.mysql.nameOverride }}
+        - {{.Values.config.mariadbGaleraContName}}
         env:
         - name: NAMESPACE
           valueFrom:
index 007f723..cdb458d 100644 (file)
@@ -41,7 +41,12 @@ config:
   aafExtFQDN: aaf-onap-beijing-test.osaaf.org
   ansibleServiceName: appc-ansible-server
   ansiblePort: 8000
-  dbRootPassword: openECOMP1.0
+  mariadbRootPassword: secretpassword
+  userName: my-user
+  userPassword: my-password
+  mysqlDatabase: my-database
+  mariadbGaleraSVCName: appc-dbhost
+  mariadbGaleraContName: appc-db
   enableAAF: false
   enableClustering: true
   configDir: /opt/onap/appc/data/properties
@@ -63,7 +68,7 @@ appc-ansible-server:
   config:
     mysqlServiceName: appc-dbhost
 
-mysql:
+mariadb-galera:
   nameOverride: appc-db
   service:
     name: appc-dbhost
index 184728f..a2096fd 100644 (file)
 # See the License for the specific language governing permissions and
 # limitations under the License.
 */}}
-
-{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) -}}
+{{- $global := . }}
+{{- if and $global.Values.persistence.enabled (not $global.Values.persistence.existingClaim) -}}
+{{- range $i, $t := until (int $global.Values.replicaCount)}}
 kind: PersistentVolume
 apiVersion: v1
 metadata:
-  name: {{ include "common.fullname" }}
-  namespace: {{ include "common.namespace" . }}
+  name: {{ include "common.fullname" $global }}-data{{$i}}
+  namespace: {{ include "common.namespace" $global }}
   labels:
-    app: {{ include "common.name" . }}
-    chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}"
-    release: "{{ .Release.Name }}"
-    heritage: "{{ .Release.Service }}"
-    name: {{ include "common.fullname" . }}
+    app: {{ include "common.fullname" $global }}
+    chart: "{{ $global.Chart.Name }}-{{ $global.Chart.Version | replace "+" "_" }}"
+    release: "{{ $global.Release.Name }}"
+    heritage: "{{ $global.Release.Service }}"
+    name: {{ include "common.fullname" $global }}
 spec:
   capacity:
-    storage: {{ .Values.persistence.size}}
+    storage: {{ $global.Values.persistence.size}}
   accessModes:
-    - {{ .Values.persistence.accessMode }}
-  persistentVolumeReclaimPolicy: {{ .Values.persistence.volumeReclaimPolicy }}
+    - {{ $global.Values.persistence.accessMode }}
+  persistentVolumeReclaimPolicy: {{ $global.Values.persistence.volumeReclaimPolicy }}
+  storageClassName: "{{ include "common.fullname" $global }}-data"
   hostPath:
-    path: {{ .Values.global.persistence.mountPath | default .Values.persistence.mountPath }}/{{ .Release.Name }}/{{ .Values.persistence.mountSubPath }}
+    path: {{ $global.Values.global.persistence.mountPath | default $global.Values.persistence.mountPath }}/{{ $global.Release.Name }}/{{ $global.Values.persistence.mountSubPath }}{{$i}}
+---
+{{- end -}}
 {{- end -}}
index d17d350..ae11a26 100644 (file)
@@ -1,9 +1,24 @@
+# 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.
+
 apiVersion: v1
 kind: Service
 metadata:
   annotations:
     service.alpha.kubernetes.io/tolerate-unready-endpoints: "true"
-  name: {{ include "common.servicename" . }}
+#  name: {{ include "common.servicename" . }}
+  name: {{ .Values.service.name }}
   namespace: {{ include "common.namespace" . }}
   labels:
     app: {{ include "common.fullname" . }}
index ed7e1fc..cddec26 100644 (file)
@@ -9,7 +9,7 @@ metadata:
     release: "{{ .Release.Name }}"
     heritage: "{{ .Release.Service }}"
 spec:
-  serviceName: {{ include "common.fullname" . }}
+  serviceName: {{ .Values.service.name }}
   replicas: {{ .Values.replicaCount }}
   template:
     metadata:
@@ -34,7 +34,7 @@ spec:
       imagePullSecrets:
       - name: {{ include "common.namespace" . }}-docker-registry-key
       containers:
-        - name: {{ include "common.fullname" . }}
+        - name: {{ include "common.name" . }}
           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy | quote}}
           env:
@@ -93,7 +93,6 @@ spec:
 {{- if .Values.persistence.enabled }}
           - mountPath: /var/lib/mysql
             name: {{ include "common.fullname" . }}-data
-            subPath: data
       initContainers:
         - name: mariadb-galera-prepare
           image: "{{ include "common.repository" . }}/{{ .Values.imageInit }}"
@@ -104,15 +103,12 @@ spec:
   volumeClaimTemplates:
   - metadata:
       name: {{ include "common.fullname" . }}-data
-      annotations:
-  {{- if .Values.persistence.storageClass }}
-        volume.beta.kubernetes.io/storage-class: {{ .Values.persistence.storageClass | quote }}
-  {{- else }}
-        volume.alpha.kubernetes.io/storage-class: default
-  {{- end }}
+      labels:
+        name: {{ include "common.fullname" . }}
     spec:
       accessModes:
       - {{ .Values.persistence.accessMode | quote }}
+      storageClassName: {{ include "common.fullname" . }}-data
       resources:
         requests:
           storage: {{ .Values.persistence.size | quote }}
index 6e5fb5a..4b9837d 100644 (file)
@@ -46,7 +46,7 @@ readiness:
 
 ## Persist data to a persitent volume
 persistence:
-  enabled: false
+  enabled:  true
 
   ## A manually managed Persistent Volume and Claim
   ## Requires persistence.enabled: true
@@ -62,9 +62,11 @@ persistence:
   ##   GKE, AWS & OpenStack)
   ##
   # storageClass: "-"
-  accessMode: ReadWriteOnce
+  accessMode: ReadWriteMany
   size: 2Gi
-
+  mountPath: /dockerdata-nfs
+  mountSubPath: "mariadb-galera/data"
+  mysqlPath: /var/lib/mysql
 
 service:
   internalPort: 3306