_persistence.tpl 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. {{- define "linkding.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. type: {{ .Values.linkdingStorage.data.type }}
  6. datasetName: {{ .Values.linkdingStorage.data.datasetName | default "" }}
  7. hostPath: {{ .Values.linkdingStorage.data.hostPath | default "" }}
  8. targetSelector:
  9. linkding:
  10. linkding:
  11. mountPath: /etc/linkding/data
  12. 01-permissions:
  13. mountPath: /mnt/directories/data
  14. secret:
  15. enabled: true
  16. type: secret
  17. objectName: linkding-secret
  18. defaultMode: "0600"
  19. targetSelector:
  20. linkding:
  21. linkding:
  22. mountPath: /etc/linkding/secretkey.txt
  23. subPath: secretkey.txt
  24. tmp:
  25. enabled: true
  26. type: emptyDir
  27. targetSelector:
  28. linkding:
  29. linkding:
  30. mountPath: /tmp
  31. {{- range $idx, $storage := .Values.linkdingStorage.additionalStorages }}
  32. {{ printf "linkding-%v" (int $idx) }}:
  33. {{- $size := "" -}}
  34. {{- if $storage.size -}}
  35. {{- $size = (printf "%vGi" $storage.size) -}}
  36. {{- end }}
  37. enabled: true
  38. type: {{ $storage.type }}
  39. datasetName: {{ $storage.datasetName | default "" }}
  40. hostPath: {{ $storage.hostPath | default "" }}
  41. server: {{ $storage.server | default "" }}
  42. share: {{ $storage.share | default "" }}
  43. domain: {{ $storage.domain | default "" }}
  44. username: {{ $storage.username | default "" }}
  45. password: {{ $storage.password | default "" }}
  46. size: {{ $size }}
  47. {{- if eq $storage.type "smb-pv-pvc" }}
  48. mountOptions:
  49. - key: noperm
  50. {{- end }}
  51. targetSelector:
  52. linkding:
  53. linkding:
  54. mountPath: {{ $storage.mountPath }}
  55. 01-permissions:
  56. mountPath: /mnt/directories{{ $storage.mountPath }}
  57. {{- end }}
  58. {{/* Database */}}
  59. postgresdata:
  60. enabled: true
  61. type: {{ .Values.linkdingStorage.pgData.type }}
  62. datasetName: {{ .Values.linkdingStorage.pgData.datasetName | default "" }}
  63. hostPath: {{ .Values.linkdingStorage.pgData.hostPath | default "" }}
  64. targetSelector:
  65. # Postgres pod
  66. postgres:
  67. # Postgres container
  68. postgres:
  69. mountPath: /var/lib/postgresql/data
  70. # Postgres - Permissions container
  71. # Different than the 01-permissions
  72. permissions:
  73. mountPath: /mnt/directories/postgres_data
  74. postgresbackup:
  75. enabled: true
  76. type: {{ .Values.linkdingStorage.pgBackup.type }}
  77. datasetName: {{ .Values.linkdingStorage.pgBackup.datasetName | default "" }}
  78. hostPath: {{ .Values.linkdingStorage.pgBackup.hostPath | default "" }}
  79. targetSelector:
  80. # Postgres backup pod
  81. postgresbackup:
  82. # Postgres backup container
  83. postgresbackup:
  84. mountPath: /postgres_backup
  85. # Postgres - Permissions container
  86. # Different than the 01-permissions
  87. permissions:
  88. mountPath: /mnt/directories/postgres_backup
  89. {{- end -}}