_dashy.tpl 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. containers:
  10. dashy:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.dashyRunAs.user }}
  16. runAsGroup: {{ .Values.dashyRunAs.group }}
  17. env:
  18. NODE_ENV: production
  19. IS_DOCKER: "true"
  20. PORT: {{ .Values.dashyNetwork.webPort }}
  21. {{ with .Values.dashyConfig.additionalEnvs }}
  22. envList:
  23. {{ range $env := . }}
  24. - name: {{ $env.name }}
  25. value: {{ $env.value }}
  26. {{ end }}
  27. {{ end }}
  28. probes:
  29. liveness:
  30. enabled: true
  31. type: exec
  32. command:
  33. - node
  34. - /app/services/healthcheck
  35. readiness:
  36. enabled: true
  37. type: exec
  38. command:
  39. - node
  40. - /app/services/healthcheck
  41. startup:
  42. enabled: true
  43. type: exec
  44. command:
  45. - node
  46. - /app/services/healthcheck
  47. initContainers:
  48. init-config:
  49. enabled: true
  50. type: init
  51. imageSelector: image
  52. securityContext:
  53. runAsUser: {{ .Values.dashyRunAs.user }}
  54. runAsGroup: {{ .Values.dashyRunAs.group }}
  55. command:
  56. - /bin/sh
  57. args:
  58. - -c
  59. - |
  60. if [ -z "$(ls -A /data)" ]; then
  61. echo "App directory is empty, copying default files"
  62. cp -r /app/public/* /data/
  63. exit 0
  64. fi
  65. echo "App directory is not empty, skipping copy"
  66. exit 0
  67. {{- end -}}