Skip to main content

Butler Architecture

Butler is a Kubernetes-native platform built on CRDs and operators. All state lives in Kubernetes, enabling GitOps workflows and standard tooling.

System Context

Management Cluster Components

ComponentPurposeRepository
butler-controllerReconciles TenantCluster, Team, ManagementAddonbutler-controller
butler-bootstrapReconciles ClusterBootstrap, MachineRequestbutler-bootstrap
butler-serverREST API and WebSocket for Consolebutler-server
butler-consoleWeb UI (React)butler-console
StewardHosts tenant control planes as podssteward
Cluster APIManages cluster infrastructureExternal

Tenant Cluster Components

Each tenant cluster includes:

ComponentPurpose
CiliumCNI networking
MetalLBLoadBalancer services
LonghornDistributed block storage (optional)
cert-managerTLS certificate management
TraefikIngress controller (optional)

Key Flows

Bootstrap

Creates a management cluster from scratch:

  1. User runs butleradm bootstrap
  2. CLI creates temporary KIND cluster
  3. Deploy bootstrap and provider controllers
  4. Create ClusterBootstrap CR
  5. Controller provisions VMs via provider
  6. Install Talos Linux and bootstrap Kubernetes
  7. Install platform addons
  8. Save kubeconfig, delete KIND

Detailed bootstrap flow

Tenant Cluster Creation

Creates a tenant cluster:

  1. User creates TenantCluster CR
  2. Controller creates StewardControlPlane (hosted CP)
  3. Controller creates CAPI Cluster and MachineDeployment
  4. CAPI provisions worker VMs
  5. Workers bootstrap and join cluster
  6. Controller installs platform addons
  7. Cluster transitions to Ready

Detailed tenant lifecycle

Addon Installation

Installs an addon on a cluster:

  1. User creates TenantAddon CR
  2. Controller retrieves AddonDefinition
  3. Controller gets tenant cluster kubeconfig
  4. Controller installs Helm chart
  5. Addon transitions to Installed

Detailed addon system

IP Address Management

Allocates IP addresses to tenant clusters from shared pools:

  1. Platform admin creates NetworkPool with CIDR range
  2. ProviderConfig references pools via poolRefs
  3. TenantCluster provisioning creates IPAllocation (Pending)
  4. NetworkPool controller allocates IPs using best-fit algorithm
  5. TenantCluster configures MetalLB with allocated ranges
  6. On deletion, IPs return to the pool

IPAM internals

Detailed Documentation

DocumentDescription
Bootstrap FlowManagement cluster creation process
Tenant LifecycleTenant cluster provisioning and management
Addon SystemAddon catalog and installation
Multi-TenancyRBAC implementation and namespace isolation
IPAM InternalsBitmap allocator, elastic scaling, garbage collection

Design Decisions

Architectural decisions live in design/adr/.

ADRDecision
ADR-0002Separate CLIs for operators (butleradm) and users (butlerctl)
ADR-0003CRDs as the API contract
ADR-0004Multi-repository architecture
ADR-0006Hosted control planes by default