_piwigo.tpl 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. {{- define "piwigo.workload" -}}
  2. workload:
  3. piwigo:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: false
  9. securityContext:
  10. fsGroup: {{ .Values.piwiID.group }}
  11. containers:
  12. piwigo:
  13. enabled: true
  14. primary: true
  15. imageSelector: image
  16. securityContext:
  17. runAsUser: 0
  18. runAsGroup: 0
  19. runAsNonRoot: false
  20. readOnlyRootFilesystem: false
  21. capabilities:
  22. add:
  23. - CHOWN
  24. - DAC_OVERRIDE
  25. - FOWNER
  26. - NET_BIND_SERVICE
  27. - SETGID
  28. - SETUID
  29. envFrom:
  30. - secretRef:
  31. name: piwigo-creds
  32. fixedEnv:
  33. PUID: {{ .Values.piwiID.user }}
  34. {{ with .Values.piwiConfig.additionalEnvs }}
  35. envList:
  36. {{ range $env := . }}
  37. - name: {{ $env.name }}
  38. value: {{ $env.value }}
  39. {{ end }}
  40. {{ end }}
  41. probes:
  42. liveness:
  43. enabled: true
  44. type: http
  45. # https://github.com/Piwigo/Piwigo/issues/1954
  46. path: /ws.php?method=pwg.session.getStatus
  47. port: 80
  48. readiness:
  49. enabled: true
  50. type: http
  51. path: /ws.php?method=pwg.session.getStatus
  52. port: 80
  53. startup:
  54. enabled: true
  55. type: http
  56. path: /ws.php?method=pwg.session.getStatus
  57. port: 80
  58. lifecycle:
  59. postStart:
  60. type: exec
  61. command:
  62. - /bin/sh
  63. - -c
  64. - |
  65. until curl --silent --fail --output /dev/null http://localhost:80; do
  66. echo "Waiting for Piwigo to start..."
  67. sleep 1
  68. done
  69. if curl --silent --fail http://localhost:80/install.php | grep "Piwigo is already installed"; then
  70. echo "Piwigo is already installed, skipping installation"
  71. exit 0
  72. fi
  73. echo "Installing Piwigo..."
  74. curl -X POST -d "${INSTALL_STRING}" http://localhost:80/install.php
  75. if curl --silent --fail http://localhost:80/install.php | grep "Piwigo is already installed"; then
  76. echo "Piwigo is already installed, skipping installation"
  77. exit 0
  78. fi
  79. exit 1
  80. initContainers:
  81. {{- include "ix.v1.common.app.mariadbWait" (dict "name" "mariadb-wait"
  82. "secretName" "mariadb-creds") | nindent 8 }}
  83. {{- end -}}