Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / aai / components / aai-sparky-be / templates / deployment.yaml
index 51d577b..d23d9cf 100644 (file)
@@ -33,12 +33,15 @@ spec:
       app: {{ include "common.name" . }}
   template:
     metadata:
+      annotations:
+        sidecar.istio.io/rewriteAppHTTPProbers: "false"
       labels:
         app: {{ include "common.name" . }}
         release: {{ include "common.release" . }}
       name: {{ include "common.name" . }}
     spec:
       initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
+      {{- if ( include "common.needTLS" .) }}
       - command:
         - sh
         args:
@@ -47,6 +50,11 @@ spec:
           echo "*** retrieve Truststore and Keystore password"
           export $(cat {{ .Values.certInitializer.credsPath }}/mycreds.prop \
             | xargs -0)
+          if [ -z "$KEYSTORE_PASSWORD" ]
+          then
+            echo " /!\ certificates retrieval failed"
+            exit 1
+          fi
           echo "*** write them in portal part"
           cd /config-input
           for PFILE in `ls -1 .`
@@ -61,6 +69,7 @@ spec:
         image: {{ include "repositoryGenerator.image.envsubst" . }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-update-config
+      {{- end }}
       - command:
         - /app/ready.py
         args:
@@ -100,7 +109,7 @@ spec:
           name: portal-config
         - mountPath: /opt/app/sparky/config/portal/BOOT-INF/classes/
           name: portal-config-props
-        - mountPath: /var/log/onap
+        - mountPath: {{ .Values.log.path }}
           name: logs
         - mountPath:  /opt/app/sparky/config/application.properties
           name: config
@@ -157,20 +166,8 @@ spec:
       {{- end }}
 
       # side car containers
-      - name: filebeat-onap
-        image: {{ include "repositoryGenerator.image.logging" . }}
-        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-        volumeMounts:
-        - mountPath: /usr/share/filebeat/filebeat.yml
-          subPath: filebeat.yml
-          name: filebeat-conf
-        - mountPath: /var/log/onap
-          name: logs
-        - mountPath: /usr/share/filebeat/data
-          name: aai-sparky-filebeat
-        resources:
-{{ include "common.resources" . }}
-
+      {{ include "common.log.sidecar" . | nindent 6 }}
+      serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
       volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
       - name: localtime
         hostPath:
@@ -179,9 +176,11 @@ spec:
         configMap:
           name: {{ include "common.fullname" . }}
       - name: portal-config
+      {{- if .Values.global.aafEnabled }}
         emptyDir:
           medium: Memory
       - name: portal-config-input
+      {{- end }}
         configMap:
           name: {{ include "common.fullname" . }}-portal
       - name: portal-config-props
@@ -190,13 +189,9 @@ spec:
       - name: auth-config
         secret:
           secretName: {{ include "common.fullname" . }}
-      - name: filebeat-conf
-        configMap:
-          name: aai-filebeat
       - name: logs
         emptyDir: {}
-      - name: aai-sparky-filebeat
-        emptyDir: {}
+        {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix .)) | nindent 6 }}
       - name: modeldir
         emptyDir: {}
       restartPolicy: {{ .Values.global.restartPolicy | default .Values.restartPolicy }}