Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / aaf / components / aaf-sshsm / components / aaf-sshsm-testca / 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: {{- include "common.resourceMetadata" . | nindent 2 }}
20 spec:
21   template:
22     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
23     spec:
24       restartPolicy: Never
25       initContainers:
26       - image: {{ include "repositoryGenerator.image.readiness" . }}
27         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
28         name: {{ include "common.name" . }}-distcenter-ready
29         command:
30         - /app/ready.py
31         args:
32         - -j
33         - "{{ include "common.release" . }}-aaf-sshsm-distcenter"
34         env:
35         - name: NAMESPACE
36           valueFrom:
37             fieldRef:
38               apiVersion: v1
39               fieldPath: metadata.namespace
40         resources:
41           limits:
42             cpu: 100m
43             memory: 100Mi
44           requests:
45             cpu: 3m
46             memory: 20Mi
47 {{- if .Values.global.tpm.enabled }}
48       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
49         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
50         name: {{ include "common.name" . }}-abrmd-ready
51         command: ["sh", "/sshsm/bin/abrmd_ready.sh", "300"]
52         workingDir: /testca/bin
53         env:
54         - name: NAMESPACE
55           valueFrom:
56             fieldRef:
57               apiVersion: v1
58               fieldPath: metadata.namespace
59         volumeMounts:
60         - name: {{ include "common.fullname" . }}-dbus
61           mountPath: /var/run/dbus
62         resources:
63           limits:
64             cpu: 100m
65             memory: 100Mi
66           requests:
67             cpu: 3m
68             memory: 20Mi
69 {{- end }}
70       containers:
71       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
72         name: {{ include "common.name" . }}
73         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
74         command: ["./import.sh"]
75         workingDir: /testca/bin
76         env:
77 {{- if .Values.global.tpm.enabled }}
78         - name: TPM_NODE_NAME
79           valueFrom:
80             fieldRef:
81               fieldPath: spec.nodeName
82         - name: DATA_FOLDER
83           value: /testca/data/host_$(TPM_NODE_NAME)
84 {{ else }}
85         - name: DATA_FOLDER
86           value: /testca/data
87 {{- end }}
88         - name: SECRETS_FOLDER
89           value: /testca/secrets
90         volumeMounts:
91         - mountPath: /etc/localtime
92           name: localtime
93           readOnly: true
94         - name: {{ include "common.fullname" . }}-data
95           mountPath: /testca/data
96         - name: {{ include "common.fullname" . }}-dbus
97           mountPath: /var/run/dbus
98         - name: {{ include "common.fullname" . }}-secrets
99           mountPath: /testca/secrets
100           readOnly: true
101         resources: {{ include "common.resources" . | nindent 10 }}
102       nodeSelector:
103         {{- if .Values.nodeSelector }}
104         {{ toYaml .Values.nodeSelector | indent 8 | trim }}
105         {{- end -}}
106         {{- if .Values.global.tpm.enabled }}
107         {{ (printf "%s: \"%s\"" .Values.global.tpm.nodeLabel .Values.global.tpm.nodeLabelValue) }}
108         {{- end -}}
109         {{- if .Values.affinity }}
110       affinity: {{ toYaml .Values.affinity | nindent 8 }}
111         {{- end }}
112       volumes:
113       - name: localtime
114         hostPath:
115           path: /etc/localtime
116       - name: {{ include "common.fullname" . }}-data
117         persistentVolumeClaim:
118           claimName: {{ include "common.release" . }}-aaf-sshsm
119       - name: {{ include "common.fullname" . }}-dbus
120         persistentVolumeClaim:
121           claimName: {{ include "common.release" . }}-aaf-sshsm-dbus
122       - name: {{ include "common.fullname" . }}-secrets
123         secret:
124           secretName: {{ include "common.release" . }}-aaf-sshsm
125       imagePullSecrets:
126       - name: "{{ include "common.namespace" . }}-docker-registry-key"