← Knowledge library

IT & integrations

Reference architecture

This page describes the reference deployment topology for MANSOQ: a self-contained, two-node Kubernetes cluster that runs the MANSOQ backend and frontend alongside every supporting datastore and platform service. It is the architecture…

Current source · source documentation · 8 min read

This page describes the reference deployment topology for MANSOQ: a self-contained, two-node Kubernetes cluster that runs the MANSOQ backend and frontend alongside every supporting datastore and platform service. It is the architecture implemented by the deployment-k8 repository, where the infrastructure is provisioned with OpenTofu/Terraform and Helm.

The design targets on-premise or single-tenant cloud installations: everything — database, object storage, search, container registry, terminology server, monitoring — lives inside the cluster, so the deployment has no hard dependency on managed cloud services beyond an optional S3-compatible target for off-site backups.

This is a reference design, not a turnkey product. Several pieces are still hardening or evolving — see Planned and evolving below, and treat the day-2 operations page as the operational companion to this one.

How the repository maps to the architecture

The component inventory below is grounded in three directories of the deployment-k8 repository. Reading these is the fastest way to see exactly what gets deployed:

Directory What it holds
infra/ OpenTofu/Terraform modules, applied per concern: networking, volumes, database, objectstore, registry, opensearch, monitoring, care, odoo, metabase, snowstorm.
helm_charts/ First-party Helm charts maintained in-repo: mansoq_be, mansoq-web, odoo, metabase, snowstorm.
helm_values/ Values overlays for upstream and first-party charts: mansoq-be, mansoq-fe, longhorn, rustfs, postgres-db, valkey, opensearch-operator, opensearch-cluster, zot, odoo, metabase, snowstorm, nginx, prom-stack, loki, alloy, grafana-agent-operator, argo.

Each infra/<module> is applied with the repository's deployer.py helper (apply-tofu to run the OpenTofu module, apply-k8 to apply any generated Kubernetes manifests). See Deploying MANSOQ onto the cluster for the exact order.

Cluster topology

The reference cluster is two nodes on the same network, provisioned with kubeadm:

The primary control-plane node is made schedulable (its control-plane taint is removed) so it can also run application workloads. Node labels drive placement: Helm values pin pods to the correct node via nodeSelector on ohn/role. Data is replicated across both nodes at the storage layer (see Storage) so the cluster can tolerate the loss of a node and be rebuilt from replicated volumes plus off-site backups.

The cluster is built directly with kubeadm against a stable Kubernetes release line (the install notes target the v1.34 package channel). The full node-bootstrap procedure — installing containerd, kubelet/kubeadm/kubectl, joining the worker, removing taints, and applying node labels — is covered in Provisioning the cluster.

Networking

Routing host names, node IPs, and domains are environment-specific and supplied through Terraform variables (for example mansoq_public_domain, mansoq_api_public_domain, primary_node_ip, secondary_node_ip). Do not hardcode site-specific host names into shared manifests — keep them in your environment's variable file.

Storage

The buckets MANSOQ and the platform expect (for example mansoq-facility, mansoq-fileupload, and the log/ruler buckets used by Loki) are created in RustFS as part of bring-up.

Components

Component Role
MANSOQ backend MANSOQ API. Runs as a web deployment plus Celery workers and a Celery beat scheduler; a one-shot migration job applies database migrations. Pulls its image from the in-cluster registry.
MANSOQ frontend Static MANSOQ web app served by nginx.
PostgreSQL Primary relational datastore, run by the CloudNativePG (CNPG) operator as a managed Cluster. Hosts the care, odoo, and metabase databases as managed roles/databases, with WAL archiving and scheduled backups to S3 via the Barman Cloud plugin.
Valkey / Redis In-memory cache and Celery broker for the MANSOQ backend. Run non-persistent (no disk, no backups).
OpenSearch Search and indexing tier for MANSOQ, run via an operator with a single-node cluster and a dedicated Longhorn volume.
RustFS S3-compatible object store (MinIO-compatible) for uploads, facility files, and logs.
Odoo ERP/back-office integration that MANSOQ talks to through the mansoq_odoo plugin.
Metabase Analytics and dashboards over the MANSOQ database.
Snowstorm SNOMED CT terminology server (with a data-loader step to seed terminology).
zot OCI container registry that holds the MANSOQ backend/frontend images built and pushed during deployment.

The MANSOQ backend is pluggable: integrations such as mansoq_odoo are installed as additional plugs at deploy time rather than baked into the core image. See the contributor guide on MANSOQ pluggable apps for how plugs are structured.

Observability

Monitoring is a self-hosted Grafana stack, installed by the monitoring module:

Prometheus, Loki, and Grafana persist to Longhorn volumes pinned to the secondary node.

Request and data flow

The high-level path from a client to a datastore:

                         Clients (browsers, integrations)
                                      |
                                      v
              +-------------------------------------------------+
              |   Ingress controllers (nginx + WAF / OWASP CRS) |
              |   TLS termination (Let's Encrypt wildcard)      |
              |   public-nginx  |  private-nginx                |
              +-------------------------------------------------+
                       |                         |
                       v                         v
              +----------------+        +------------------+
              |   MANSOQ FE      |        |   MANSOQ BE        |
              |   (nginx)      |  --->  |  web + celery    |
              +----------------+        |  + beat          |
                                        +------------------+
                                               |
            +----------------+----------------+----------------+
            v                v                v                v
     +-------------+  +-------------+  +-------------+  +-------------+
     | PostgreSQL  |  | Valkey/     |  | OpenSearch  |  |  RustFS     |
     | (CNPG)      |  | Redis       |  | (search)    |  | (S3 object  |
     | care DB     |  | cache/broker|  |             |  |  storage)   |
     +-------------+  +-------------+  +-------------+  +-------------+

Supporting services — Odoo, Metabase, Snowstorm, the zot registry, and the Prometheus/Grafana/Loki stack — sit alongside this path. Odoo and Metabase share the same CNPG-managed PostgreSQL cluster (separate databases), MANSOQ reaches Odoo over the internal service network, and the registry serves the MANSOQ images that the backend and frontend deployments pull.

Planned and evolving

Several aspects of this architecture are explicitly works in progress. Treat the items below as roadmap direction drawn from the design's own backlog, not as current guarantees:

For how these components are stood up in practice, continue to Provisioning the cluster and Deploying MANSOQ onto the cluster.

Source evidence

References are pinned to the private MANSOQ source repository. Repository access is required to open these links.