_dashy.tpl 2.4 KB

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