blob: 3650990b99dab9d07739cee8341d0aee87f1d212 [file] [log] [blame]
Kiran Kamineni286d1cd2018-10-08 15:44:37 -07001{{/*
2# Copyright 2018 Intel Corporation, Inc
3#
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8# http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15*/}}
16
17apiVersion: batch/v1
18kind: Job
19metadata:
20 name: {{ include "common.fullname" . }}-preload
21 namespace: {{ include "common.namespace" . }}
22 labels:
23 app: {{ include "common.name" . }}
24 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010025 release: {{ include "common.release" . }}
Kiran Kamineni286d1cd2018-10-08 15:44:37 -070026 heritage: {{ .Release.Service }}
27spec:
Kiran Kamineni286d1cd2018-10-08 15:44:37 -070028 template:
29 metadata:
30 labels:
31 app: {{ include "common.name" . }}
Krzysztof Opasiak137d7cc2020-01-24 23:49:11 +010032 release: {{ include "common.release" . }}
Kiran Kamineni286d1cd2018-10-08 15:44:37 -070033 spec:
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +020034 initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }}
Krzysztof Opasiak59d47c32020-04-16 20:01:05 +020035 - command:
36 - sh
37 args:
38 - -c
39 - "export AAI_PASS=${AAI_PASS_PLAIN};
40 export CONDUCTOR_PASS=${CONDUCTOR_PASS_PLAIN};
41 export SDNC_PASS=${SDNC_PASS_PLAIN};
42 export MUSIC_PASS=${MUSIC_PASS_PLAIN};
43 export AAF_PASS=${AAF_PASS_PLAIN};
44 export POLICY_PLAT_PASS=${POLICY_PLAT_PASS_PLAIN};
45 export POLICY_CLI_PASS=${POLICY_CLI_PASS_PLAIN};
46 export OSDF_PLACEMENT_PASS=${OSDF_PLACEMENT_PASS_PLAIN};
47 export OSDF_PLACEMENT_SO_PASS=${OSDF_PLACEMENT_SO_PASS_PLAIN};
48 export OSDF_PLACMENET_VFC_PASS=${OSDF_PLACEMENT_VFC_PASS_PLAIN};
49 export OSDF_CM_SCHEDULER_PASS=${OSDF_CM_SCHEDULER_PASS_PLAIN};
50 export CONFIG_DB_PASS=${CONFIG_DB_PASS_PLAIN};
51 export OSDF_PCI_OPT_PASS=${OSDF_PCI_OPT_PASS_PLAIN};
52 export OSDF_OPT_ENGINE_PASS=${OSDF_OPT_ENGINE_PASS_PLAIN};
vrvarma26dbd2b2020-05-18 19:37:19 -040053 export SO_PASS=${SO_PASS_PLAIN};
Krzysztof Opasiak59d47c32020-04-16 20:01:05 +020054 cd /config-input;
55 for PFILE in `find . -not -type d | grep -v -F ..`; do
56 envsubst <${PFILE} >/config/${PFILE};
57 done"
58 env:
59 - name: AAI_USER
60 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-creds" "key" "login") | indent 10 }}
61 - name: AAI_PASS_PLAIN
62 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-creds" "key" "password") | indent 10 }}
63
64 - name: CONDUCTOR_USER
65 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "conductor-creds" "key" "login") | indent 10 }}
66 - name: CONDUCTOR_PASS_PLAIN
67 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "conductor-creds" "key" "password") | indent 10 }}
68
69 - name: SDNC_USER
70 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnc-creds" "key" "login") | indent 10 }}
71 - name: SDNC_PASS_PLAIN
72 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnc-creds" "key" "password") | indent 10 }}
73
74 - name: MUSIC_USER
75 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "music-creds" "key" "login") | indent 10 }}
76 - name: MUSIC_PASS_PLAIN
77 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "music-creds" "key" "password") | indent 10 }}
78
79 - name: AAF_USER
80 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aaf-creds" "key" "login") | indent 10 }}
81 - name: AAF_PASS_PLAIN
82 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aaf-creds" "key" "password") | indent 10 }}
83
84 - name: POLICY_PLAT_USER
85 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-plat-creds" "key" "login") | indent 10 }}
86 - name: POLICY_PLAT_PASS_PLAIN
87 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-plat-creds" "key" "password") | indent 10 }}
88
89 - name: POLICY_CLI_USER
90 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-cli-creds" "key" "login") | indent 10 }}
91 - name: POLICY_CLI_PASS_PLAIN
92 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-cli-creds" "key" "password") | indent 10 }}
93
94 - name: OSDF_PLACEMENT_USER
95 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-creds" "key" "login") | indent 10 }}
96 - name: OSDF_PLACEMENT_PASS_PLAIN
97 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-creds" "key" "password") | indent 10 }}
98
99 - name: OSDF_PLACEMENT_SO_USER
100 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-so-creds" "key" "login") | indent 10 }}
101 - name: OSDF_PLACEMENT_SO_PASS_PLAIN
102 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-so-creds" "key" "password") | indent 10 }}
103
104 - name: OSDF_PLACEMENT_VFC_USER
105 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-vfc-creds" "key" "login") | indent 10 }}
106 - name: OSDF_PLACEMENT_VFC_PASS_PLAIN
107 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-vfc-creds" "key" "password") | indent 10 }}
108
109 - name: OSDF_CM_SCHEDULER_USER
110 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-cm-scheduler-creds" "key" "login") | indent 10 }}
111 - name: OSDF_CM_SCHEDULER_PASS_PLAIN
112 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-cm-scheduler-creds" "key" "password") | indent 10 }}
113
114 - name: CONFIG_DB_USER
115 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "config-db-creds" "key" "login") | indent 10 }}
116 - name: CONFIG_DB_PASS_PLAIN
117 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "config-db-creds" "key" "password") | indent 10 }}
118
119 - name: OSDF_PCI_OPT_USER
120 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-pci-opt-creds" "key" "login") | indent 10 }}
121 - name: OSDF_PCI_OPT_PASS_PLAIN
122 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-pci-opt-creds" "key" "password") | indent 10 }}
123
124 - name: OSDF_OPT_ENGINE_USER
125 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-opt-engine-creds" "key" "login") | indent 10 }}
126 - name: OSDF_OPT_ENGINE_PASS_PLAIN
127 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-opt-engine-creds" "key" "password") | indent 10 }}
vrvarma26dbd2b2020-05-18 19:37:19 -0400128
129 - name: SO_USER
130 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-creds" "key" "login") | indent 10 }}
131 - name: SO_PASS_PLAIN
132 {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-creds" "key" "password") | indent 10 }}
133
Krzysztof Opasiak59d47c32020-04-16 20:01:05 +0200134 volumeMounts:
135 - mountPath: /config-input
136 name: {{ include "common.name" . }}-preload-input
137 - mountPath: /config/
138 name: {{ include "common.name" . }}-preload
139 image: "{{ .Values.global.envsubstImage }}"
140 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
141 name: {{ include "common.name" . }}-update-config
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +0200142 - image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}"
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700143 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
144 name: {{ include "common.name" . }}-readiness
145 command:
Sylvain Desbureaux1694e1d2020-08-21 09:58:25 +0200146 - /app/ready.py
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700147 args:
148 - --container-name
149 - "aaf-sms"
150 - --container-name
151 - "aaf-sms-quorumclient"
152 env:
153 - name: NAMESPACE
154 valueFrom:
155 fieldRef:
156 apiVersion: v1
157 fieldPath: metadata.namespace
158 containers:
159 - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
dkamdocs6ad3a1c2018-12-21 09:25:53 +0000160 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700161 name: {{ include "common.name" . }}-preload
162 command:
163 - "/sms/bin/preload"
164 - "-cacert"
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200165 - "{{ .Values.certInitializer.mountPath }}/local/{{ .Values.certInitializer.root_ca_name }}"
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700166 - "-jsondir"
167 - "/preload/config"
168 - "-serviceport"
169 - "{{ .Values.service.internalPort }}"
170 - "-serviceurl"
171 - "https://aaf-sms.{{ include "common.namespace" . }}"
172 workingDir: /sms
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200173 volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }}
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700174 - mountPath: /etc/localtime
175 name: localtime
176 readOnly: true
177 - mountPath: /preload/config
178 name: {{ include "common.name" . }}-preload
179 resources:
180{{ include "common.resources" . | indent 10 }}
181 {{- if .Values.nodeSelector }}
182 nodeSelector:
183{{ toYaml .Values.nodeSelector | indent 10 }}
184 {{- end -}}
185 {{- if .Values.affinity }}
186 affinity:
187{{ toYaml .Values.affinity | indent 10 }}
188 {{- end }}
Sylvain Desbureaux0de302a2020-06-05 15:19:22 +0200189 volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }}
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700190 - name: localtime
191 hostPath:
192 path: /etc/localtime
Krzysztof Opasiak59d47c32020-04-16 20:01:05 +0200193 - name: {{ include "common.name" . }}-preload-input
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700194 configMap:
195 name: {{ include "common.fullname" . }}-preload
Krzysztof Opasiak59d47c32020-04-16 20:01:05 +0200196 - name: {{ include "common.name" . }}-preload
197 emptyDir:
198 medium: Memory
Kiran Kamineni286d1cd2018-10-08 15:44:37 -0700199 restartPolicy: OnFailure
200 imagePullSecrets:
201 - name: "{{ include "common.namespace" . }}-docker-registry-key"