[COMMON] Prioritize the deployment of wrappers
[oom.git] / kubernetes / policy / templates / job.yaml
index eb5968a..2503c6f 100755 (executable)
@@ -16,6 +16,7 @@
 # limitations under the License.
 */}}
 
+{{ if not .Values.global.postgres.localCluster }}
 apiVersion: batch/v1
 kind: Job
 metadata:
@@ -72,8 +73,7 @@ spec:
           {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
         - name: MYSQL_PORT
           value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}"
-        resources:
-{{ include "common.resources" . }}
+        resources: {{ include "common.resources" . | nindent 10 }}
       {{- if (include "common.onServiceMesh" .) }}
       - name: policy-service-mesh-wait-for-job-container
         image: {{ include "repositoryGenerator.image.quitQuit" . }}
@@ -101,6 +101,7 @@ spec:
             items:
               - key: db.sh
                 path: db.sh
+{{ end }}
 
 {{ if .Values.global.postgres.localCluster }}
 ---
@@ -140,17 +141,16 @@ spec:
              /docker-entrypoint-initdb.d/db-pg.sh
         env:
           - name: PG_ADMIN_PASSWORD
-            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-root-pass" "key" "password") | indent 12 }}
+            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-root-password" "key" "password") | indent 12 }}
           - name: PG_HOST
             value: "{{ .Values.postgres.service.name2 }}"
           - name: PG_USER
-            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 12 }}
+            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 12 }}
           - name: PG_USER_PASSWORD
-            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 12 }}
+            {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 12 }}
           - name: PG_PORT
             value: "{{ .Values.postgres.service.internalPort }}"
-        resources:
-{{ include "common.resources" . }}
+        resources: {{ include "common.resources" . | nindent 10 }}
       {{- if (include "common.onServiceMesh" .) }}
       - name: policy-service-mesh-wait-for-job-container
         image: {{ include "repositoryGenerator.image.quitQuit" . }}
@@ -181,6 +181,7 @@ spec:
 {{ end }}
 
 ---
+{{ if not .Values.global.postgres.localCluster }}
 apiVersion: batch/v1
 kind: Job
 metadata:
@@ -242,8 +243,7 @@ spec:
           value: {{ .Values.dbmigrator.policy_home }}
         - name: SCRIPT_DIRECTORY
           value: "sql"
-        resources:
-{{ include "common.resources" . }}
+        resources: {{ include "common.resources" . | nindent 10 }}
       {{- if (include "common.onServiceMesh" .) }}
       - name: policy-service-mesh-wait-for-job-container
         image: {{ include "repositoryGenerator.image.quitQuit" . }}
@@ -271,7 +271,7 @@ spec:
             items:
               - key: db_migrator_policy_init.sh
                 path: db_migrator_policy_init.sh
-
+{{ end }}
 {{ if .Values.global.postgres.localCluster }}
 ---
 apiVersion: batch/v1
@@ -326,9 +326,9 @@ spec:
         - name: SQL_HOST
           value: "{{ .Values.postgres.service.name2 }}"
         - name: SQL_USER
-          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "login") | indent 10 }}
+          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
         - name: SQL_PASSWORD
-          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
+          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
         - name: SQL_DB
           value: {{ .Values.dbmigrator.schema }}
         - name: POLICY_HOME
@@ -336,9 +336,8 @@ spec:
         - name: SCRIPT_DIRECTORY
           value: "postgres"
         - name: PGPASSWORD
-          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "pg-user-creds" "key" "password") | indent 10 }}
-        resources:
-{{ include "common.resources" . }}
+          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
+        resources: {{ include "common.resources" . | nindent 10 }}
       {{- if (include "common.onServiceMesh" .) }}
       - name: policy-service-mesh-wait-for-job-container
         image: {{ include "repositoryGenerator.image.quitQuit" . }}