Skip to content
Skip to Content
How it works

Pool lifecycle

Every virtual cluster in a pool is represented by a ClusterInstance. The operator reconciles each instance continuously and drives its transitions automatically.

Phases

Creating -> Ready -> Leased -> Recycling -> [destroyed]
                            \-> Quarantined
                                                 |
                                                 v
                                          [replacement: Creating]

Creating

The operator has issued the backend command to create the instance (for example a k3s StatefulSet, a vcluster Helm release, or a CAPI cluster). The instance is not yet available for leases. It stays in this phase until:

  • The Kubernetes control plane is reachable
  • All addons have been installed
  • All readinessGates in the pool spec are satisfied

Instances that stay in Creating too long are recycled automatically.

Ready

The instance is warm and waiting in the pool. It passes health checks and can be leased immediately. The pool manager targets the configured warm capacity using either fixed size or autoscaling minReady.

Leased

A ClusterLease is bound to this instance. The lease includes a TTL, and the operator enforces expiry server-side regardless of client activity.

Callers can extend a lease up to maxExtensions times (default: 2) using kobe extend or PATCH /v1/leases/:id.

Recycling

The lease has been released or expired. The operator destroys the instance and immediately creates a replacement. The replacement enters Creating and works through the readiness pipeline before becoming Ready again.

Quarantined

Verified cleanup could not prove that every exact resource is absent. The instance remains unavailable and still counts against pool capacity. The pool phase reads Quarantined where it would otherwise read Healthy or Idle; Failing, Backoff, ScalingUp and ScalingDown still show through, with the count in status.quarantined. Operators should inspect the ClusterInstance and ClusterLease receipt before retrying cleanup. There is no timeout. If the evidence can never arrive, an operator can release the object by hand; see Troubleshooting.

ClusterLease.spec.cleanupMode is write-once. Standard is the default. VerifiedDestroy requires an immutable creation manifest, exact Kubernetes UIDs and connect-token deletion evidence. It is currently eligible only for k3s instances using embedded SQLite; unsupported backends or external PostgreSQL are rejected before binding rather than silently downgraded.

Pool status

The operator reports aggregate counts on the ClusterPool status:

status:
  phase: Healthy
  ready: 2      # clusters in Ready phase
  leased: 1     # clusters in Leased phase
  creating: 1   # clusters in Creating phase
  recycling: 0  # clusters being torn down and replaced
  unhealthy: 0  # clusters marked unhealthy
  quarantined: 0 # cleanup could not be proven; still consumes capacity
  queueDepth: 0 # leases waiting for capacity

status.phase summarizes the pool. The first matching phase wins:

PhaseMeaning
FailingThree or more provision failures in a row, or the pool sets fields its backend ignores (ConfigSupported=False, see Unsupported fields). Needs an operator.
BackoffA provision failed; the pool is waiting before it retries.
IdleScale-to-zero pool with nothing in it.
ScalingDownAbove the warm target and recycling idle clusters.
HealthyAt or above the warm target. Leased clusters alone do not count: a pool with nothing Ready and leases queued is not healthy.
ExhaustedNothing Ready or Creating, leases queued, and every slot up to the ceiling (maxClusters, or size plus 10 for a fixed pool) is leased or recycling. The queue moves when a lease ends. Raise maxClusters if this is common.
ScalingUpBelow the warm target, or leases are queued with nothing Ready. The pool is creating clusters or waiting for room to create one.

Quarantined replaces Healthy or Idle while any member is quarantined. Quarantined members never make a pool Exhausted: they free nothing when a lease ends, so a pool held by them keeps ScalingUp and shows the count in quarantined.

These counts are also visible via the API:

kobe status                   # endpoint + per-pool summary
curl https://.../v1/pools     # all pools
curl https://.../v1/pools/x   # one pool

Queueing

A lease that arrives with no Ready cluster free is queued (status.phase: Pending, status.queuePosition set) instead of rejected. Every pool — fixed size or scaling — has a queue timeout, so a lease whose caller is gone (cancelled CI job, closed laptop) does not hold its place forever and block leases behind it: spec.queueTimeout for a fixed-size pool, spec.scaling.queueTimeout for an autoscaled one. Both default to 5m. A timed-out lease moves to status.phase: Expired.

Health checks

When healthCheck is configured on a pool, the operator periodically probes each Ready cluster. A cluster that fails the health check is moved directly to Recycling — it is destroyed and replaced without being offered for new claims.

spec:
  healthCheck:
    intervalSeconds: 30
    failureThreshold: 3

Autoscaling

When scaling is set on a pool, the operator adjusts the number of warm instances based on demand instead of holding a fixed size. The pool grows when leases arrive faster than clusters can be created, and shrinks back down during quiet periods. Spec-hash drift (operator bump, pool edit, bootstrap change) is recycled under upgrade policy.

spec:
  scaling:
    minReady: 1
    maxClusters: 10
    scaleDownAfter: 5m
    queueTimeout: 5m

The pool creates clusters whenever ready + creating is below minReady plus the number of queued leases, up to maxClusters. scaleUpThreshold is reserved and has no effect; it is accepted so existing manifests stay valid.

A pool without scaling keeps size clusters warm and may hold up to size + 10 clusters in total, counting leased, creating and recycling ones, so it can refill while clusters are leased. It never scales down. Set scaling.maxClusters if you need a precise ceiling.

Velero snapshots

When snapshot is configured, the operator maintains a Velero backup of a golden cluster and restores new pool members from it. This skips the addon installation phase, reducing Creating time from minutes to seconds for complex addon stacks. See Golden images for setup details.

This path is not validated: see Golden images.

Available for:
Apple macOS logomacOSMicrosoft Windows logoWindowsLinux logoLinux
Download Kunobi