_listmonk.tpl 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. {{- define "listmonk.workload" -}}
  2. workload:
  3. listmonk:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.listmonkNetwork.hostNetwork }}
  9. containers:
  10. listmonk:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: {{ .Values.listmonkRunAs.user }}
  16. runAsGroup: {{ .Values.listmonkRunAs.group }}
  17. envFrom:
  18. - secretRef:
  19. name: listmonk-creds
  20. {{ with .Values.listmonkConfig.additionalEnvs }}
  21. envList:
  22. {{ range $env := . }}
  23. - name: {{ $env.name }}
  24. value: {{ $env.value }}
  25. {{ end }}
  26. {{ end }}
  27. probes:
  28. liveness:
  29. enabled: true
  30. type: http
  31. port: {{ .Values.listmonkNetwork.webPort }}
  32. path: /health
  33. readiness:
  34. enabled: true
  35. type: http
  36. port: {{ .Values.listmonkNetwork.webPort }}
  37. path: /health
  38. startup:
  39. enabled: true
  40. type: http
  41. port: {{ .Values.listmonkNetwork.webPort }}
  42. path: /health
  43. initContainers:
  44. {{- include "ix.v1.common.app.postgresWait" (dict "name" "01-postgres-wait"
  45. "secretName" "postgres-creds") | nindent 8 }}
  46. 02-db:
  47. enabled: true
  48. type: init
  49. imageSelector: image
  50. securityContext:
  51. runAsUser: {{ .Values.listmonkRunAs.user }}
  52. runAsGroup: {{ .Values.listmonkRunAs.group }}
  53. envFrom:
  54. - secretRef:
  55. name: listmonk-creds
  56. command:
  57. - /bin/sh
  58. args:
  59. - -c
  60. - |
  61. /listmonk/listmonk --install --idempotent --yes
  62. /listmonk/listmonk --upgrade --yes
  63. {{- end -}}