_persistence.tpl 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {{- define "whoogle.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. # Upstream also has this dir
  6. # in an tmpfs directory
  7. type: emptyDir
  8. targetSelector:
  9. whoogle:
  10. whoogle:
  11. mountPath: /config
  12. tmp:
  13. enabled: true
  14. type: emptyDir
  15. targetSelector:
  16. whoogle:
  17. whoogle:
  18. mountPath: /tmp
  19. runtor:
  20. enabled: true
  21. type: emptyDir
  22. targetSelector:
  23. whoogle:
  24. whoogle:
  25. mountPath: /run/tor
  26. varlibtor:
  27. enabled: true
  28. type: emptyDir
  29. targetSelector:
  30. whoogle:
  31. whoogle:
  32. mountPath: /var/lib/tor
  33. # emptyDir is by default 0:fsGroup
  34. # But for this directory we need to set it to 927:927
  35. 01-permissions:
  36. mountPath: /mnt/directories/varlibtor
  37. {{- range $idx, $storage := .Values.whoogleStorage.additionalStorages }}
  38. {{ printf "whoogle-%v" (int $idx) }}:
  39. {{- $size := "" -}}
  40. {{- if $storage.size -}}
  41. {{- $size = (printf "%vGi" $storage.size) -}}
  42. {{- end }}
  43. enabled: true
  44. type: {{ $storage.type }}
  45. datasetName: {{ $storage.datasetName | default "" }}
  46. hostPath: {{ $storage.hostPath | default "" }}
  47. server: {{ $storage.server | default "" }}
  48. share: {{ $storage.share | default "" }}
  49. domain: {{ $storage.domain | default "" }}
  50. username: {{ $storage.username | default "" }}
  51. password: {{ $storage.password | default "" }}
  52. size: {{ $size }}
  53. {{- if eq $storage.type "smb-pv-pvc" }}
  54. mountOptions:
  55. - key: noperm
  56. {{- end }}
  57. targetSelector:
  58. whoogle:
  59. whoogle:
  60. mountPath: {{ $storage.mountPath }}
  61. 01-permissions:
  62. mountPath: /mnt/directories{{ $storage.mountPath }}
  63. {{- end }}
  64. {{- end -}}