_persistence.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. {{- define "frigate.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. {{- include "frigate.storage.ci.migration" (dict "storage" .Values.frigateStorage.config) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.frigateStorage.config) | nindent 4 }}
  7. targetSelector:
  8. frigate:
  9. frigate:
  10. mountPath: /config
  11. 01-init:
  12. mountPath: /config
  13. media:
  14. enabled: true
  15. {{- include "frigate.storage.ci.migration" (dict "storage" .Values.frigateStorage.media) }}
  16. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.frigateStorage.media) | nindent 4 }}
  17. targetSelector:
  18. frigate:
  19. frigate:
  20. mountPath: /media
  21. tmp:
  22. enabled: true
  23. type: emptyDir
  24. targetSelector:
  25. frigate:
  26. frigate:
  27. mountPath: /tmp
  28. cache:
  29. enabled: true
  30. type: emptyDir
  31. medium: Memory
  32. size: {{ printf "%vGi" .Values.frigateStorage.cache.sizeGiB }}
  33. targetSelector:
  34. frigate:
  35. frigate:
  36. mountPath: /tmp/cache
  37. shm:
  38. enabled: true
  39. type: emptyDir
  40. medium: Memory
  41. size: {{ printf "%vMi" .Values.frigateStorage.shm.sizeMiB }}
  42. targetSelector:
  43. frigate:
  44. frigate:
  45. mountPath: /dev/shm
  46. {{- if .Values.frigateConfig.mountUSBBus }}
  47. usb-bus:
  48. enabled: true
  49. type: hostPath
  50. hostPath: /dev/bus/usb
  51. targetSelector:
  52. frigate:
  53. frigate:
  54. mountPath: /dev/bus/usb
  55. {{- end -}}
  56. {{- range $idx, $storage := .Values.frigateStorage.additionalStorages }}
  57. {{ printf "frigate-%v:" (int $idx) }}
  58. enabled: true
  59. {{- include "frigate.storage.ci.migration" (dict "storage" $storage) }}
  60. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  61. targetSelector:
  62. frigate:
  63. frigate:
  64. mountPath: {{ $storage.mountPath }}
  65. {{- end }}
  66. {{- end -}}
  67. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  68. {{- define "frigate.storage.ci.migration" -}}
  69. {{- $storage := .storage -}}
  70. {{- if $storage.hostPath -}}
  71. {{- $_ := set $storage "hostPathConfig" dict -}}
  72. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  73. {{- end -}}
  74. {{- end -}}