_odoo.tpl 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. {{- define "odoo.workload" -}}
  2. workload:
  3. odoo:
  4. enabled: true
  5. primary: true
  6. type: Deployment
  7. podSpec:
  8. hostNetwork: {{ .Values.odooNetwork.hostNetwork }}
  9. containers:
  10. odoo:
  11. enabled: true
  12. primary: true
  13. imageSelector: image
  14. securityContext:
  15. runAsUser: 101
  16. runAsGroup: 101
  17. env:
  18. ODOO_RC: /etc/odoo/odoo.conf
  19. {{ with .Values.odooConfig.additionalEnvs }}
  20. envList:
  21. {{ range $env := . }}
  22. - name: {{ $env.name }}
  23. value: {{ $env.value }}
  24. {{ end }}
  25. {{ end }}
  26. probes:
  27. liveness:
  28. enabled: true
  29. type: http
  30. path: /web/health
  31. port: {{ .Values.odooNetwork.webPort }}
  32. readiness:
  33. enabled: true
  34. type: http
  35. path: /web/health
  36. port: {{ .Values.odooNetwork.webPort }}
  37. startup:
  38. enabled: true
  39. type: http
  40. path: /web/health
  41. port: {{ .Values.odooNetwork.webPort }}
  42. initContainers:
  43. {{- include "ix.v1.common.app.postgresWait" (dict "name" "01-postgres-wait"
  44. "secretName" "postgres-creds") | nindent 8 }}
  45. {{- if .Release.IsInstall }} {{/* If we use type: install it will run before the postgres wait and fail */}}
  46. 02-db-init:
  47. enabled: true
  48. type: init
  49. imageSelector: image
  50. securityContext:
  51. runAsUser: 101
  52. runAsGroup: 101
  53. env:
  54. ODOO_RC: /etc/odoo/odoo.conf
  55. command:
  56. - /bin/bash
  57. - -c
  58. - |
  59. /usr/bin/odoo --config=/etc/odoo/odoo.conf \
  60. --stop-after-init \
  61. --without-demo=all \
  62. --init=base
  63. {{- end -}}
  64. {{- end -}}