The objective of this repository is to present a simple dockerfile for the provisioning of an Odoo image based on the official one by adding additional addons and to present a simple structure of Kubernetes manifests.
In addition to the Odoo image, some additional components are required for the application to works properly. Persistent storage is required for this:
- Odoo data - PostgreSQL
- Attachments
- User sessions
For PostgreSQL data, we use CloudNativePG. It is the Kubernetes operator that covers the entire lifecycle of a highly available PostgreSQL database cluster with a primary/standby architecture using native streaming replication.
For attachment, this example uses the OCA fs_attchement addon based on fsspec. This allows attachments to be sent to various storage devices, including s3 compatible storage and Azure file.
https://github.com/OCA/storage
For session, this example uses the OCA session_db addon that give the possibility to store session directly on the database instead of local filesystem.
In order to execute steps below, the following tools are required
- kubectl
- docker
- Kubernetes cluster with CloudNativePG
- K9S (Optionnal)
If you want to add additional addon on official Odoo image, you have to build the dockerfile
To build the Odoo image, we can use docker build command
docker build -t kubernetes-sample .
In order to apply manifests from this repository, you have to setup a Kubernetes cluster with CloudNativePG operator installed.
Steps are well documented on CloudNativePG documentation
Once the cluster is ready, the manifests can be applied with kubectl apply -k manifests
Each manifest can be applied manually with kubectl apply -f manifest/postgresql.yaml
for exemple