Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 1 | {{/* |
| 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 | |
| 17 | apiVersion: batch/v1 |
| 18 | kind: Job |
| 19 | metadata: |
| 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 Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 25 | release: {{ include "common.release" . }} |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 26 | heritage: {{ .Release.Service }} |
| 27 | spec: |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 32 | release: {{ include "common.release" . }} |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 33 | spec: |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 34 | initContainers: {{ include "common.certInitializer.initContainer" . | nindent 6 }} |
Krzysztof Opasiak | 59d47c3 | 2020-04-16 20:01:05 +0200 | [diff] [blame] | 35 | - 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}; |
vrvarma | 26dbd2b | 2020-05-18 19:37:19 -0400 | [diff] [blame] | 53 | export SO_PASS=${SO_PASS_PLAIN}; |
krishnaa96 | 2652e51 | 2021-03-10 12:02:52 +0530 | [diff] [blame] | 54 | export SDC_PASS=${SDC_PASS_PLAIN}; |
Sylvain Desbureaux | ab9ae72 | 2022-02-04 08:57:06 +0100 | [diff] [blame] | 55 | {{- if .Values.cps.enabled }} |
krishnaa96 | 07fc3ea | 2021-08-02 11:19:16 +0530 | [diff] [blame] | 56 | export CPS_PASS=${CPS_PASS_PLAIN}; |
Sylvain Desbureaux | ab9ae72 | 2022-02-04 08:57:06 +0100 | [diff] [blame] | 57 | {{- end }} |
Krzysztof Opasiak | 59d47c3 | 2020-04-16 20:01:05 +0200 | [diff] [blame] | 58 | cd /config-input; |
| 59 | for PFILE in `find . -not -type d | grep -v -F ..`; do |
| 60 | envsubst <${PFILE} >/config/${PFILE}; |
| 61 | done" |
| 62 | env: |
| 63 | - name: AAI_USER |
| 64 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-creds" "key" "login") | indent 10 }} |
| 65 | - name: AAI_PASS_PLAIN |
| 66 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aai-creds" "key" "password") | indent 10 }} |
| 67 | |
| 68 | - name: CONDUCTOR_USER |
| 69 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "conductor-creds" "key" "login") | indent 10 }} |
| 70 | - name: CONDUCTOR_PASS_PLAIN |
| 71 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "conductor-creds" "key" "password") | indent 10 }} |
| 72 | |
| 73 | - name: SDNC_USER |
| 74 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnc-creds" "key" "login") | indent 10 }} |
| 75 | - name: SDNC_PASS_PLAIN |
| 76 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdnc-creds" "key" "password") | indent 10 }} |
| 77 | |
| 78 | - name: MUSIC_USER |
| 79 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "music-creds" "key" "login") | indent 10 }} |
| 80 | - name: MUSIC_PASS_PLAIN |
| 81 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "music-creds" "key" "password") | indent 10 }} |
| 82 | |
| 83 | - name: AAF_USER |
| 84 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aaf-creds" "key" "login") | indent 10 }} |
| 85 | - name: AAF_PASS_PLAIN |
| 86 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "aaf-creds" "key" "password") | indent 10 }} |
| 87 | |
| 88 | - name: POLICY_PLAT_USER |
| 89 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-plat-creds" "key" "login") | indent 10 }} |
| 90 | - name: POLICY_PLAT_PASS_PLAIN |
| 91 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-plat-creds" "key" "password") | indent 10 }} |
| 92 | |
| 93 | - name: POLICY_CLI_USER |
| 94 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-cli-creds" "key" "login") | indent 10 }} |
| 95 | - name: POLICY_CLI_PASS_PLAIN |
| 96 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "policy-cli-creds" "key" "password") | indent 10 }} |
| 97 | |
| 98 | - name: OSDF_PLACEMENT_USER |
| 99 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-creds" "key" "login") | indent 10 }} |
| 100 | - name: OSDF_PLACEMENT_PASS_PLAIN |
| 101 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-creds" "key" "password") | indent 10 }} |
| 102 | |
| 103 | - name: OSDF_PLACEMENT_SO_USER |
| 104 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-so-creds" "key" "login") | indent 10 }} |
| 105 | - name: OSDF_PLACEMENT_SO_PASS_PLAIN |
| 106 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-so-creds" "key" "password") | indent 10 }} |
| 107 | |
| 108 | - name: OSDF_PLACEMENT_VFC_USER |
| 109 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-vfc-creds" "key" "login") | indent 10 }} |
| 110 | - name: OSDF_PLACEMENT_VFC_PASS_PLAIN |
| 111 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-placement-vfc-creds" "key" "password") | indent 10 }} |
| 112 | |
| 113 | - name: OSDF_CM_SCHEDULER_USER |
| 114 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-cm-scheduler-creds" "key" "login") | indent 10 }} |
| 115 | - name: OSDF_CM_SCHEDULER_PASS_PLAIN |
| 116 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-cm-scheduler-creds" "key" "password") | indent 10 }} |
| 117 | |
| 118 | - name: CONFIG_DB_USER |
| 119 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "config-db-creds" "key" "login") | indent 10 }} |
| 120 | - name: CONFIG_DB_PASS_PLAIN |
| 121 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "config-db-creds" "key" "password") | indent 10 }} |
| 122 | |
| 123 | - name: OSDF_PCI_OPT_USER |
| 124 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-pci-opt-creds" "key" "login") | indent 10 }} |
| 125 | - name: OSDF_PCI_OPT_PASS_PLAIN |
| 126 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-pci-opt-creds" "key" "password") | indent 10 }} |
| 127 | |
| 128 | - name: OSDF_OPT_ENGINE_USER |
| 129 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-opt-engine-creds" "key" "login") | indent 10 }} |
| 130 | - name: OSDF_OPT_ENGINE_PASS_PLAIN |
| 131 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "osdf-opt-engine-creds" "key" "password") | indent 10 }} |
vrvarma | 26dbd2b | 2020-05-18 19:37:19 -0400 | [diff] [blame] | 132 | |
| 133 | - name: SO_USER |
| 134 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-creds" "key" "login") | indent 10 }} |
| 135 | - name: SO_PASS_PLAIN |
| 136 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "so-creds" "key" "password") | indent 10 }} |
| 137 | |
krishnaa96 | 2652e51 | 2021-03-10 12:02:52 +0530 | [diff] [blame] | 138 | - name: SDC_USER |
| 139 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdc-creds" "key" "login") | indent 10 }} |
| 140 | - name: SDC_PASS_PLAIN |
| 141 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "sdc-creds" "key" "password") | indent 10 }} |
Sylvain Desbureaux | ab9ae72 | 2022-02-04 08:57:06 +0100 | [diff] [blame] | 142 | {{- if .Values.cps.enabled }} |
krishnaa96 | 07fc3ea | 2021-08-02 11:19:16 +0530 | [diff] [blame] | 143 | - name: CPS_USER |
| 144 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-creds" "key" "login") | indent 10 }} |
| 145 | - name: CPS_PASS_PLAIN |
| 146 | {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "cps-creds" "key" "password") | indent 10 }} |
Sylvain Desbureaux | ab9ae72 | 2022-02-04 08:57:06 +0100 | [diff] [blame] | 147 | {{- end }} |
krishnaa96 | 07fc3ea | 2021-08-02 11:19:16 +0530 | [diff] [blame] | 148 | |
Krzysztof Opasiak | 59d47c3 | 2020-04-16 20:01:05 +0200 | [diff] [blame] | 149 | volumeMounts: |
| 150 | - mountPath: /config-input |
| 151 | name: {{ include "common.name" . }}-preload-input |
| 152 | - mountPath: /config/ |
| 153 | name: {{ include "common.name" . }}-preload |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 154 | image: {{ include "repositoryGenerator.image.envsubst" . }} |
Krzysztof Opasiak | 59d47c3 | 2020-04-16 20:01:05 +0200 | [diff] [blame] | 155 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 156 | name: {{ include "common.name" . }}-update-config |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 157 | - image: {{ include "repositoryGenerator.image.readiness" . }} |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 158 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 159 | name: {{ include "common.name" . }}-readiness |
| 160 | command: |
Sylvain Desbureaux | 1694e1d | 2020-08-21 09:58:25 +0200 | [diff] [blame] | 161 | - /app/ready.py |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 162 | args: |
| 163 | - --container-name |
| 164 | - "aaf-sms" |
| 165 | - --container-name |
| 166 | - "aaf-sms-quorumclient" |
| 167 | env: |
| 168 | - name: NAMESPACE |
| 169 | valueFrom: |
| 170 | fieldRef: |
| 171 | apiVersion: v1 |
| 172 | fieldPath: metadata.namespace |
| 173 | containers: |
Sylvain Desbureaux | 0dfa387 | 2020-11-21 21:29:17 +0100 | [diff] [blame] | 174 | - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} |
dkamdocs | 6ad3a1c | 2018-12-21 09:25:53 +0000 | [diff] [blame] | 175 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 176 | name: {{ include "common.name" . }}-preload |
| 177 | command: |
| 178 | - "/sms/bin/preload" |
| 179 | - "-cacert" |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 180 | - "{{ .Values.certInitializer.mountPath }}/local/{{ .Values.certInitializer.root_ca_name }}" |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 181 | - "-jsondir" |
| 182 | - "/preload/config" |
| 183 | - "-serviceport" |
| 184 | - "{{ .Values.service.internalPort }}" |
| 185 | - "-serviceurl" |
| 186 | - "https://aaf-sms.{{ include "common.namespace" . }}" |
| 187 | workingDir: /sms |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 188 | volumeMounts: {{ include "common.certInitializer.volumeMount" . | nindent 10 }} |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 189 | - mountPath: /etc/localtime |
| 190 | name: localtime |
| 191 | readOnly: true |
| 192 | - mountPath: /preload/config |
| 193 | name: {{ include "common.name" . }}-preload |
| 194 | resources: |
| 195 | {{ include "common.resources" . | indent 10 }} |
| 196 | {{- if .Values.nodeSelector }} |
| 197 | nodeSelector: |
| 198 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 199 | {{- end -}} |
| 200 | {{- if .Values.affinity }} |
| 201 | affinity: |
| 202 | {{ toYaml .Values.affinity | indent 10 }} |
| 203 | {{- end }} |
Andreas Geissler | 6a5cefa | 2022-04-29 09:22:02 +0200 | [diff] [blame] | 204 | {{ include "common.waitForJobContainer" . | indent 6 | trim }} |
Sylvain Desbureaux | 0de302a | 2020-06-05 15:19:22 +0200 | [diff] [blame] | 205 | volumes: {{ include "common.certInitializer.volumes" . | nindent 6 }} |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 206 | - name: localtime |
| 207 | hostPath: |
| 208 | path: /etc/localtime |
Krzysztof Opasiak | 59d47c3 | 2020-04-16 20:01:05 +0200 | [diff] [blame] | 209 | - name: {{ include "common.name" . }}-preload-input |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 210 | configMap: |
| 211 | name: {{ include "common.fullname" . }}-preload |
Krzysztof Opasiak | 59d47c3 | 2020-04-16 20:01:05 +0200 | [diff] [blame] | 212 | - name: {{ include "common.name" . }}-preload |
| 213 | emptyDir: |
| 214 | medium: Memory |
Kiran Kamineni | 286d1cd | 2018-10-08 15:44:37 -0700 | [diff] [blame] | 215 | restartPolicy: OnFailure |
| 216 | imagePullSecrets: |
| 217 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |