_odoo.tpl 2.3 KB

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