[GENERAL] Use readiness container v3.0.1
[oom.git] / kubernetes / modeling / charts / modeling-etsicatalog / templates / deployment.yaml
index 00c2661..91fa483 100644 (file)
@@ -12,7 +12,7 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-apiVersion: extensions/v1beta1
+apiVersion: apps/v1
 kind: Deployment
 metadata:
   name: {{ include "common.fullname" . }}
@@ -23,6 +23,9 @@ metadata:
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
+  selector:
+    matchLabels:
+      app: {{ include "common.name" . }}
   replicas: {{ .Values.replicaCount }}
   template:
     metadata:
@@ -34,7 +37,7 @@ spec:
     spec:
       initContainers:
       - command:
-        - /root/ready.py
+        - /app/ready.py
         args:
         - --container-name
         - modeling-mariadb
@@ -44,9 +47,19 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
+      - command:
+        - /bin/sh
+        - -c
+        - chown -R 1000:1000 /service/modeling/etsicatalog/static
+        image: "{{ include "common.repository" . }}/{{ .Values.initImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-init
+        volumeMounts:
+        - name: {{ include "common.fullname" . }}-etsicatalog
+          mountPath: /service/modeling/etsicatalog/static
       containers:
         - name: {{ include "common.name" . }}
           command:
@@ -73,6 +86,10 @@ spec:
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
+          - name: MSB_PROTO
+            value: "{{ .Values.global.config.msbProtocol }}"
+          - name: SSL_ENABLED
+            value: "{{ .Values.global.config.ssl_enabled }}"
           - name: MSB_ADDR
             value: "{{ .Values.global.config.msbServiceName }}:{{ .Values.global.config.msbPort }}"
           - name: MYSQL_ADDR