_listmonk.tpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.permissions" (dict "containerName" "01-permissions"
  45. "UID" .Values.listmonkRunAs.user
  46. "GID" .Values.listmonkRunAs.group
  47. "mode" "check"
  48. "type" "install") | nindent 8 }}
  49. {{- include "ix.v1.common.app.postgresWait" (dict "name" "02-postgres-wait"
  50. "secretName" "postgres-creds") | nindent 8 }}
  51. 02-db:
  52. enabled: true
  53. type: init
  54. imageSelector: image
  55. securityContext:
  56. runAsUser: {{ .Values.listmonkRunAs.user }}
  57. runAsGroup: {{ .Values.listmonkRunAs.group }}
  58. envFrom:
  59. - secretRef:
  60. name: listmonk-creds
  61. command:
  62. - /bin/sh
  63. args:
  64. - -c
  65. - |
  66. /listmonk/listmonk --install --idempotent --yes
  67. /listmonk/listmonk --upgrade --yes
  68. {{- end -}}