Skip to content
KubeCell logoKubeCell

Guides

API reference

KubeCell owns exactly four CRDs under kubecell.io/v1alpha1. All of them are desired-state or preflight APIs. Fields with a single safe value are platform constants and intentionally absent.

KindScopeShort nameOwner
CellNamespacedcellPlatform
VirtualNodeClassCluster-scopedvnclassPlatform
VirtualClusterPlanNamespacedvcpTenant / platform
VirtualClusterNamespacedvcTenant / platform

Namespace

Cells must live in the same namespace as the controller, by convention kubecell-system.

Cell

The unit of physical capacity: one OCM ManagedCluster bound to one machine profile.

spec

FieldTypeRequiredNotes
managedClusterRef.namestringYesBound OCM ManagedCluster name. Immutable once any VirtualCluster resolves the Cell.
machineProfile.namestringYesProfile name; the placement selector. Immutable once resolved.
machineProfile.devices[]arrayNoInline accelerator contract. A single machine profile per Cell, not a list of profiles.
machineProfile.devices[].namestringYesStable identifier inside KubeCell, referenced by entitlement checks.
machineProfile.devices[].resourceNamestringYesExact host extended-resource key; must match character-for-character everywhere.

status (read-only)

FieldTypeRequiredNotes
observedGenerationint64Observed metadata.generation; distinguishes stale from fresh.
phaseenumPending | Provisioning | Ready | Degraded | Deleting | Failed.
conditions[][]ConditionJoined, Available, ProviderReady, InventoryFresh, CapabilityMismatch, and others.
managedCluster{name,uid,joined,available,leaseFresh,leaseRenewTime}objectOCM observation plus the decisive Lease freshness signal.
provider{k3kVersion,namespaceReady,k3kCRDsReady,controllerReady,cniReady,topolvmReady}objectDecomposition of host-baseline readiness.
nodes[]{name,profile,ready,labelHash,capacity,allocatable,activeRequested,pendingRequested,readinessReasons,observedAt}arrayPer-node inventory and placement inputs.
inventory{<resource>{capacity,allocatable,requested,pending,availableEstimate}}mapAggregated headroom per resource.
storageInventory{provisioner,allocatedPV,perNode,freeCapacity,freeCapacityKnown,freeCapacitySource,fresh,observedAt}objectTopoLVM free space must come from lvmd; inferring from PV capacity is forbidden.
nodePorts{allocated,observedAt,fresh}objectAllocated NodePorts for child APIs.
cell-full.yaml
apiVersion: kubecell.io/v1alpha1kind: Cellmetadata:  name: cell1  namespace: kubecell-systemspec:  managedClusterRef:    name: cell1  machineProfile:    name: ascend-910b    devices:    - name: ascend      resourceName: huawei.com/Ascend910status:  observedGeneration: 1  phase: Ready  managedCluster:    name: cell1    uid: "b3f1..."        # compared at UID level on deletion    joined: true    available: true       # not trustworthy alone    leaseFresh: true      # the true liveness criterion  provider:    k3kVersion: v1.2.0    namespaceReady: true    k3kCRDsReady: true    controllerReady: true    cniReady: true    topolvmReady: true

VirtualNodeClass

Cluster-scoped quota tier: one name, one entitlement, one storage class.

FieldTypeRequiredNotes
entitlement.workloadHardmap[string]QuantityYesHard requests/limits applied as a ResourceQuota in the host namespace.
storageClassNamestringYesStorage class used for child data volumes and child PVCs (typically topolvm-provisioner).
virtualnodeclass-full.yaml
apiVersion: kubecell.io/v1alpha1kind: VirtualNodeClassmetadata:  name: ascend-910b-smallspec:  entitlement:    workloadHard:      requests.cpu: "4"      limits.cpu: "4"      requests.memory: 8Gi      limits.memory: 8Gi      requests.huawei.com/Ascend910: "2"      limits.huawei.com/Ascend910: "2"  storageClassName: topolvm-provisioner

VirtualClusterPlan

Side-effect-free preflight. The spec is isomorphic to a VirtualCluster so an accepted plan can be turned into a creation request without rewriting anything.

FieldTypeRequiredNotes
cellRef.namestringYesTarget Cell.
classRef.namestringYesTarget quota tier.
status.decisionenumAccepted | Rejected | Unknown. Evaluated once; never refreshed periodically.
status.expiresAttimeWhen the conclusion becomes void.
status.checks[]arrayPer-resource findings, including the reason for Rejected.

Not a reservation

Acceptance never reserves capacity. The controller re-runs the same evaluation at real creation time and blocks on a non-accepted conclusion, writing the report to VirtualCluster.status.feasibilityChecks.

VirtualCluster

The child cluster instance: key fields immutable, rich status.

spec

FieldTypeRequiredNotes
cellRef.namestringYesTarget Cell; immutable after creation.
classRef.namestringYesQuota tier; immutable after creation.

status (read-only)

FieldTypeRequiredNotes
observedGenerationint64Generation the status reflects.
phaseenumPending | Provisioning | Ready | Degraded | Deleting | Failed.
resolvedobjectImmutable resolution snapshot: the sole basis for steady-state rendering.
feasibilityChecks[]arrayRecheck report written at creation time.
endpoint{address,port}objectDiscovered child API address and NodePort.
credential.secretNamestringSecret containing the admin kubeconfig (kubeconfig.yaml key).
host.quotaUsedobjectQuota accounting observed on the host side.
conditions[][]ConditionStandard condition table.
virtualcluster-status.yaml
apiVersion: kubecell.io/v1alpha1kind: VirtualClustermetadata:  name: child-dev  namespace: kubecell-systemspec:  cellRef: {name: cell1}  classRef: {name: ascend-910b-small}status:  phase: Ready  endpoint:    address: 10.0.12.7    port: 31234  credential:    secretName: kubecell-child-dev-<uid>-admin-kubeconfig  host:    quotaUsed:      requests.cpu: "400m"      requests.huawei.com/Ascend910: "2"

Phases and conditions

PhaseMeaning
PendingAccepted, waiting for the controller to begin rendering.
ProvisioningWorks are being applied on the host; child cluster not yet Ready.
ReadyChild API reachable, kubeconfig published, quota and policy in place.
DegradedThe Cell lost liveness (stale lease) or a required inventory source is unavailable.
DeletingFinalizer cleanup in progress by UID.
FailedA terminal error that requires operator action; re-applying does not bypass it.
  • Joined / Available — OCM conditions. Available alone is not trustworthy.
  • ProviderReady — host baseline decomposed into K3k, CNI, and TopoLVM readiness.
  • InventoryFresh — inventory and storage observations are recent and from a live source.
  • CapabilityMismatch — declared device capacity exceeds observed allocatable.

See also: technical-design.md for the authoritative field-by-field design and validation rules.