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 }} |
Andreas Geissler | 281cd4b | 2022-01-10 12:58:06 +0000 | [diff] [blame] | 28 | imagePullSecrets: |
| 29 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |
Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 30 | containers: |
Sylvain Desbureaux | c9f4713 | 2021-04-07 17:26:25 +0200 | [diff] [blame] | 31 | - name: create-tls-secret |
Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 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 |
Sylvain Desbureaux | c9f4713 | 2021-04-07 17:26:25 +0200 | [diff] [blame] | 47 | restartPolicy: Never |
Sylvain Desbureaux | da711dd | 2021-04-07 17:22:42 +0200 | [diff] [blame] | 48 | {{- end}} |