This is a project to build templates for running Odoo app inside OpenShift pods using Kompose.
If you are working with OpenShift and you want to run Odoo app, this project can be useful for you.
If you aren't working with OpenShift and you just want to deploy Odoo in Docker over your host or a cloud environment, the official Odoo template is more lightweight and suitable.
You need to install kompose in order to convert docker-compose and Dockerfile into yaml templates for using with OpenShift. You many need kubectl program if you want to apply the generated templates instead running directly into your OpenShift instance with kompose.
You can download kompose here.
First of all, you need to download this project and the submodule inside pointing the official odoo repository.
git clone https://github.com/jialvarez/odoo_openshift.git && cd odoo_openshift
git submodule update --init --remote
Then, you can deploy it in two different ways:
-
Just login into your cluster:
oc login https://api.<starter_or_pro>-<location>.openshift.com --token=<token>
-
Select a project:
oc project <project_name>
-
Start the conversion and deployment proccess
kompose --file docker-compose.yml --provider openshift --verbose up
Image generation can take a big time, so please be patient.
If you want to remove pods, deployments, and volumes generated, you should type:
kompose --file docker-compose.yml --provider openshift --verbose down
-
Just login into your cluster:
oc login https://api.<starter_or_pro>-<location>.openshift.com --token=<token>
-
Select a project:
oc project <project_name>
-
Generate templates
mkdir templates && kompose --provider openshift -v convert -f docker-compose.yml -o templates/
-
Apply them
kubectl apply -f templates/
You should use the official Odoo template for this, but anyway you can use this image both to deploy in cloud or in OpenShift. I use the same image to deploy to Google Cloud and to OpenShift.
You need to uncomment line defining the volume for Docker container and comment the OpenShift one.
And then just type:
docker-compose up -d