_dashy.tpl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. {{- define "dashy.workload" -}}
  2. workload:
  3. dashy:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.dashyNetwork.hostNetwork }}
  9. securityContext:
  10. fsGroup: {{ .Values.dashyID.group }}
  11. containers:
  12. dashy:
  13. enabled: true
  14. primary: true
  15. imageSelector: image
  16. securityContext:
  17. runAsUser: 0
  18. runAsGroup: 0
  19. runAsNonRoot: false
  20. fixedEnv:
  21. PUID: {{ .Values.dashyID.user }}
  22. env:
  23. NODE_ENV: production
  24. IS_DOCKER: "true"
  25. PORT: {{ .Values.dashyNetwork.webPort }}
  26. {{ with .Values.dashyConfig.additionalEnvs }}
  27. envList:
  28. {{ range $env := . }}
  29. - name: {{ $env.name }}
  30. value: {{ $env.value }}
  31. {{ end }}
  32. {{ end }}
  33. probes:
  34. liveness:
  35. enabled: true
  36. type: http
  37. port: {{ .Values.dashyNetwork.webPort }}
  38. path: /
  39. readiness:
  40. enabled: true
  41. type: http
  42. port: {{ .Values.dashyNetwork.webPort }}
  43. path: /
  44. startup:
  45. enabled: true
  46. type: http
  47. port: {{ .Values.dashyNetwork.webPort }}
  48. path: /
  49. initContainers:
  50. init-config:
  51. enabled: true
  52. type: init
  53. imageSelector: image
  54. securityContext:
  55. runAsUser: 0
  56. runAsGroup: 0
  57. runAsNonRoot: false
  58. fixedEnv:
  59. PUID: {{ .Values.dashyID.user }}
  60. command:
  61. - /bin/sh
  62. args:
  63. - -c
  64. - |
  65. if [ -z "$(ls -A /data)" ]; then
  66. echo "App directory is empty, copying default files"
  67. cp -r /app/public/* /data/
  68. exit 0
  69. fi
  70. echo "App directory is not empty, skipping copy"
  71. exit 0
  72. {{- end -}}