_odoo.tpl 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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.permissions" (dict "containerName" "01-permissions"
  44. "UID" 101
  45. "GID" 101
  46. "type" "install") | nindent 8 }}
  47. {{- include "ix.v1.common.app.postgresWait" (dict "name" "02-postgres-wait"
  48. "secretName" "postgres-creds") | nindent 8 }}
  49. {{- if .Release.IsInstall }} {{/* If we use type: install it will run before the postgres wait and fail */}}
  50. 03-db-init:
  51. enabled: true
  52. type: init
  53. imageSelector: image
  54. securityContext:
  55. runAsUser: 101
  56. runAsGroup: 101
  57. env:
  58. ODOO_RC: /etc/odoo/odoo.conf
  59. command:
  60. - /bin/bash
  61. - -c
  62. - |
  63. /usr/bin/odoo --config=/etc/odoo/odoo.conf \
  64. --stop-after-init \
  65. --without-demo=all \
  66. --init=base
  67. {{- end -}}
  68. {{- end -}}