Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / common / certInitializer / templates / job.yaml
1 {{/*
2 # Copyright © 2021 Orange
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 {{- if hasKey .Values "ingressTlsSecret" }}
18 apiVersion: batch/v1
19 kind: Job
20 {{- $suffix := "set-tls-secret" }}
21 metadata: {{- include "common.resourceMetadata" (dict "suffix" $suffix "dot" . )| nindent 2 }}
22 spec:
23   backoffLimit: 20
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       initContainers: {{ include "common.certInitializer.initContainer" (dict "dot" . "initRoot" .Values) | nindent 6 }}
28       imagePullSecrets:
29       - name: "{{ include "common.namespace" . }}-docker-registry-key"
30       containers:
31       - name: create-tls-secret
32         command:
33           - /ingress/onboard.sh
34         image: {{ include "repositoryGenerator.image.kubectl" . }}
35         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
36         volumeMounts: {{ include "common.certInitializer.volumeMount" (dict "dot" . "initRoot" .Values) | nindent 8 }}
37         - name: ingress-scripts
38           mountPath: /ingress
39       volumes: {{ include "common.certInitializer.volumes" (dict "dot" . "initRoot" .Values) | nindent 6 }}
40       - name: localtime
41         hostPath:
42           path: /etc/localtime
43       - name: ingress-scripts
44         configMap:
45           name: {{ include "common.fullname" . }}-ingress
46           defaultMode: 0777
47       restartPolicy: Never
48 {{- end}}