blob: 2cee8d5e90f6fde94597a8694d794bda14a99588 [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 "+" "_" }}
25 release: {{ .Release.Name }}
26 heritage: {{ .Release.Service }}
27spec:
28 replicas: {{ .Values.replicaCount }}
29 template:
30 metadata:
31 labels:
32 app: {{ include "common.name" . }}
33 release: {{ .Release.Name }}
34 spec:
35 initContainers:
36 - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
37 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38 name: {{ include "common.name" . }}-readiness
39 command:
40 - /root/ready.py
41 args:
42 - --container-name
43 - "aaf-sms"
44 - --container-name
45 - "aaf-sms-quorumclient"
46 env:
47 - name: NAMESPACE
48 valueFrom:
49 fieldRef:
50 apiVersion: v1
51 fieldPath: metadata.namespace
52 containers:
53 - image: "{{ include "common.repository" . }}/{{ .Values.image }}"
54 imagePullPolicy: {{ .Values.pullPolicy }}
55 name: {{ include "common.name" . }}-preload
56 command:
57 - "/sms/bin/preload"
58 - "-cacert"
59 - "/sms/certs/aaf_root_ca.cer"
60 - "-jsondir"
61 - "/preload/config"
62 - "-serviceport"
63 - "{{ .Values.service.internalPort }}"
64 - "-serviceurl"
65 - "https://aaf-sms.{{ include "common.namespace" . }}"
66 workingDir: /sms
67 volumeMounts:
68 - mountPath: /etc/localtime
69 name: localtime
70 readOnly: true
71 - mountPath: /preload/config
72 name: {{ include "common.name" . }}-preload
73 resources:
74{{ include "common.resources" . | indent 10 }}
75 {{- if .Values.nodeSelector }}
76 nodeSelector:
77{{ toYaml .Values.nodeSelector | indent 10 }}
78 {{- end -}}
79 {{- if .Values.affinity }}
80 affinity:
81{{ toYaml .Values.affinity | indent 10 }}
82 {{- end }}
83 volumes:
84 - name: localtime
85 hostPath:
86 path: /etc/localtime
87 - name : {{ include "common.name" . }}-preload
88 configMap:
89 name: {{ include "common.fullname" . }}-preload
90 restartPolicy: OnFailure
91 imagePullSecrets:
92 - name: "{{ include "common.namespace" . }}-docker-registry-key"