Odoo is a suite of open-source business apps written in Python. With a range of Odoo apps and Community apps available as part of the suite, Odoo promises to help companies address all their business needs in a single, cost-effective and modular solution. In Odoo, all the apps talk to each other, so the pain of getting different apps from different providers to communicate is gone. Odoo is designed to cover all business needs, from websites and e-commerce to manufacturing, inventory, HR and accounting, all seamlessly integrated. It’s used by more than 2 million users worldwide, by companies ranging from sole traders to those with hundreds of thousands of employees.
In this tutorial, you will learn how to install Odoo on a Scaleway Kubernetes Kapsule by using the Easy-Deploy feature. Most of this can be achieved from within the Scaleway Console. We will follow these steps:
1 . Create a Scaleway Container Registry namespace
2 . Use Docker to get the official Odoo image and push it to your Scaleway Container Registry
3 . Create a Kubernetes Kapsule Cluster and deploy Odoo on it
4 . Install a PostgreSQL database for Odoo
5 . Connect the Odoo application to the PostgreSQL server
Requirements
- You have an account and are logged into console.scaleway.com
- You have configured your SSH Key
- You have generated your API keys
- You have Docker installed on your local computer
1 . In the Scaleway Console, access the Container Registry
dashboard, and click Create a namespace
2 . Complete the required information:
Public
(currently the Easy-Deploy feature only works on public images)Check the summary, then click Create a namespace
:
The following screen displays:
We will follow these instructions in the next step.
1 . Open a terminal window on your local machine, and log in to your namespace with Docker. Use the following command, with the relevant information for your own namespace name and Scaleway Secret Key
docker login rg.fr-par.scw.cloud/odoo-tutorial-namespace -u nologin -p $SCW_SECRET_KEY
2 . Pull the latest official Odoo image with the following command:
docker pull odoo:latest
3 . Tag the image, ready to push it to your Container Registry:
docker tag odoo:latest rg.fr-par.scw.cloud/odoo-tutorial-namespace/odoo:latest
4 . Push it to your Container Registry with the following command:
docker push rg.fr-par.scw.cloud/odoo-tutorial-namespace/odoo:latest
It may take a few minutes for this step to complete. You will see output like this as the image uploads:
3 . Once the process has finished, wait another minute then check your Scaleway Container Registry to make sure the image has successfully appeared there:
Now that the Odoo image is in our Container Registry, we’re ready to deploy it with Kubernetes.
1 . In the Scaleway Console, access the Kubernetes dashboard. Click Create a cluster
:
2 . Enter the required information:
3 . Check the summary, then click Create a cluster
:
You will see a process screen telling you that your cluster is being created. You may also see an additional warning that some of your pools are not yet ready. After a few minutes, your cluster should be up and running and ready to use:
4 . On your cluster’s dashboard, click the Easy Deploy
tab, and then click Deploy a container
:
5 . Enter the required information:
6 . In Registry namespace
, select the namespace you created earlier from the dropdown list. Then select the Odoo
container you pushed to it.
7 . You can leave the other settings at default value for now, we will come back to them later. Click Deploy a container
:
Your container should now deploy:
The Odoo image’s documentation specifies that it requires a running PostgreSQL server, which we will now create:
1 . In the Scaleway console, go to the Database
dashboard, and click Create an Instance
:
2 . Start filling out the necessary information by selecting a PostgreSQL-12
engine and choosing your region and node type (we recommend minimum DB-DEV-L
). You can leave Backup
and High Availability
checked as default:
3 . In the Credentials section, enter a username and password. Then enter a name for your Database instance. Note all of these down as you will need them in a future step.
4 . Check the summary and click Create an Instance
:
A screen reports the progress of the database creation. After a minute or two, a screen similar to the following should confirm the creation of your database instance:
5 . Take note of the Endpoint
information, you will need it in the next step.
The Odoo image’s documentation tells us that by modifying the Odoo application’s environment variables HOST
, PORT
, USER
and PASSWORD
we can easily connect it to a PostgreSQL server. We will now expose our Odoo application with a Load Balancer, and set these environment variables so that it can connect to our newly created database.
1 . In the Scaleway Console, go back to your Kubernetes
dashboard and select the cluster you created and deployed your Odoo image on:
2 . Click on the Easy Deploy
tab. Then click on the ...
icon next to your Odoo container and select Edit
:
3 . Push the slider to Add Load Balancer
. Under Container port to expose
, enter 80:8069
. This means that your load balancer will map port for incoming traffic (80 is the default for http, you could use 443 for https) to your exposed container port (8069 being the default Odoo port). Click Add
:
4 . You should leave the Number of replicas
option at its default of 1 to avoid session token conflicts. Under Environment Variables
click Add Variable
four times, as you will need to add four environment variables here:
5 . Add the following information for your variables. Then click Update Container
:
123.456.78.91:1011
, then the host is 123.456.78.91
123.456.78.91:1011
, then the port is 1011
The edit will be carried out and you will be taken back to your container’s dashboard.
6 . On the left side menu of the Scaleway Console, click Load Balancer
. You should see a screen similar to the following:
7 . Click on the load balancer to expand its display. Note down the value of Load Balancer IPs
1 . Enter the Load Balancer IP
in a new browser window. It will take you to the Odoo landing page:
2 . Enter the required information:
The application will now launch. This may take a few moments. The following page displays:
Congratulations! You can now start installing apps, configuring your settings and seeing what Odoo has to offer. Check out the official Odoo documentation for more help. You may also wish to look at our tutorial on Installing Odoo on a Scaleway Dedibox, which gives some more information about configuring Odoo.
Note: Please keep in mind that the Easy Deploy feature has been designed to help you get started with Kubernetes: we do not recommend using this feature for production use for two reasons. Firstly, because it requires your container image to be publicly available, i.e. without access restrictions. And secondly, because it will not allow you to do such things as adding persistent volumes, linking several containers together etc without fine-tuning some settings yourself.