Kubernetes can automatically run multiple copies of Odoo services, so it 's very well suited to make a highly available Odoo deployment, in this case,Odoo The service runs in the kubernetes cluster, while the PostgreSQL database runs in another Cluster host host Network on the other host
Install kubernetes Cluster, there are many ways, as of now, the easiest is to use kubeadm installation, installation of the steps to refer to the HTTP ://www.cnblogs.com/odoouse/p/6877766.html
This article mainly explains How do I deploy Odoo?
To deploy a service into the k8s cluster, you must have a full set of Yaml documentsdescribing the service , Odoo yaml is ready, and stored in HTTPS ://github.com/jeffery9/kubernetes-odoo/blob/master/odoo.yaml
in this file, a few variables are defined, so you need to change the variables based on your usage scenarios.
For example, change localhost to the address of your postgreSQL service, Odoo is the database user name, 1234 is the database password, also make corresponding changes
after the modification, perform kubectl apply-f odoo.yaml apply this Yaml
after the application is successful, Deployment and Service Resources will be established ,
Deployment Resources
Service Resources
can be done by Services Clusterip access to odoo services, such as
If you are the pod network plugin is calico, you must turn on NAT function for pod network , download calicoctl Binary file, and then execute the command
Cat << EOF | etcd_endpoints=http://10.96.232.136:6666./calicoctl Apply-f-
Apiversion:v1
Kind:ippool
Metadata
Cidr:192.168.0.0/16
Spec
Nat-outgoing:true
Eof
Note that changing the http://10.96.232.136:6666 to match your scene's etcd address
Running Odoo in the Kubernetes cluster