_npm.tpl 3.2 KB

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