DBaaS standalone and HA version update
[ric-plt/ric-dep.git] / helm / dbaas / templates / appconfig.yaml
similarity index 56%
rename from helm/dbaasha/templates/healthchecks.yaml
rename to helm/dbaas/templates/appconfig.yaml
index ac3575a..a26e352 100644 (file)
@@ -1,6 +1,6 @@
 ################################################################################
-#   Copyright (c) 2019 AT&T Intellectual Property.                             #
-#   Copyright (c) 2019 Nokia.                                                  #
+#   Copyright (c) 2020 AT&T Intellectual Property.                             #
+#   Copyright (c) 2020 Nokia.                                                  #
 #                                                                              #
 #   Licensed under the Apache License, Version 2.0 (the "License");            #
 #   you may not use this file except in compliance with the License.           #
 #   See the License for the specific language governing permissions and        #
 #   limitations under the License.                                             #
 ################################################################################
-
+{{ $platformNameSpace := include "common.namespace.platform" . }}
+{{ $xAppNameSpace := include "common.namespace.xapp" . }}
+{{ $nameSpaceList := list $platformNameSpace $xAppNameSpace }}
+{{- range $nameSpaceList }}
+{{- $namespace := . }}
+---
 apiVersion: v1
 kind: ConfigMap
 metadata:
-  name: {{ template "common.configmapname.dbaasha" . }}-probes
-  labels:
-    heritage: {{ .Release.Service }}
-    release: {{ .Release.Name }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version }}
-    app: {{ include "common.namespace.platform" . }}-{{ include "common.name.dbaasha" . }}
+{{- if eq $namespace $platformNameSpace }}
+  name: {{ include "common.configmapname.dbaas" $ }}-appconfig
+{{- else }}
+  name: dbaas-appconfig
+{{- end }}
+  namespace: {{ $namespace }}
 data:
-  readiness.sh: |
-    #!/bin/sh
-    set -eu
-    CHECK_SERVER="$(timeout -t "$2" redis-cli -p "$1"{{ if .Values.auth }} -a "$AUTH"{{ end }} ping)"
-
-    if [ "$CHECK_SERVER" != "PONG" ]; then
-        echo "Server check failed with: $CHECK_SERVER"
-        exit 1
-    fi
+{{- if $.Values.dbaas.enableHighAvailability }}
+  DBAAS_SERVICE_SENTINEL_PORT: {{ include "common.serviceport.dbaas.sentinel" . | quote }}
+  DBAAS_MASTER_NAME: {{ $.Values.dbaas.redis.masterGroupName }}
+{{- end }}
+  DBAAS_SERVICE_HOST: {{ include "common.servicename.dbaas.tcp" $ }}.{{ $platformNameSpace }}
+  DBAAS_SERVICE_PORT: {{ include "common.serviceport.dbaas.redis" $ | quote }}
+{{- end }}