_dashy.tpl 2.2 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. containers:
  10. dashy:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: 0
  16. runAsGroup: 0
  17. runAsNonRoot: false
  18. readOnlyRootFilesystem: false
  19. env:
  20. {{- $protocol := "http" -}}
  21. {{- if .Values.dashyNetwork.certificateID }}
  22. {{- $protocol = "https" }}
  23. SSL_PRIV_KEY_PATH: /cert/tls.key
  24. SSL_PUB_KEY_PATH: /cert/tls.crt
  25. SSL_PORT: {{ .Values.dashyNetwork.webPort }}
  26. {{- else }}
  27. PORT: {{ .Values.dashyNetwork.webPort }}
  28. {{- end }}
  29. NODE_ENV: production
  30. IS_DOCKER: "true"
  31. {{ with .Values.dashyConfig.additionalEnvs }}
  32. envList:
  33. {{ range $env := . }}
  34. - name: {{ $env.name }}
  35. value: {{ $env.value }}
  36. {{ end }}
  37. {{ end }}
  38. probes:
  39. liveness:
  40. enabled: true
  41. type: {{ $protocol }}
  42. port: {{ .Values.dashyNetwork.webPort }}
  43. path: /
  44. readiness:
  45. enabled: true
  46. type: {{ $protocol }}
  47. port: {{ .Values.dashyNetwork.webPort }}
  48. path: /
  49. startup:
  50. enabled: true
  51. type: {{ $protocol }}
  52. port: {{ .Values.dashyNetwork.webPort }}
  53. path: /
  54. initContainers:
  55. init-config:
  56. enabled: true
  57. type: init
  58. imageSelector: image
  59. securityContext:
  60. runAsUser: 0
  61. runAsGroup: 0
  62. runAsNonRoot: false
  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/user-data/* /data/
  71. exit 0
  72. fi
  73. echo "App directory is not empty, skipping copy"
  74. exit 0
  75. {{- end -}}