Private Deployment
Architecture

Architecture & Operations Guide

This document explains the Rulebricks Helm chart architecture, component interactions, migration flows, and operational considerations, so you can better configure your deployment.

Component Overview

Request Flow

Component Responsibilities

ComponentPurposeScaling
TraefikIngress, TLS termination, routingHPA (2-3 replicas default)
AppWeb UI, rule editor, management APISingle replica
HPS GatewayAPI gateway for rule executionStatic replicas
HPS WorkersRule execution enginesKEDA-scaled Deployment
RedisRule cache, session storageSingle replica with persistence
KafkaMessage queue, event streamingKRaft mode, single node default
PostgreSQLPersistent data storageSingle replica with PVC
VectorDecision log aggregation and forwardingStatic replicas
ClickHouseDecision log queries over object storageStateless, single replica default
PrometheusMetrics collectionSingle replica, optional remote write

Decision Log Pipeline

Every rule execution emits a structured decision log. HPS and the app produce entries to the Kafka logs topic; Vector archives them to object storage as NDJSON; ClickHouse queries the archive on demand for the dashboard:

The full walkthrough, values, and custom sink examples live in Decision Logs. Database backups travel to the same bucket under a separate key prefix; see Storage & Backups.


Database Migrations

The chart includes two migration job variants that run automatically based on your configuration.

Migration Decision Tree

Self-Hosted Migration Job

Triggered when: supabase.enabled: true

The job extracts SQL migrations from the Rulebricks app image, waits for PostgreSQL to become ready, and applies them in order. Applied migrations are tracked in a schema_migrations table so re-runs skip what's already done. Jobs run as Helm post-install/post-upgrade hooks and clean themselves up automatically.

Managed Supabase Setup Job

Triggered when: supabase.enabled: false AND global.supabase.accessToken is provided

The job authenticates with your access token via the Supabase CLI, links to your project, pushes configuration (domain, SMTP, auth settings, email templates), applies the schema with supabase db push, and enables SSL enforcement.

If a migration job fails, see Troubleshooting for diagnostics.


DNS and TLS Setup

DNS Record Requirements

ScenarioRecords Needed
Self-hosted Supabase{domain}, supabase.{domain}
Managed Supabase{domain} only

Scaling Considerations

ComponentScaling MethodTrigger
TraefikHPACPU utilization
HPS WorkersKEDAKafka lag, CPU
VectorManualLog volume

Workers run as a Deployment scaled by KEDA, so scale-out creates pods in parallel and delivers burst capacity in seconds. Worker concurrency is bounded by the partition count of the solution Kafka topic; the full sizing model and the values that control it live in Performance & Scaling.

For diagnostics across all components, see Troubleshooting.