_persistence.tpl 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {{- define "wordpress.persistence" -}}
  2. persistence:
  3. data:
  4. enabled: true
  5. {{- include "wp.storage.ci.migration" (dict "storage" .Values.wpStorage.data) }}
  6. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.wpStorage.data) | nindent 4 }}
  7. targetSelector:
  8. wordpress:
  9. wordpress:
  10. mountPath: /var/www/html
  11. {{- if and (eq .Values.wpStorage.data.type "ixVolume")
  12. (not (.Values.wpStorage.data.ixVolumeConfig | default dict).aclEnable) }}
  13. 01-permissions:
  14. mountPath: /mnt/directories/data
  15. {{- end }}
  16. wordpress-cron:
  17. wordpress-cron:
  18. mountPath: /var/www/html
  19. {{- range $idx, $storage := .Values.wpStorage.additionalStorages }}
  20. {{ printf "wp-%v" (int $idx) }}:
  21. enabled: true
  22. {{- include "wp.storage.ci.migration" (dict "storage" $storage) }}
  23. {{- include "ix.v1.common.app.storageOptions" (dict "storage" $storage) | nindent 4 }}
  24. targetSelector:
  25. wordpress:
  26. wordpress:
  27. mountPath: {{ $storage.mountPath }}
  28. {{- if and (eq $storage.type "ixVolume") (not ($storage.ixVolumeConfig | default dict).aclEnable) }}
  29. 01-permissions:
  30. mountPath: /mnt/directories{{ $storage.mountPath }}
  31. {{- end }}
  32. {{- end }}
  33. tmp:
  34. enabled: true
  35. type: emptyDir
  36. targetSelector:
  37. wordpress:
  38. wordpress:
  39. mountPath: /tmp
  40. varrun:
  41. enabled: true
  42. type: emptyDir
  43. targetSelector:
  44. wordpress:
  45. wordpress:
  46. mountPath: /var/run
  47. mariadbdata:
  48. enabled: true
  49. {{- include "wp.storage.ci.migration" (dict "storage" .Values.wpStorage.mariadbData) }}
  50. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.wpStorage.mariadbData) | nindent 4 }}
  51. targetSelector:
  52. # MariaDB pod
  53. mariadb:
  54. # MariaDB container
  55. mariadb:
  56. mountPath: /var/lib/mysql
  57. # MariaDB - Permissions container
  58. permissions:
  59. mountPath: /mnt/directories/mariadb_data
  60. mariadbbackup:
  61. enabled: true
  62. {{- include "wp.storage.ci.migration" (dict "storage" .Values.wpStorage.mariadbBackup) }}
  63. {{- include "ix.v1.common.app.storageOptions" (dict "storage" .Values.wpStorage.mariadbBackup) | nindent 4 }}
  64. targetSelector:
  65. # MariaDB backup pod
  66. mariadbbackup:
  67. # MariaDB backup container
  68. mariadbbackup:
  69. mountPath: /mariadb_backup
  70. # MariaDB - Permissions container
  71. permissions:
  72. mountPath: /mnt/directories/mariadb_backup
  73. {{- end -}}
  74. {{/* TODO: Remove on the next version bump, eg 1.2.0+ */}}
  75. {{- define "wp.storage.ci.migration" -}}
  76. {{- $storage := .storage -}}
  77. {{- if $storage.hostPath -}}
  78. {{- $_ := set $storage "hostPathConfig" dict -}}
  79. {{- $_ := set $storage.hostPathConfig "hostPath" $storage.hostPath -}}
  80. {{- end -}}
  81. {{- end -}}