[AAI] Service Mesh compatibility
[oom.git] / kubernetes / aai / templates / deployment.yaml
index 83d7823..85b1111 100644 (file)
@@ -39,7 +39,7 @@ spec:
       annotations:
         checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
     spec:
-      initContainers:
+      initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
       - command:
         - /app/ready.py
         args:
@@ -75,25 +75,25 @@ spec:
           subPath: haproxy.cfg
         {{ end }}
           name: haproxy-cfg
-        - mountPath: /etc/ssl/private/aai.pem
-          name: aai-pem
-          subPath: aai.pem
+        {{- include "common.certInitializer.volumeMount" . | nindent 8 }}
         ports:
         - containerPort: {{ .Values.service.internalPort }}
+        - containerPort: {{ .Values.service.internalPlainPort }}
         # disable liveness probe when breakpoints set in debugger
         # so K8s doesn't restart unresponsive container
         {{- if eq .Values.liveness.enabled true }}
         livenessProbe:
           tcpSocket:
-            port: {{ .Values.service.internalPort }}
+            port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
           periodSeconds: {{ .Values.liveness.periodSeconds }}
         {{ end -}}
         readinessProbe:
           httpGet:
             path: /aai/util/echo
-            port: {{ .Values.service.internalPort }}
-            scheme: HTTPS
+            port: {{ (eq "true" (include "common.needTLS" .)) | ternary .Values.service.internalPort .Values.service.internalPlainPort }}
+            #scheme: HTTPS
+            scheme: {{ (eq "true" (include "common.needTLS" .)) | ternary "HTTPS" "HTTP" }}
             httpHeaders:
             - name: X-FromAppId
               value: OOM_ReadinessCheck
@@ -128,8 +128,6 @@ spec:
         - name: haproxy-cfg
           configMap:
             name: aai-deployment-configmap
-        - name: aai-pem
-          secret:
-            secretName: aai-haproxy-secret
+        {{ include "common.certInitializer.volumes" . | nindent 8 }}
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"