Cell

A cell is the cattle pen: a placement-and-grouping unit over entities of one EntityType. Cells carry a placement policy (how to rank members when recommending where a new tenant should land) and fleet-wide capacity constraints. Phase: schema.

A cell's members are entities of its entityType — for example, a prod-clusters cell whose members are TenantCluster entities. When an Action declares a recommendation against a cell, Terrantula ranks the members by the cell's policy and proposes the best target.

Minimal example

kind: Cell
name: prod-clusters
entityType: TenantCluster

Fields

FieldTypeRequiredDescription
kind"Cell"yesDiscriminator. Always Cell.
namestringyesUnique cell name within the project. Referenced by Action recommendations.
displayNamestringnoHuman label for the UI. Defaults to name.
entityTypestringyesName of the EntityType whose instances are this cell's members. Must reference an existing EntityType.
placementPolicy"least-loaded" | "round-robin" | "random"noHow to rank members when generating placement recommendations. Default least-loaded.
constraintsCellConstraint[]noFleet-wide capacity ceilings across all members. Default [].
parentCellsstring[]noNames of parent cells, for nested grouping. Default [].
membershipMembershipnoHow members are determined. Omitted = explicit (membership rows). When present, membership is derived from each member's property value.

CellConstraint

A ceiling on an aggregate of a member metric across the whole cell.

FieldTypeRequiredDescription
metricstringyesName of a metric declared on the cell's entityType.
aggregate"sum" | "avg" | "min" | "max"yesHow to combine the metric across all members.
maxnumberyesCeiling for the aggregated value.

Membership

Derived-membership rule. When membership.derivedFrom is present, the cell computes its members from a member entity's property value rather than from explicit membership rows.

FieldTypeRequiredDescription
derivedFrom.propertystringyesProperty of the cell's entityType to match on. Validated at apply.
derivedFrom.valuestringnoValue the property must equal for membership. Defaults to the cell's name.

Annotated example

The prod-clusters cell from the SaaS-tenants demo. Members are TenantCluster entities; placement uses least-loaded ranking by tenant-count; a fleet-wide cap of 500 tenants is enforced across the whole cell.

apiVersion: terrantula.io/v1
kind: Cell
metadata:
  name: prod-clusters
spec:
  displayName: Production cluster fleet
  entityType: TenantCluster
  placementPolicy: least-loaded
  constraints:
    - metric: tenant-count
      aggregate: sum
      max: 500

A derived-membership cell — clusters whose region property equals us-east-1 are automatically members, no membership rows required:

kind: Cell
name: us-east-1
entityType: TenantCluster
membership:
  derivedFrom:
    property: region
    value: us-east-1

Caveats

INFO

entityType must reference an existing EntityType. Because applyruns the schema phase in dependency order, you can declare the EntityType and the Cell in the same blueprint and the reference resolves.

NOTE

A cell constraint is a fleet-wide aggregate ceiling (e.g. "500 tenants across all clusters"). The per-entity ceiling (e.g. "50 tenants per cluster") lives on the EntityType's constraintsinstead.

NOTE

Membership comes in two flavors. Explicit (the default) reads membership rows — the UI may add/remove members directly because cell membership is Terrantula-owned intent. Derived computes membership from a property value; to change a derived cell's membership you change the entity property, which flows through an Actionand a pull request.

TIP

A legacy /pools route 308-redirects to /cells. "Pool" was the previous name; the field and route are now celleverywhere.