Skip to content

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.

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.

NamespaceContentsLabel alquimia.ai/namespace-role
alquimia-runtimeRuntime master (×1), workers (×2–6), KEDA ScaledObjectnone
alquimia-studioStudio (×2)none
alquimia-trustlensTrustLens (optional)none
kafkaStreams for Apache Kafka cluster alquimia-default, topics, usersbackend
alquimia-postgresPostgreSQL cluster (runtime, TrustLens)backend
alquimia-redisRedis Enterprise clusterbackend
alquimia-qdrantQdrant clusterbackend
alquimia-mongodbMongoDB replica set for Studionone (Studio only)
vaultVault Enterprise HA clusterbackend
keycloakRed Hat build of Keycloaknone (reached through its Route)
zero-trust-workload-identity-manager or spireSPIRE server, agents, SPIFFE CSI drivernone
alquimia-observabilityOpenTelemetry Collector, TempoStacknone
alquimia-modelsOpenShift AI inference services (optional)none
openshift-storageOpenShift Data Foundation (S3, block storage)none (add an explicit rule)

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
FromToPortCovered by
RouterMasterTCP 8080allow-master-ingress (base)
RouterStudioTCP 3000Your Studio namespace policy
StudioMasterTCP 8080allow-master-ingress (base) plus Studio egress
StudioMongoDBTCP 27017Your Studio and MongoDB policies
Master, workersKafkaTCP 9093allow-*-to-backends (base)
Master, workersPostgreSQLTCP 5432allow-*-to-backends, with label fixes for your operator’s pods
Master, workersRedisTCP 6379allow-*-to-backends, with label fixes
MasterQdrantTCP 6333allow-master-to-backends
Master, workersVaultTCP 8200allow-*-to-backends
Master, workersODF S3Endpoint target portAdd a rule (base covers Alarik only)
Master, workersQuay443Worker 443 rule. For an in-cluster Quay, add a namespace rule
WorkersOpenShift AI predictorsPredictor portAdd worker egress plus ingress in alquimia-models
MasterTrustLensTrustLens portAdd master egress plus TrustLens ingress
MasterKeycloak Route443allow-master-keycloak-egress (OpenShift overlay)
All runtime podsOTel CollectorTCP 4317/4318allow-otel (base)
WorkersExternal LLM and MCP443allow-worker-llm-mcp-egress, narrowed by EgressFirewall
KubeletRuntime podsTCP 8080allow-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.

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.

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.

ComponentProduction layoutBehaviour when a zone or pod fails
Runtime masterExactly 1 replica, Recreate strategyAPI is unavailable until the pod is rescheduled. Running workers keep processing events that are already queued.
Runtime workers2–6 replicas, spread with topologySpreadConstraints on topology.kubernetes.io/zone, plus a PodDisruptionBudgetKafka rebalances partitions to the surviving workers.
Kafka3 controllers, 3 brokers, rack.topologyKey: topology.kubernetes.io/zone, min.insync.replicas: 2Survives the loss of one zone with no data loss.
PostgreSQL1 primary, 2 replicas (1 synchronous), continuous backup to S3The operator promotes a replica.
RedisReplicated database with zone-aware shard placementFails over to a replica. In-flight context written after the last replication may be lost.
Qdrant3 nodes, replication factor ≥ 2Reads and writes continue on the surviving replicas.
Vault3 or 5 Raft nodes, auto-unsealKeeps quorum after losing one zone.
Studio2 replicas with MongoDB (DB_STRATEGY=mongo)Stateless.
WorkloadRequestsLimitsNotes
Master500m CPU, 1 Gi1 CPU, 2 GiScale vertically only.
Worker500m CPU, 1 Gi, 1 Gi ephemeral1 CPU, 2 Gi, 4 Gi ephemeralMostly I/O-bound, waiting on LLM calls. Ephemeral storage holds the registry and Hugging Face cache emptyDirs and staged Boltzmann brains.
rclone sidecars100m CPU, 256 Mi200m CPU, 256 MiOne for each runtime pod.
alquimia.events6 partitions, RF 3n/aThe 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.

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.