_npm.tpl 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. {{- define "npm.workload" -}}
  2. workload:
  3. npm:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: false
  9. securityContext:
  10. fsGroup: 1000
  11. containers:
  12. npm:
  13. enabled: true
  14. primary: true
  15. imageSelector: image
  16. securityContext:
  17. runAsUser: 0
  18. runAsGroup: 0
  19. readOnlyRootFilesystem: false
  20. runAsNonRoot: false
  21. capabilities:
  22. add:
  23. # Needed for: s6-applyuidgid: fatal: unable to setuid: Operation not permitted
  24. - SETUID
  25. # Needed for: s6-applyuidgid: fatal: unable to set supplementary group list: Operation not permitted
  26. - SETGID
  27. # Needed for: Used in some s6-overlay startup scripts
  28. - CHOWN
  29. - DAC_OVERRIDE
  30. # Needed for: Nginx Service
  31. - FOWNER
  32. fixedEnv:
  33. # FIXME: Revisit once upstream irons out some issues in regarids with PUID.
  34. # Make sure 568 PUID works before exposing
  35. PUID: 1000
  36. env:
  37. DISABLE_IPV6: true
  38. DB_SQLITE_FILE: /data/database.sqlite
  39. {{ with .Values.npmConfig.additionalEnvs }}
  40. {{ range $env := . }}
  41. {{ $env.name }}: {{ $env.value }}
  42. {{ end }}
  43. {{ end }}
  44. probes:
  45. liveness:
  46. enabled: true
  47. type: exec
  48. command: /bin/check-health
  49. readiness:
  50. enabled: true
  51. type: exec
  52. command: /bin/check-health
  53. startup:
  54. enabled: true
  55. type: exec
  56. command: /bin/check-health
  57. {{/* Service */}}
  58. service:
  59. npm:
  60. enabled: true
  61. primary: true
  62. type: NodePort
  63. targetSelector: npm
  64. ports:
  65. webui:
  66. enabled: true
  67. primary: true
  68. port: {{ .Values.npmNetwork.webPort }}
  69. nodePort: {{ .Values.npmNetwork.webPort }}
  70. targetPort: 81
  71. targetSelector: npm
  72. http:
  73. enabled: true
  74. port: {{ .Values.npmNetwork.httpPort }}
  75. nodePort: {{ .Values.npmNetwork.httpPort }}
  76. targetPort: 80
  77. targetSelector: npm
  78. https:
  79. enabled: true
  80. port: {{ .Values.npmNetwork.httpsPort }}
  81. nodePort: {{ .Values.npmNetwork.httpsPort }}
  82. targetPort: 443
  83. targetSelector: npm
  84. {{/* Persistence */}}
  85. persistence:
  86. data:
  87. enabled: true
  88. type: {{ .Values.npmStorage.data.type }}
  89. datasetName: {{ .Values.npmStorage.data.datasetName | default "" }}
  90. hostPath: {{ .Values.npmStorage.data.hostPath | default "" }}
  91. targetSelector:
  92. npm:
  93. npm:
  94. mountPath: /data
  95. certs:
  96. enabled: true
  97. type: {{ .Values.npmStorage.certs.type }}
  98. datasetName: {{ .Values.npmStorage.certs.datasetName | default "" }}
  99. hostPath: {{ .Values.npmStorage.certs.hostPath | default "" }}
  100. targetSelector:
  101. npm:
  102. npm:
  103. mountPath: /etc/letsencrypt
  104. {{- end -}}