_n8n.tpl 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. {{- define "n8n.workload" -}}
  2. workload:
  3. n8n:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.n8nNetwork.hostNetwork }}
  9. containers:
  10. n8n:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.n8nRunAs.user }}
  16. runAsGroup: {{ .Values.n8nRunAs.group }}
  17. runAsNonRoot: false
  18. readOnlyRootFilesystem: false
  19. envFrom:
  20. - secretRef:
  21. name: n8n-creds
  22. - configMapRef:
  23. name: n8n-config
  24. {{ with .Values.n8nConfig.additionalEnvs }}
  25. envList:
  26. {{ range $env := . }}
  27. - name: {{ $env.name }}
  28. value: {{ $env.value }}
  29. {{ end }}
  30. {{ end }}
  31. probes:
  32. {{ $prot := "http" }}
  33. {{ if .Values.n8nNetwork.certificateID }}
  34. {{ $prot = "https" }}
  35. {{ end }}
  36. liveness:
  37. enabled: true
  38. type: {{ $prot }}
  39. path: /healthz
  40. port: {{ .Values.n8nNetwork.webPort }}
  41. readiness:
  42. enabled: true
  43. type: {{ $prot }}
  44. path: /healthz
  45. port: {{ .Values.n8nNetwork.webPort }}
  46. startup:
  47. enabled: true
  48. type: {{ $prot }}
  49. path: /healthz
  50. port: {{ .Values.n8nNetwork.webPort }}
  51. initContainers:
  52. {{- include "ix.v1.common.app.permissions" (dict "containerName" "01-permissions"
  53. "UID" .Values.n8nRunAs.user
  54. "GID" .Values.n8nRunAs.group
  55. "mode" "check"
  56. "type" "install") | nindent 8 }}
  57. {{- include "ix.v1.common.app.redisWait" (dict "name" "02-redis-wait"
  58. "secretName" "redis-creds") | nindent 8 }}
  59. {{- include "ix.v1.common.app.postgresWait" (dict "name" "03-postgres-wait"
  60. "secretName" "postgres-creds") | nindent 8 }}
  61. {{- end -}}