Let K8S know if the app is ready or alive/dead
By default Odoo will log every web request.
When running in OpenShift/K8S we want to verify if the web pod is ready to accept traffic, or verify if it is alive or dead, without polluting the logs.
- Navigate to your custom Odoo addons directory:
cd <odoo_custom_addons>
- Clone this project by running the following command:
git clone https://github.com/trimentor/odoo-k8s-health-check.git k8s_health_check
- Activate the Odoo developer mode (Settings)
- Update Apps List (Apps)
- Remove "Apps" from the search field
- Search and Install the "k8s_health_check" module
In the Deployment Config or your web app, configure your Readiness Probe with:
- Type: HTTP GET
- Path: /k8s_health_check/status
- Port: 8069
- Initial Delay: 10 seconds
- Timeout: 5 seconds
To check if the web app is alive/dead we can execute a command inside the container.