_volumes.tpl 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. {{/*
  2. Volumes Configuration
  3. */}}
  4. {{- define "volumeConfiguration" }}
  5. {{- if or .Values.ixVolumes .Values.hostPathVolumes }}
  6. volumes:
  7. {{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
  8. - name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
  9. hostPath:
  10. path: {{ $hostPathConfiguration.hostPath }}
  11. {{- end }}
  12. {{- range $index, $hostPathConfiguration := .Values.ixVolumes }}
  13. - name: ix-host-volume-{{ $.Release.Name }}-{{ $index }}
  14. hostPath:
  15. path: {{ $hostPathConfiguration.hostPath }}
  16. {{- end }}
  17. {{- end }}
  18. {{- end }}
  19. {{/*
  20. Volume Mounts Configuration
  21. */}}
  22. {{- define "volumeMountsConfiguration" }}
  23. {{- if or .Values.hostPathVolumes .Values.ixVolumes }}
  24. volumeMounts:
  25. {{- range $index, $hostPathConfiguration := .Values.hostPathVolumes }}
  26. - mountPath: {{ $hostPathConfiguration.mountPath }}
  27. name: ix-host-path-{{ $.Release.Name }}-{{ $index }}
  28. readOnly: {{ $hostPathConfiguration.readOnly }}
  29. {{- end }}
  30. {{- range $index, $hostPathConfiguration := .Values.ixVolumes }}
  31. - mountPath: {{ $hostPathConfiguration.mountPath }}
  32. name: ix-host-volume-{{ $.Release.Name }}-{{ $index }}
  33. {{- end }}
  34. {{- end }}
  35. {{- end }}