pre-install-job.yaml 1.4 KB

12345678910111213141516171819202122232425262728293031
  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 | quote }}
  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: ["/bin/sh", "-c"]
  27. args:
  28. - {{ include "add.user" . }}
  29. {{ include "change.user.permissions" . }}
  30. volumeMounts: {{ include "common.storage.configureAppVolumeMountsInContainer" (dict "appVolumeMounts" .Values.elasticSearchAppVolumeMounts ) | nindent 12 }}
  31. volumes: {{ include "common.storage.configureAppVolumes" (dict "appVolumeMounts" .Values.elasticSearchAppVolumeMounts "emptyDirVolumes" .Values.emptyDirVolumes "ixVolumes" .Values.ixVolumes) | nindent 8 }}