[MODELING]Modify the owner of static directory to onap instead of root
[oom.git] / kubernetes / modeling / charts / modeling-etsicatalog / templates / deployment.yaml
index 08d5e13..0c1ba30 100644 (file)
@@ -20,7 +20,7 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
   replicas: {{ .Values.replicaCount }}
@@ -28,7 +28,7 @@ spec:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
       annotations:
         sidecar.istio.io/inject: "{{.Values.istioSidecar}}"
     spec:
@@ -47,8 +47,23 @@ spec:
         image: "{{ .Values.global.readinessRepository }}/{{ .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:
+            - bash
+          args:
+            - -c
+            - 'MYSQL_AUTH=root:${MYSQL_ROOT_PASSWORD} ./docker-entrypoint.sh'
           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
           ports:
@@ -68,14 +83,16 @@ spec:
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
-            - name: MSB_ADDR
-              value: "{{ .Values.global.config.msbServiceName }}:{{ .Values.global.config.msbPort }}"
-            - name: MYSQL_ADDR
-              value: "{{ .Values.global.config.dbServiceName }}:{{ .Values.global.config.dbPort }}"
-            - name: MYSQL_AUTH
-              value: "{{ .Values.global.config.dbUser }}:{{ .Values.global.config.mariadbRootPassword }}"
-            - name: REDIS_ADDR
-              value: "{{ .Values.global.config.redisServiceName }}:{{ .Values.global.config.redisPort }}"
+          - 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
+            value: {{ (index .Values "mariadb-galera" "service" "name") }}:{{ (index .Values "mariadb-galera" "service" "internalPort") }}
+          - name: MYSQL_ROOT_PASSWORD
+            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-pass" "key" "password") | indent 12}}
           volumeMounts:
           - name: {{ include "common.fullname" . }}-etsicatalog
             mountPath: /service/modeling/etsicatalog/static
@@ -130,7 +147,7 @@ spec:
 
         - name: {{ include "common.fullname" . }}-filebeat-conf
           configMap:
-            name: {{ .Release.Name }}-modeling-filebeat-configmap
+            name: {{ include "common.release" . }}-modeling-filebeat-configmap
         - name: {{ include "common.fullname" . }}-data-filebeat
           emptyDir: {}
       imagePullSecrets: