Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 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: |
Sylvain Desbureaux | c9f4713 | 2021-04-07 17:26:25 +0200 | [diff] [blame^] | 23 | backoffLimit: 20 |
Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 24 | template: |
| 25 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 26 | spec: |
| 27 | initContainers: {{ include "common.certInitializer.initContainer" (dict "dot" . "initRoot" .Values) | nindent 6 }} |
| 28 | containers: |
Sylvain Desbureaux | c9f4713 | 2021-04-07 17:26:25 +0200 | [diff] [blame^] | 29 | - name: create-tls-secret |
Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 30 | command: |
| 31 | - /ingress/onboard.sh |
| 32 | image: {{ include "repositoryGenerator.image.kubectl" . }} |
| 33 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 34 | volumeMounts: {{ include "common.certInitializer.volumeMount" (dict "dot" . "initRoot" .Values) | nindent 8 }} |
| 35 | - name: ingress-scripts |
| 36 | mountPath: /ingress |
| 37 | volumes: {{ include "common.certInitializer.volumes" (dict "dot" . "initRoot" .Values) | nindent 6 }} |
| 38 | - name: localtime |
| 39 | hostPath: |
| 40 | path: /etc/localtime |
| 41 | - name: ingress-scripts |
| 42 | configMap: |
| 43 | name: {{ include "common.fullname" . }}-ingress |
| 44 | defaultMode: 0777 |
Sylvain Desbureaux | c9f4713 | 2021-04-07 17:26:25 +0200 | [diff] [blame^] | 45 | restartPolicy: Never |
Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 46 | {{- end}} |