pre-install-job.yaml 1.2 KB

1234567891011121314151617181920212223242526272829303132
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: "{{ template "common.names.fullname" . }}-preinstall-job"
  5. labels:
  6. app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
  7. app.kubernetes.io/instance: {{ .Release.Name | quote }}
  8. app.kubernetes.io/version: {{ .Chart.AppVersion }}
  9. helm.sh/chart: {{ template "common.names.chart" . }}
  10. annotations:
  11. "helm.sh/hook": pre-install
  12. "helm.sh/hook-delete-policy": hook-succeeded
  13. spec:
  14. template:
  15. metadata:
  16. name: "{{ template "common.names.fullname" . }}-preinstall-hook"
  17. labels:
  18. app.kubernetes.io/managed-by: {{ .Release.Service | quote }}
  19. app.kubernetes.io/instance: {{ .Release.Name | quote }}
  20. helm.sh/chart: {{ template "common.names.chart" . }}
  21. spec:
  22. restartPolicy: Never
  23. containers:
  24. - name: pre-install-job
  25. image: "alpine:latest"
  26. command:
  27. - "chown"
  28. - "-R"
  29. - "{{ .Values.ownerUID }}:{{ .Values.ownerGID }}"
  30. - "{{ .Values.appVolumeMounts.config.mountPath }}"
  31. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" .Values | nindent 12 }}
  32. volumes: {{ include "common.storage.configureAppVolumes" .Values | nindent 8 }}