Easy Odoo installation in a Kubernetes Cluster with the Glasskube Kubernetes Operator.
Odoo is an open-source ERP ("Enterprise Resource Planning") system that provides numerous functions through the use of apps. For example, there are extensions for Customer Relationship Management (CRM), billing systems, employee management, time tracking systems, and many other apps.
Odoo was written in the Python programming language and is based on the following components:
Odoo regularly releases new Docker images (
github.com/odoo/docker) and publishes
them on Docker Hub. These images make it easy to install and try out Odoo quickly. However, for production use, some
adjustments and configuration settings are required:
In addition to the database, Odoo also stores data in the directory
/var/lib/odoo/filestore of the local file system.
This mainly includes files uploaded by users. The persistence of files in the
/var/lib/odoo directory can be achieved
through the use of
Attention In the official Docker images, the major version tag (e.g., 16.0) is overwritten with each release of a minor version. Therefore, a change to the image can only be identified by the SHA256 hash.
This leads to several problems:
In order to solve these problems, Glasskube extends the official Odoo Docker image and publishes this new image using immutable tags.
The Dockerfile of Glasskube Odoo images can be found here:
The Docker images are published on Docker Hub:
Odoo generates asset bundles and images based on the Odoo version included in the Docker image, stores them in
/var/lib/odoo folder, and references these assets in the
ir_attachment database table. These asset bundles (
but the persisted asset bundles are not regenerated, an incompatibility arises between the delivered bundles and the
UncaughtPromiseError > TypeError Uncaught Promise > parent is undefined TypeError: parent is undefined removeLine@odo....
In a blog entry by Holden Rehg different variants are described to regenerate the assets.
In the Glasskube Docker image the assets are regenerated directly by deleting the database entries on the first reload
if the Odoo version has changed. Among other things, the Shell
run.sh executes the following SQL command:
DELETE FROM ir_attachment WHERE res_model = 'ir.ui.view' AND name LIKE '%assets_%';
To prevent this, the assets are intelligently regenerated in the Glasskube Odoo Docker image.
The question now arises as to how the Glasskube Odoo Docker images can be easily deployed in a Kubernetes cluster. The Glasskube Kubernetes Operator takes care of this task. It not only individualizes the initial installation to the customer's cloud infrastructure, but also solves the above-mentioned problems of the cached incompatible Docker images and takes over the operation of the database, its backups, and the update management. Odoo updates are initiated automatically in the course of an operator update.
If a Kubernetes cluster already exists and
kubectl is installed, the Git
github.com/glasskube/operator must be cloned for the installation
git clone email@example.com:glasskube/operator.git
deploy.sh script installs the required
dependencies and custom resource definitions.
# Cluster-wide deployment of version X.Y.Z (or latest) # of the Glasskube operator deploy/deploy.sh -v latest
Once the operator installation is complete, Odoo can be installed. For this purpose, only the following custom resource must be created in the cluster:
apiVersion: "glasskube.eu/v1alpha1" kind: Odoo metadata: name: odoo namespace: odoo spec: host: odoo.hostname.tld # hostname demoEnabled: true # Whether Odoo should be initially populated with demo data.
kubectl apply -f Odoo.yaml
This completes the installation. Updates to the Kubernetes operator will automatically update Odoo.
Important A DNS entry must be set on the 'LoadBalancer' or the ingress host. SSL certificates are automatically generated by the
In the Kubernetes custom resource definition, it can be specified whether Odoo should be initially populated with demo
For demonstrations and a first trial it is useful to set this parameter to
true, but for production use this is not
for productive use, however, this is not recommended.
Caution After the initial installation a change of this parameter has no influence anymore. Existing Odoo demo data will not be deleted.
The Glasskube Kubernetes operator for Odoo automatically backs up the PostgreSQL database in a MinIO bucket
Odoo has developed a Runbot that automates Odoo instances for Git Branches. for Git Branches. This tool is especially useful when using Enterprise or Custom add-ons, as it can be used to merge the entire Odoo source code is merged with the add-ons. An OCA (Odoo Community Association) member has created a Runbot like version for the automated provisioning of Odoo instances in a Kubernetes cluster. created: Runboat
The official Odoo Docker image is not directly suitable for production use, as this does not have immutable tags and the persistence of the asset bundles leads to version update problems. With the help of the Glasskube Odoo Docker images and the Glasskube Kubernetes operator, Odoo can be installed in a Kubernetes cluster in just a few steps.
Easily and scale your IT infrastructure while deploying applications quickly and securely with our cloud native technology solutions.
Now full data control is one click away