Compare commits

..

1 Commits
main ... 14.0

Author SHA1 Message Date
Mohammad Awais c1c27223e2
Merge pull request #2 from herawais/main
[DEL] Odoo EE module
2024-04-13 12:39:02 +05:00
16 changed files with 0 additions and 322 deletions

View File

@ -1,20 +0,0 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"
mkdocs:
configuration: mkdocs.yml
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt

View File

@ -1,49 +0,0 @@
# Setup DataBase Server for Client Instances
Either Use managed db service from [DO](https://www.digitalocean.com/products/managed-databases-postgresql)
or Setup a new VPS and install Postgres on your VPS
and dont forget to setup and alowing remote host connections
vim /etc/postgresql/14/main/postgresql.conf
Uncomment and edit the listen_addresses attribute to start listening to start listening to all available IP addresses.
!!! danger "Caution"
On production dont allow all hosts, only your desired IPs
Replace following in pg_hba.conf
listen_addresses = '*'
Now edit the PostgreSQL access policy configuration file.
vim /etc/postgresql/14/main/pg_hba.conf
Append a new connection policy (a pattern stands for [CONNECTION_TYPE][DATABASE][USER] [ADDRESS][METHOD]) in the bottom of the file.
!!! danger "Caution"
On production dont allow all hosts, only your desired IPs
Add following in pg_hba.conf
host all all 0.0.0.0/0 md5
We are allowing TCP/IP connections (host) to all databases (all) for all users (all) with any IPv4 address (0.0.0.0/0) using an MD5 encrypted password for authentication (md5).
It is now time to restart your PostgreSQL service to load your configuration changes.
systemctl restart postgresql
And make sure your system is listening to the 5432 port that is reserved for PostgreSQL.
ss -nlt | grep 5432

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 202 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 144 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 93 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 74 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 193 KiB

View File

@ -1,112 +0,0 @@
# Welcome to Odoo SaaS on K8s documentation!
## Architecture
![Architecture](img/img2.png)
There are two main sections of the system
1. Kubernetes Cluster
2. Manager Instance
## 1. Kubernetes Cluster
In Kubernetes Cluster we will have all essential parts of K8s cluster that are required to run a cluster in production
- Load Balancer
- cluster
- Nodes
- PVs
For detailed configuration of k8s cluster on digitalocean [click here](k8s_cluster.md), for aws (will be added later)
## 2. Manager Instance
It is a separate, VPS server
On manager instance we will install Odoo and these modules, currently odoo version 14.0 is supported, i have created a task to migrate these modules for latest (v17.0) of odoo
Your Cluster should be accessible from this instance.
Once you are able to access your cluster within your saas-manager-instance using kubectl
### Step 1 (Cluster Configuration):
Click Configuration -> Cluster Configurations and create a new cluster
We can manage multiple clusters from 1 manager instance
in name field add anything you want to name your cluster
Yaml Configuration file, copy and paste the kubeconfig.yaml
domain name is the domain which is attached and pointed to your k8s cluster / LoadBalancer DNS, it should be pre configured, write it as .yourdomain.com
then click on “Check Connection” , it should list all the namespaces of your cluster , it is just a method to check if we are good to go
![Cluster1](img/img1.png)
### Step 2 (Docker Images Configuration):
You can also use your private docker images hosted on [Docker Hub](https://hub.docker.com/) or public [odoos official docker images](https://hub.docker.com/_/odoo) to deploy your Odoo instance
in “Image Name” field you have to write the image name e.g bitnami/odoo , username/odoo, etc.
other fields are self explanatory
if your docker images are on private registry then place the “.docker/config.json” file here
more info [here](https://docs.docker.com/reference/cli/docker/config/)
![Cluster1](img/img3.png)
### Step 3 (Database server):
You have to deploy a Separate VPS for and install and configure postgres on it , or can use managed DB service from DigitalOcean or AWS
read the guide [here](db_server.md)
then check connectivity if you are able to connect from “Manager Instance” to the db server,
this db server will host all the client databases
![Cluster1](img/img5.png)
### Step 4 (Create App/Instance):
1. `Unique id` is the id of instance, dont change it in any case
2. `Name`, write any name
3. choose `sub domain` as per your requirement
4. if you want to deploy this client on a specific Node of K8s cluster then check “Any Specific Node” otherwise leave it as it is
5. choose Database server
6. `Database name` will be the name of db, but `sub domain name and database name should be same`
7. if you want to use `extra addons from github`, check the box and enter url, like this “https://github.com/OCA/account-financial-tools.git“
8. if the repo is private then you have to place the `access token` also, more info [here](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens)
9. Choose the `docker image`
10. if you want to install the `demo data` also then check the box
11. leave `Modules to Install` empty
12. Leave the `App Credentials` empty, these will be automatically populated after the instance goes live
13. Client user is the user, to whom you want to notify about this instance and creds, you should have configured smtp in your manager instance
![Cluster1](img/img4.png)
Save and click on **Deploy App**

View File

@ -1,42 +0,0 @@
# Kubernetes Cluster Setup
!!! note
Following guide will be based on DigitalOcean Managed Kubernetes (DOKS)
Create a cluster and add node(s) in the cluster on DO,
![Setup and Download Config File](img/k0.png)
1. Install Nginx ingress controller in the cluster, with app installer
2. Then loadbalancer will be provisioned automatically
![Nginx Ingress Controller](img/k1.png)
After pointing the domain to LBs DNS and installing nginx ingress controller
edit the LoadBalancer service (ingress-nginx/ingress-nginx-controller) using any tool, i am using k9s
Add this
kubernetes.digitalocean.com/load-balancer-id: {id_of_lb_here}
service.beta.kubernetes.io/do-loadbalancer-enable-proxy-protocol: 'true'
service.beta.kubernetes.io/do-loadbalancer-hostname: yourdomain.com
![Nginx Ingress Controller Service](img/k2.png)
Install cert-manager and ssl issuer. as per following guides
[https://github.com/cert-manager/cert-manager](https://github.com/cert-manager/cert-manager)
[https://kenanbek.github.io/kubernetes-https-nginx-ingress-cert-manager-digitalocean](https://github.com/cert-manager/cert-manager)
[https://cert-manager.io/docs/installation/](https://github.com/cert-manager/cert-manager)

View File

@ -1,6 +0,0 @@
# Setup Manager Instance to Manage Client Instances
!!! note
To be added here.

View File

@ -1,3 +0,0 @@
mkdocs
mkdocstrings[python]
markdown-include

View File

@ -1,67 +0,0 @@
#
# This file is autogenerated by pip-compile with python 3.10
# To update, run:
#
# pip-compile docs/requirements.in
#
click==8.1.3
# via mkdocs
ghp-import==2.1.0
# via mkdocs
griffe==0.22.0
# via mkdocstrings-python
importlib-metadata==4.12.0
# via mkdocs
jinja2==3.1.2
# via
# mkdocs
# mkdocstrings
markdown==3.3.7
# via
# markdown-include
# mkdocs
# mkdocs-autorefs
# mkdocstrings
# pymdown-extensions
markdown-include==0.6.0
# via -r requirements.in
markupsafe==2.1.1
# via
# jinja2
# mkdocstrings
mergedeep==1.3.4
# via mkdocs
mkdocs==1.3.0
# via
# -r requirements.in
# mkdocs-autorefs
# mkdocstrings
mkdocs-autorefs==0.4.1
# via mkdocstrings
mkdocstrings[python]==0.19.0
# via
# -r requirements.in
# mkdocstrings-python
mkdocstrings-python==0.7.1
# via mkdocstrings
packaging==21.3
# via mkdocs
pymdown-extensions==10.0
# via mkdocstrings
pyparsing==3.0.9
# via packaging
python-dateutil==2.8.2
# via ghp-import
pyyaml==6.0
# via
# mkdocs
# pymdown-extensions
# pyyaml-env-tag
pyyaml-env-tag==0.1
# via mkdocs
six==1.16.0
# via python-dateutil
watchdog==2.1.9
# via mkdocs
zipp==3.8.0
# via importlib-metadata

View File

@ -1,23 +0,0 @@
site_name: Production ready Odoo SaaS based on Kubernetes
theme:
name: readthedocs
highlightjs: true
plugins:
- search
- mkdocstrings:
handlers:
# See: https://mkdocstrings.github.io/python/usage/
python:
options:
docstring_style: sphinx
markdown_extensions:
- markdown_include.include:
base_path: .
- admonition
nav:
- Home: 'index.md'
- Setup Manager Instance: 'manager.md'
- Setup K8s Cluster: 'k8s_cluster.md'
- Setup DB Server: 'db_server.md'