_dashy.tpl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  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: exec
  37. command:
  38. - node
  39. - /app/services/healthcheck
  40. readiness:
  41. enabled: true
  42. type: exec
  43. command:
  44. - node
  45. - /app/services/healthcheck
  46. startup:
  47. enabled: true
  48. type: exec
  49. command:
  50. - node
  51. - /app/services/healthcheck
  52. initContainers:
  53. init-config:
  54. enabled: true
  55. type: init
  56. imageSelector: image
  57. securityContext:
  58. runAsUser: 0
  59. runAsGroup: 0
  60. runAsNonRoot: false
  61. fixedEnv:
  62. PUID: {{ .Values.dashyID.user }}
  63. command:
  64. - /bin/sh
  65. args:
  66. - -c
  67. - |
  68. if [ -z "$(ls -A /data)" ]; then
  69. echo "App directory is empty, copying default files"
  70. cp -r /app/public/* /data/
  71. exit 0
  72. fi
  73. echo "App directory is not empty, skipping copy"
  74. exit 0
  75. {{- end -}}