_dashy.tpl 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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: 0
  16. runAsGroup: 0
  17. runAsNonRoot: false
  18. env:
  19. {{- $protocol := "http" -}}
  20. {{- if .Values.dashyNetwork.certificateID }}
  21. {{- $protocol = "https" }}
  22. SSL_PRIV_KEY_PATH: /cert/tls.key
  23. SSL_PUB_KEY_PATH: /cert/tls.crt
  24. SSL_PORT: {{ .Values.dashyNetwork.webPort }}
  25. {{- else }}
  26. PORT: {{ .Values.dashyNetwork.webPort }}
  27. {{- end }}
  28. NODE_ENV: production
  29. IS_DOCKER: "true"
  30. {{ with .Values.dashyConfig.additionalEnvs }}
  31. envList:
  32. {{ range $env := . }}
  33. - name: {{ $env.name }}
  34. value: {{ $env.value }}
  35. {{ end }}
  36. {{ end }}
  37. probes:
  38. liveness:
  39. enabled: true
  40. type: {{ $protocol }}
  41. port: {{ .Values.dashyNetwork.webPort }}
  42. path: /
  43. readiness:
  44. enabled: true
  45. type: {{ $protocol }}
  46. port: {{ .Values.dashyNetwork.webPort }}
  47. path: /
  48. startup:
  49. enabled: true
  50. type: {{ $protocol }}
  51. port: {{ .Values.dashyNetwork.webPort }}
  52. path: /
  53. initContainers:
  54. init-config:
  55. enabled: true
  56. type: init
  57. imageSelector: image
  58. securityContext:
  59. runAsUser: 0
  60. runAsGroup: 0
  61. runAsNonRoot: false
  62. command:
  63. - /bin/sh
  64. args:
  65. - -c
  66. - |
  67. if [ -z "$(ls -A /data)" ]; then
  68. echo "App directory is empty, copying default files"
  69. cp -r /app/public/* /data/
  70. exit 0
  71. fi
  72. echo "App directory is not empty, skipping copy"
  73. exit 0
  74. {{- end -}}