| {{- $jobs := .Values.jobs }} |
| apiVersion: batch/v1 |
| kind: Job |
| metadata: |
| name: {{ template "job.name" . }}-crds |
| namespace: {{ template "job.namespace" . }} |
| labels: |
| {{- include "job.labels" . | nindent 4 }} |
| {{- with $jobs.labels }} |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| annotations: |
| "helm.sh/hook": "pre-upgrade,pre-install" |
| "helm.sh/hook-delete-policy": "before-hook-creation,hook-succeeded" |
| {{- with $jobs.annotations }} |
| {{- toYaml . | nindent 4 }} |
| {{- end }} |
| spec: |
| template: |
| metadata: |
| name: {{ template "job.name" . }}-crds |
| namespace: {{ template "job.namespace" . }} |
| spec: |
| restartPolicy: {{ $jobs.restartPolicy }} |
| containers: |
| - name: kubectl |
| image: {{ $jobs.image.registry }}:{{ $jobs.image.tag }} |
| imagePullPolicy: {{ $jobs.image.pullPolicy }} |
| volumeMounts: |
| - name: scripts |
| mountPath: /scripts/install_crds.sh |
| subPath: install_crds.sh |
| volumes: |
| - name: scripts |
| configMap: |
| name: {{ template "job.name" . }}-crds-scripts |
| defaultMode: 0755 |