dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 1 | apiVersion: batch/v1 |
| 2 | kind: Job |
| 3 | metadata: |
| 4 | name: {{ include "common.fullname" . }}-post-install |
| 5 | labels: |
| 6 | app.kubernetes.io/managed-by: {{.Release.Service | quote }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 7 | app.kubernetes.io/instance: {{include "common.release" . | quote }} |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 8 | helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 9 | release: {{ include "common.release" . }} |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 10 | annotations: |
| 11 | # This is what defines this resource as a hook. Without this line, the |
| 12 | # job is considered part of the release. |
| 13 | "helm.sh/hook": post-install |
sunil.unnava | 02f077e | 2019-03-28 20:50:29 -0400 | [diff] [blame] | 14 | "helm.sh/hook-weight": "-4" |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 15 | "helm.sh/hook-delete-policy": hook-succeeded |
| 16 | spec: |
| 17 | template: |
| 18 | metadata: |
dglFromAtt | 655708d | 2019-03-18 16:30:47 +0000 | [diff] [blame] | 19 | name: {{ include "common.fullname" . }} |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 20 | labels: |
| 21 | app.kubernetes.io/managed-by: {{.Release.Service | quote }} |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 22 | app.kubernetes.io/instance: {{include "common.release" . | quote }} |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 23 | helm.sh/chart: "{{.Chart.Name}}-{{.Chart.Version}}" |
Krzysztof Opasiak | 137d7cc | 2020-01-24 23:49:11 +0100 | [diff] [blame] | 24 | release: {{ include "common.release" . }} |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 25 | spec: |
| 26 | restartPolicy: Never |
| 27 | containers: |
| 28 | - name: post-install-job |
| 29 | image: "{{ include "common.repository" . }}/{{ .Values.global.clientImage }}" |
sunil.unnava | 02f077e | 2019-03-28 20:50:29 -0400 | [diff] [blame] | 30 | imagePullPolicy: "Always" |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 31 | env: |
| 32 | - name: DELAY |
sunil.unnava | 02f077e | 2019-03-28 20:50:29 -0400 | [diff] [blame] | 33 | value: "30" |
efiacor | 338e966 | 2019-05-15 10:48:17 +0000 | [diff] [blame] | 34 | {{- if .Values.global.allow_http }} |
sunil.unnava | 02f077e | 2019-03-28 20:50:29 -0400 | [diff] [blame] | 35 | - name: PROTO |
| 36 | value: "http" |
| 37 | - name: PORT |
| 38 | value: "8080" |
efiacor | 338e966 | 2019-05-15 10:48:17 +0000 | [diff] [blame] | 39 | {{ end }} |
dglFromAtt | 671f59b | 2019-03-13 15:50:40 +0000 | [diff] [blame] | 40 | - name: REQUESTID |
| 41 | value: "{{.Chart.Name}}-post-install" |
| 42 | volumeMounts: |
| 43 | - mountPath: /etc/localtime |
| 44 | name: localtime |
| 45 | readOnly: true |
| 46 | |
| 47 | # NOTE: on the following several configMaps, careful to include / at end |
| 48 | # since there may be more than one file in each mountPath |
| 49 | # NOTE: the basename of the subdirectory of mountPath is important - it matches the DBCL API URI |
| 50 | - name: {{ include "common.fullname" . }}-dbc-mrclusters |
| 51 | mountPath: /opt/app/config/mr_clusters/ |
| 52 | - name: {{ include "common.fullname" . }}-dbc-topics |
| 53 | mountPath: /opt/app/config/topics/ |
| 54 | resources: |
| 55 | {{ include "common.resources" . | indent 10 }} |
| 56 | {{- if .Values.nodeSelector }} |
| 57 | nodeSelector: |
| 58 | {{ toYaml .Values.nodeSelector | indent 8 }} |
| 59 | {{- end -}} |
| 60 | {{- if .Values.affinity }} |
| 61 | affinity: |
| 62 | {{ toYaml .Values.affinity | indent 8 }} |
| 63 | {{- end }} |
| 64 | volumes: |
| 65 | - name: localtime |
| 66 | hostPath: |
| 67 | path: /etc/localtime |
| 68 | - name: {{ include "common.fullname" . }}-dbc-mrclusters |
| 69 | configMap: |
| 70 | name: {{ include "common.fullname" . }}-dbc-mrclusters |
| 71 | - name: {{ include "common.fullname" . }}-dbc-topics |
| 72 | configMap: |
| 73 | name: {{ include "common.fullname" . }}-dbc-topics |
| 74 | imagePullSecrets: |
| 75 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |