_wordpress.tpl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. {{- define "wordpress.workload" -}}
  2. workload:
  3. wordpress:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: false
  9. containers:
  10. wordpress:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: 33
  16. runAsGroup: 33
  17. capabilities:
  18. add:
  19. - NET_BIND_SERVICE
  20. envFrom:
  21. - secretRef:
  22. name: wordpress-creds
  23. {{ with .Values.wpConfig.additionalEnvs }}
  24. envList:
  25. {{ range $env := . }}
  26. - name: {{ $env.name }}
  27. value: {{ $env.value }}
  28. {{ end }}
  29. {{ end }}
  30. probes:
  31. liveness:
  32. enabled: true
  33. type: tcp
  34. port: 80
  35. readiness:
  36. enabled: true
  37. type: tcp
  38. port: 80
  39. startup:
  40. enabled: true
  41. type: tcp
  42. port: 80
  43. initContainers:
  44. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  45. "UID" 33
  46. "GID" 33
  47. "type" "install") | nindent 8 }}
  48. {{- include "ix.v1.common.app.mariadbWait" (dict "name" "mariadb-wait"
  49. "secretName" "mariadb-creds") | nindent 8 }}
  50. {{/* Service */}}
  51. service:
  52. wordpress:
  53. enabled: true
  54. primary: true
  55. type: NodePort
  56. targetSelector: wordpress
  57. ports:
  58. webui:
  59. enabled: true
  60. primary: true
  61. port: {{ .Values.wpNetwork.webPort }}
  62. nodePort: {{ .Values.wpNetwork.webPort }}
  63. targetPort: 80
  64. targetSelector: wordpress
  65. {{/* Persistence */}}
  66. persistence:
  67. data:
  68. enabled: true
  69. type: {{ .Values.wpStorage.data.type }}
  70. datasetName: {{ .Values.wpStorage.data.datasetName | default "" }}
  71. hostPath: {{ .Values.wpStorage.data.hostPath | default "" }}
  72. targetSelector:
  73. wordpress:
  74. wordpress:
  75. mountPath: /var/www/html
  76. 01-permissions:
  77. mountPath: /mnt/directories/data
  78. {{- range $idx, $storage := .Values.wpStorage.additionalStorages }}
  79. {{ printf "wp-%v" (int $idx) }}:
  80. enabled: true
  81. type: {{ $storage.type }}
  82. datasetName: {{ $storage.datasetName | default "" }}
  83. hostPath: {{ $storage.hostPath | default "" }}
  84. targetSelector:
  85. wordpress:
  86. wordpress:
  87. mountPath: {{ $storage.mountPath }}
  88. 01-permissions:
  89. mountPath: /mnt/directories{{ $storage.mountPath }}
  90. {{- end }}
  91. tmp:
  92. enabled: true
  93. type: emptyDir
  94. targetSelector:
  95. wordpress:
  96. wordpress:
  97. mountPath: /tmp
  98. varrun:
  99. enabled: true
  100. type: emptyDir
  101. targetSelector:
  102. wordpress:
  103. wordpress:
  104. mountPath: /var/run
  105. {{- end -}}