SO Rolling upgrade using helm hooks
[oom.git] / kubernetes / so / charts / so-sdc-controller / templates / deployment.yaml
index a69c189..9211571 100755 (executable)
@@ -35,19 +35,25 @@ spec:
         release: {{ .Release.Name }}
     spec:
       initContainers:
-      - name: so-chown
-        image: alpine:3.6
-        volumeMounts:
-        - name: logs
-          mountPath: /app/logs
-        imagePullPolicy: {{ index .Values.pullPolicy }}
-        command: ["/bin/sh", "-c", "chown -Rf 1000:1000 /app/logs"]
-      restartPolicy: Always
+      - command:
+        - /root/job_complete.py
+        args:
+        - --job-name
+        - {{ .Release.Name }}-so-mariadb-config-job
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-readiness
       containers:
       - name: {{ include "common.name" . }}
         image: {{ include "common.repository" . }}/{{ .Values.image }}
         resources:
-{{ toYaml (pluck .Values.flavor .Values.resources| first) | indent 12 }}
+{{ include "common.resources" . | indent 12 }}
         env:
         - name: DB_HOST
           valueFrom:
@@ -79,36 +85,13 @@ spec:
             secretKeyRef:
               name: {{ .Release.Name}}-so-db-secrets
               key: mariadb.admin.password
-        - name: CADI_KEYSTORE_PASSWORD
-          valueFrom:
-            secretKeyRef:
-              name: {{ .Release.Name}}-so-ssl-pwd-secret
-              key: cadi_keystore_password
-        - name: CADI_TRUSTSTORE_PASSWORD
-          valueFrom:
-            secretKeyRef:
-              name: {{ .Release.Name}}-so-ssl-pwd-secret
-              key: cadi_truststore_password
-        - name: MSO_KEYSTORE_PASSWORD
-          valueFrom:
-            secretKeyRef:
-              name: {{ .Release.Name}}-so-ssl-client-secret
-              key: keystore_password
-        - name: MSO_TRUSTSTORE_PASSWORD
-          valueFrom:
-            secretKeyRef:
-              name: {{ .Release.Name}}-so-ssl-client-secret
-              key: truststore_password
         envFrom:
         - configMapRef:
             name: {{ include "common.fullname" . }}-configmap
-        imagePullPolicy:  {{ index .Values "global" "pullPolicy" }}
+        imagePullPolicy:  {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         volumeMounts:
         - name: logs
           mountPath: /app/logs
-        - name: certs
-          mountPath: /app/certs/
-          readOnly: true
         - name: config
           mountPath: /app/config
           readOnly: true
@@ -129,9 +112,6 @@ spec:
       volumes:
       - name: logs
         emptyDir: {}
-      - name: certs
-        secret:
-            secretName: {{ .Release.Name}}-so-ssl-secret
       - name: config
         configMap:
             name: {{ include "common.fullname" . }}-app-configmap