_persistence.tpl 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. {{- define "pgadmin.persistence" -}}
  2. persistence:
  3. config:
  4. enabled: true
  5. {{- include "pgadmin.storage.ci.migration" (dict "storage" .Values.pgadminStorage.config) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.pgadminStorage.config) | nindent 4 }}
  7. targetSelector:
  8. pgadmin:
  9. pgadmin:
  10. mountPath: /var/lib/pgadmin
  11. {{- if and (eq .Values.pgadminStorage.config.type "ixVolume")
  12. (not (.Values.pgadminStorage.config.ixVolumeConfig | default dict).aclEnable) }}
  13. 01-permissions:
  14. mountPath: /mnt/directories/pgadmin
  15. {{- end }}
  16. tmp:
  17. enabled: true
  18. type: emptyDir
  19. targetSelector:
  20. pgadmin:
  21. pgadmin:
  22. mountPath: /tmp
  23. {{- range $idx, $storage := .Values.pgadminStorage.additionalStorages }}
  24. {{ printf "pgadmin-%v" (int $idx) }}:
  25. enabled: true
  26. {{- include "pgadmin.storage.ci.migration" (dict "storage" $storage) }}
  27. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  28. targetSelector:
  29. pgadmin:
  30. pgadmin:
  31. mountPath: {{ $storage.mountPath }}
  32. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  33. 01-permissions:
  34. mountPath: /mnt/directories{{ $storage.mountPath }}
  35. {{- end }}
  36. {{- end }}
  37. {{- if .Values.pgadminNetwork.certificateID }}
  38. cert:
  39. enabled: true
  40. type: secret
  41. objectName: pgadmin-cert
  42. defaultMode: "0600"
  43. items:
  44. - key: tls.key
  45. path: server.key
  46. - key: tls.crt
  47. path: server.cert
  48. targetSelector:
  49. pgadmin:
  50. pgadmin:
  51. mountPath: /certs
  52. readOnly: true
  53. scaleCertificate:
  54. pgadmin-cert:
  55. enabled: true
  56. id: {{ .Values.pgadminNetwork.certificateID }}
  57. {{- end }}
  58. {{- end -}}
  59. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  60. {{- define "pgadmin.storage.ci.migration" -}}
  61. {{- $storage := .storage -}}
  62. {{- if $storage.hostPath -}}
  63. {{- $_ := set $storage "hostPathConfig" dict -}}
  64. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  65. {{- end -}}
  66. {{- end -}}