Skip to content

Multi-Cluster Management

Type: Explanation · Audience: Operator managing multiple clusters

RezusCloud manages multiple independent Kubernetes clusters (tenants). Each tenant cluster runs its own etcd, API server, and kubelets on dedicated machines — no shared control plane infrastructure. This guide describes the topology, provisioning flow, and lifecycle under the TF-state model.

Architecture

erDiagram
    MANAGEMENT_PLANE ||--o{ TENANT : "declares · owns"
    TENANT ||--|{ NODE_GROUP : "scales by spec"
    NODE_GROUP ||--o{ MACHINE : "projects from TF state"
    MACHINE }o--|| PROVIDER_CLASS : "rendered by"
    MACHINE }o--|| TENANT_CLUSTER : "joins"
    MANAGEMENT_PLANE {
        string api "K8s resource model · watch/SSE"
        string queue "debounced · serial per tenant"
        string tfstate "HTTP backend · encrypted blob per tenant"
        string mgmtlink "optional · env-gated · WG per-node /64"
    }
    TENANT {
        string talos_version "spec — drives rendered config"
        string k8s_version "spec"
        string pki "Talos secrets bundle · store-held"
    }
    NODE_GROUP {
        string role "controlplane · worker"
        string machine_spec "shape · disk · count"
    }
    PROVIDER_CLASS {
        string prefix "oci · openstack · metal"
        string renders ".tf.json · no plugin binaries"
    }
    MACHINE {
        string mgmt_address "extracted from TF state"
        string provider_id "extracted from TF state"
        string stage "management-plane status"
        string delivery "user_data (cloud) · Talos API push (metal)"
    }
    TENANT_CLUSTER {
        string control_plane "own etcd · dedicated machines"
    }

RezusCloud drives infrastructure through off-the-shelf Terraform providers spawned by tofu. A Provider is the RezusCloud-side Go module (internal/provider/<name>/) that wraps a real registry provider — it generates the .tf.json config and declares the TF-resource → RezusCloud-resource mapping. There are no custom provider-plugin binaries; the continuous management link (ADR 0018, SideroLink-compatible) is optional and env-gated.

Provisioning Flow

When a tenant is created with a node group, the apply queue debounces the spec change and runs a single tofu apply for the whole tenant:

  1. RezusCloud generates the .tf.json for the tenant's node groups (cloud VMs, bare-metal talos_machine_configuration_apply targets).
  2. tofu apply provisions cloud VMs / pushes config to bare metal.
  3. Cloud VMs boot fully configured via user_data (cluster secrets baked in). Bare metal receives config via the Talos API push.
  4. Nodes join the tenant cluster (etcd bootstraps on the first control-plane node).
  5. tofu writes the resulting state back to RezusCloud's TF HTTP backend — that state is the source of truth for the declared infrastructure.

Provider Catalog

Provider Type How it provisions
provider-oci Dynamic (cloud) OCI Compute instances with user_data
provider-openstack Dynamic (cloud) OpenStack Nova instances, config_drive user_data
provider-metal Static (bare metal) talos_machine_configuration_apply to maintenance-mode nodes

Each is a RezusCloud-side module, not a deployed process. Adding a platform means writing a module under internal/provider/<name>/, not shipping a new binary.

Tenant Lifecycle

Create a Tenant

rezusctl create cluster personal

List Tenants

rezusctl get clusters

Get Tenant Credentials

rezusctl kubeconfig personal > personal.yaml
export KUBECONFIG=personal.yaml
kubectl get nodes

Delete a Tenant

rezusctl cluster delete personal

Deletion is finalizer-controlled : DELETE sets a deletionTimestamp and finalizers block removal until the future TenantReconciler runs tofu destroy and clears them.

Node Roles

NodeGroup role labels determine Talos config type:

Role First machine Additional machines
controlplane init (bootstraps etcd) controlplane (joins existing etcd)
worker worker worker

Two Data Planes

Plane Holds Source Authority
Spec Declared infrastructure (tenant, node group, machine identity) TF state Authoritative
Status Observed runtime state (node health, machine stage) Best-effort on-demand probe (15 s TTL) Never authoritative, never written to TF state

Status is read-only from the operator's perspective: you declare spec, the system observes status — the status gatherer probes control-plane machines first via the Talos API, on demand, with a short in-memory TTL.

Scaling

Dimension Approach
More tenants Create additional tenant via CLI or API
Tenant HA 3+ control-plane machines
Management HA 3+ management cluster nodes
Workers per tenant Scale node-group count; the apply queue reconciles
New infrastructure platform Write a provider module under internal/provider/<name>/

See Also