From 34fe5f305d27fa12ffc6c2b100cd53d095e8ad77 Mon Sep 17 00:00:00 2001 From: Nikhil Jha Date: Sat, 20 Apr 2024 22:27:19 -0700 Subject: [PATCH] :rocket: deploy odoo --- apps/odoo.py | 56 ++++++++++++++++++++++++++++++++++++++++++++++ apps/versions.toml | 4 ++++ cluster.toml | 2 ++ 3 files changed, 62 insertions(+) create mode 100644 apps/odoo.py diff --git a/apps/odoo.py b/apps/odoo.py new file mode 100644 index 0000000..cb195fb --- /dev/null +++ b/apps/odoo.py @@ -0,0 +1,56 @@ +from transpire import helm +from transpire.utils import get_versions + +name = "odoo" + + +def objects(): + yield { + "apiVersion": "acid.zalan.do/v1", + "kind": "postgresql", + "metadata": {"name": "ocf-odoo-db"}, + "spec": { + "teamId": "ocf", + "volume": { + "size": "128Gi", + "storageClass": "rbd-nvme", + }, + "numberOfInstances": 1, + "users": {"odoo": ["superuser", "createdb"]}, + "databases": {"odoo": "odoo"}, + "postgresql": {"version": "15"}, + }, + } + + yield from helm.build_chart_from_versions( + name=name, + versions=get_versions(__file__), + values={ + # Database + "postgresql": { + "enabled": False, + }, + "externalDatabase": { + "host": "ocf-odoo-db", + "port": 5432, + "user": "odoo", + "database": "odoo", + "existingSecret": "odoo.ocf-odoo-db.credentials.postgresql.acid.zalan.do", + "existingSecretPasswordKey": "password", + }, + # Mail + "smtpHost": "smtp.ocf.berkeley.edu", + # Ingress + "ingress": { + "enabled": True, + "ingressClassName": "contour", + "annotations": { + "cert-manager.io/cluster-issuer": "letsencrypt", + "ingress.kubernetes.io/force-ssl-redirect": "true", + "kubernetes.io/tls-acme": "true", + }, + "hostname": "odoo.ocf.berkeley.edu", + "tls": True, + }, + }, + ) diff --git a/apps/versions.toml b/apps/versions.toml index 8e439bc..3327981 100644 --- a/apps/versions.toml +++ b/apps/versions.toml @@ -78,6 +78,10 @@ helm = "https://kubernetes-sigs.github.io/metrics-server/" version = "0.3.0" helm = "https://harbor.ocf.berkeley.edu/chartrepo/mycelium" +[odoo] +version = "26.0.0" +helm = "https://charts.bitnami.com/bitnami" + [postgres-operator] version = "1.10.1" helm = "https://opensource.zalando.com/postgres-operator/charts/postgres-operator" diff --git a/cluster.toml b/cluster.toml index e4810ba..185d4bd 100644 --- a/cluster.toml +++ b/cluster.toml @@ -32,6 +32,7 @@ metrics-server = { path = "apps/metrics_server.py" } prometheus = { path = "apps/prometheus.py" } postgres-operator = { path = "apps/postgres_operator.py" } ocf-io = { path = "apps/ocf_io.py" } +odoo = { path = "apps/odoo.py" } rabbitmq = { path = "apps/rabbitmq.py" } rook = { path = "apps/rook.py" } snapshot-controller = { path = "apps/snapshot_controller.py" } @@ -51,3 +52,4 @@ ocfweb = { git = "https://github.com/ocf/ocfweb" } outline = { git = "https://github.com/ocf/outline" } templates = { git = "https://github.com/ocf/templates" } transpire = { git = "https://github.com/ocf/transpire" } +