[AAF SMS] Override outdated certificates
[oom.git] / kubernetes / aaf / charts / aaf-sms / templates / job.yaml
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 "+" "_" }}
25     release: {{ .Release.Name }}
26     heritage: {{ .Release.Service }}
27 spec:
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.global.pullPolicy | default .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           - mountPath: /sms/certs
74             name: {{ include "common.fullname" . }}-certs
75             readOnly: true
76         resources:
77 {{ include "common.resources" . | indent 10 }}
78         {{- if .Values.nodeSelector }}
79         nodeSelector:
80 {{ toYaml .Values.nodeSelector | indent 10 }}
81         {{- end -}}
82         {{- if .Values.affinity }}
83         affinity:
84 {{ toYaml .Values.affinity | indent 10 }}
85         {{- end }}
86       volumes:
87       - name: localtime
88         hostPath:
89           path: /etc/localtime
90       - name : {{ include "common.name" . }}-preload
91         configMap:
92           name: {{ include "common.fullname" . }}-preload
93       - name: {{ include "common.fullname" . }}-certs
94         secret:
95           secretName: {{ include "common.fullname" . }}-certs
96       restartPolicy: OnFailure
97       imagePullSecrets:
98       - name: "{{ include "common.namespace" . }}-docker-registry-key"