Production reference architecture
This reference architecture is for a single production OpenShift cluster spread across three availability zones, with every dependency run by a supported operator (see Supported operator stack). Development and staging clusters use the same layout with fewer replicas.
Namespace layout
Section titled “Namespace layout”Each workload class gets its own namespace, so NetworkPolicies, quotas, RBAC, and operator scopes stay narrow. Namespaces that hold backing services carry the alquimia.ai/namespace-role=backend label that the runtime’s network policies select on.
| Namespace | Contents | Label alquimia.ai/namespace-role |
|---|---|---|
alquimia-runtime | Runtime master (×1), workers (×2–6), KEDA ScaledObject | none |
alquimia-studio | Studio (×2) | none |
alquimia-trustlens | TrustLens (optional) | none |
kafka | Streams for Apache Kafka cluster alquimia-default, topics, users | backend |
alquimia-postgres | PostgreSQL cluster (runtime, TrustLens) | backend |
alquimia-redis | Redis Enterprise cluster | backend |
alquimia-qdrant | Qdrant cluster | backend |
alquimia-mongodb | MongoDB replica set for Studio | none (Studio only) |
vault | Vault Enterprise HA cluster | backend |
keycloak | Red Hat build of Keycloak | none (reached through its Route) |
zero-trust-workload-identity-manager or spire | SPIRE server, agents, SPIFFE CSI driver | none |
alquimia-observability | OpenTelemetry Collector, TempoStack | none |
alquimia-models | OpenShift AI inference services (optional) | none |
openshift-storage | OpenShift Data Foundation (S3, block storage) | none (add an explicit rule) |
Network flows
Section titled “Network flows”Each arrow is a flow you must allow explicitly. Everything else is denied by default.
flowchart TB
user(["Users · external channels"])
router["OpenShift Router<br/>edge / re-encrypt TLS"]
subgraph studio_ns["alquimia-studio"]
studio["Studio :3000"]
end
subgraph rt_ns["alquimia-runtime"]
master["master :8080"]
workers["workers"]
end
subgraph backend["backend namespaces · role=backend"]
kafka[("Kafka :9093 mTLS")]
data[("PostgreSQL · Redis<br/>Qdrant · Vault")]
end
subgraph platform["platform namespaces"]
odf[("ODF S3")]
quay["Quay"]
models["OpenShift AI"]
tl["TrustLens"]
end
shared["Keycloak Route · SPIRE socket<br/>OTel Collector"]
mongo[("MongoDB")]
saas(["Approved external LLM / MCP<br/>through EgressFirewall"])
user --> router
router --> studio
router --> master
studio --> master
studio --> mongo
rt_ns --> backend
rt_ns --> platform
workers -->|"443"| saas
studio_ns -.-> shared
rt_ns -.-> shared
| From | To | Port | Covered by |
|---|---|---|---|
| Router | Master | TCP 8080 | allow-master-ingress (base) |
| Router | Studio | TCP 3000 | Your Studio namespace policy |
| Studio | Master | TCP 8080 | allow-master-ingress (base) plus Studio egress |
| Studio | MongoDB | TCP 27017 | Your Studio and MongoDB policies |
| Master, workers | Kafka | TCP 9093 | allow-*-to-backends (base) |
| Master, workers | PostgreSQL | TCP 5432 | allow-*-to-backends, with label fixes for your operator’s pods |
| Master, workers | Redis | TCP 6379 | allow-*-to-backends, with label fixes |
| Master | Qdrant | TCP 6333 | allow-master-to-backends |
| Master, workers | Vault | TCP 8200 | allow-*-to-backends |
| Master, workers | ODF S3 | Endpoint target port | Add a rule (base covers Alarik only) |
| Master, workers | Quay | 443 | Worker 443 rule. For an in-cluster Quay, add a namespace rule |
| Workers | OpenShift AI predictors | Predictor port | Add worker egress plus ingress in alquimia-models |
| Master | TrustLens | TrustLens port | Add master egress plus TrustLens ingress |
| Master | Keycloak Route | 443 | allow-master-keycloak-egress (OpenShift overlay) |
| All runtime pods | OTel Collector | TCP 4317/4318 | allow-otel (base) |
| Workers | External LLM and MCP | 443 | allow-worker-llm-mcp-egress, narrowed by EgressFirewall |
| Kubelet | Runtime pods | TCP 8080 | allow-runtime-health-probes (base) |
Rows marked “add” have no rule in the runtime’s base policies or the OpenShift overlay. For ODF, check the s3 Service in openshift-storage for the endpoint pods’ labels and target port. Give Studio’s namespace its own default-deny policy plus the egress rules above.
Controlling egress to the internet
Section titled “Controlling egress to the internet”NetworkPolicy works on IP addresses, so the shipped worker rule opens TCP 443 to 0.0.0.0/0, and the OpenShift overlay does the same for the master’s Keycloak traffic. In production, add an OVN-Kubernetes EgressFirewall in alquimia-runtime that allows only approved DNS names, such as your model providers, MCP servers, and the Keycloak Route hostname, and denies everything else. Use an EgressIP when external providers allow-list source addresses. Serving models in-cluster with OpenShift AI removes most of these exceptions.
High availability across zones
Section titled “High availability across zones”block-beta
columns 3
block:az1
columns 1
z1["Zone A"]
m1["runtime master ×1 · RWO registry PVC"]
w1["runtime worker"]
k1["Kafka broker + controller"]
p1[("PostgreSQL primary")]
r1["Redis primary shard"]
q1["Qdrant node"]
v1["Vault node"]
end
block:az2
columns 1
z2["Zone B"]
space
w2["runtime worker"]
k2["Kafka broker + controller"]
p2[("PostgreSQL sync replica")]
r2["Redis replica"]
q2["Qdrant node"]
v2["Vault node"]
end
block:az3
columns 1
z3["Zone C"]
space
w3["runtime worker"]
k3["Kafka broker + controller"]
p3[("PostgreSQL replica")]
r3["Redis replica"]
q3["Qdrant node"]
v3["Vault node"]
end
block:storage:3
columns 1
s3["Regional object storage (ODF or S3): registry backup · blobs · database backups"]
end
The master syncs its registry to object storage every 30 seconds, and every worker reads it from there. That object storage must survive the loss of a zone.
| Component | Production layout | Behaviour when a zone or pod fails |
|---|---|---|
| Runtime master | Exactly 1 replica, Recreate strategy | API is unavailable until the pod is rescheduled. Running workers keep processing events that are already queued. |
| Runtime workers | 2–6 replicas, spread with topologySpreadConstraints on topology.kubernetes.io/zone, plus a PodDisruptionBudget | Kafka rebalances partitions to the surviving workers. |
| Kafka | 3 controllers, 3 brokers, rack.topologyKey: topology.kubernetes.io/zone, min.insync.replicas: 2 | Survives the loss of one zone with no data loss. |
| PostgreSQL | 1 primary, 2 replicas (1 synchronous), continuous backup to S3 | The operator promotes a replica. |
| Redis | Replicated database with zone-aware shard placement | Fails over to a replica. In-flight context written after the last replication may be lost. |
| Qdrant | 3 nodes, replication factor ≥ 2 | Reads and writes continue on the surviving replicas. |
| Vault | 3 or 5 Raft nodes, auto-unseal | Keeps quorum after losing one zone. |
| Studio | 2 replicas with MongoDB (DB_STRATEGY=mongo) | Stateless. |
Sizing starting points
Section titled “Sizing starting points”| Workload | Requests | Limits | Notes |
|---|---|---|---|
| Master | 500m CPU, 1 Gi | 1 CPU, 2 Gi | Scale vertically only. |
| Worker | 500m CPU, 1 Gi, 1 Gi ephemeral | 1 CPU, 2 Gi, 4 Gi ephemeral | Mostly I/O-bound, waiting on LLM calls. Ephemeral storage holds the registry and Hugging Face cache emptyDirs and staged Boltzmann brains. |
| rclone sidecars | 100m CPU, 256 Mi | 200m CPU, 256 Mi | One for each runtime pod. |
alquimia.events | 6 partitions, RF 3 | n/a | The partition count is the hard ceiling on active workers. Increase it before raising maxReplicaCount. |
Measure your own workload before going live. Worker sizing depends mostly on tool-call fan-out, attachment sizes, and local embedding or shield models.
Environments and promotion
Section titled “Environments and promotion”Configuration and agent behaviour are promoted separately. Runtime configuration goes through Git and OpenShift GitOps. Agent definitions go through signed OCI artifacts in Quay.
flowchart TB
subgraph dev["Dev"]
g_dev["Git: overlays/dev"] -->|"Argo CD"| rt_dev["Dev cluster<br/>runtime + Studio"]
rt_dev -->|"publish + cosign sign"| q_dev[("Quay: agents-dev")]
end
subgraph stg["Staging"]
g_stg["Git: overlays/staging"] -->|"Argo CD"| rt_stg["Staging cluster<br/>runtime"]
q_stg[("Quay: agents-staging")] -->|"pull by tag"| rt_stg
end
subgraph prd["Production"]
g_prd["Git: overlays/production"] -->|"Argo CD · manual sync"| rt_prd["Production cluster<br/>runtime"]
q_prd[("Quay: agents-production")] -->|"pull by tag · signature required"| rt_prd
end
q_dev -->|"CI: validate, evaluate, copy tag"| q_stg
q_stg -->|"approval: copy tag"| q_prd
- Production runtimes pull agentspaces by immutable tag into versioned (“cold”) registries, so an inference is reproducible from the tag alone.
- Each environment’s runtime trusts only the signing identity for its own Quay organization (
ALQUIMIA_OCI_COSIGN_CERT_IDENTITY), so an artifact cannot skip a stage. - Use Advanced Cluster Management to manage the dev, staging, and production clusters, with policy and GitOps placement from one hub.