Virtual Clusters in Kubernetes: A vcluster Deep Dive

Virtual Clusters in Kubernetes: A vcluster Deep Dive

How to give every team, pipeline or customer its own full Kubernetes cluster in seconds, without paying for a new set of machines each time: what a virtual cluster really is, how it works inside, and where its limits are.

Picture a large apartment building. The owner could give each family its own separate house with its own plot of land, garden, plumbing and power connection. That would give everyone total privacy, but it would cost a fortune and take months to build each house. Or the owner could simply let everyone share one big open hall and stick name tags on the furniture. That is cheap, but the families would constantly bump into each other, and nobody could repaint the walls. The sensible middle path is the apartment: each family gets its own front door, its own rooms and the freedom to arrange them any way they like, while the building’s foundations, pipes and wiring are shared. Virtual clusters bring this idea to Kubernetes. Each team gets what looks and behaves like its own complete cluster, while the real machines underneath are shared. This guide explains how it works, one step at a time.

1Why Teams Keep Wanting More Clusters

Sharing one cluster is cheap but cramped, and giving everyone their own is roomy but expensive.

Kubernetes was designed to run many applications on a shared pool of machines. In theory, one big cluster should be enough for an entire company. In practice, organisations end up with dozens or even hundreds of clusters, and the reasons are surprisingly consistent.

Reason 1

Teams need freedom

A team that wants to try a new operator, install its own custom resource definitions or test a different Kubernetes version cannot do so safely on a cluster shared with others.

Reason 2

Environments multiply

Every developer, every pull request and every test run would like a clean, throwaway environment. Creating a real cluster for each is slow and costly.

Reason 3

Customers need separation

Software vendors that run one environment per customer want strong boundaries between them, without running a full cluster for every small customer.

Reason 4

Blast radius worries

One careless change to a shared cluster can affect everyone. Smaller, separate clusters limit the damage of any single mistake.

The hidden bill of cluster sprawl

Every real cluster carries a fixed cost. It needs a control plane, which means several machines or a paid management fee. It needs monitoring, logging, ingress, certificates, security tools and upgrades. Someone must patch it, watch it and be on call for it. When there are fifty clusters, those fixed costs are paid fifty times, and most of the machines inside them sit mostly idle, because each cluster must be sized for its own peak demand.

Simple Analogy

A school with ten clubs could give each club its own building, with its own heating, caretaker and electricity bill. Almost every building would be empty most of the day. A better plan is one building with a separate, lockable room for each club, so that everyone has their own space but the heating and caretaker are shared.

Many
clusters often needed for freedom and separation
Fixed
cost every real cluster pays for its control plane and tooling
Shared
machines that virtual clusters reuse underneath
i
The Short Version

A virtual cluster gives a team its own Kubernetes API, with its own namespaces, permissions and custom resources, while its workloads quietly run on the machines of a real host cluster.

2Namespaces: The Built-In Sharing Tool and Its Limits

Namespaces are the first answer to sharing a cluster, and they stop short of what many teams need.

Kubernetes already has a way to divide a cluster: the namespace. A namespace is a named area inside a cluster. Objects such as Pods, Services and ConfigMaps live inside a namespace, and administrators can attach rules to it, such as quotas that limit total resource use, role-based access rules that say who may do what, and network policies that limit which Pods may talk to each other.

For many situations, namespaces are exactly right. A team gets a namespace, works freely inside it, and cannot easily disturb the neighbours. But namespaces have a built-in boundary. They only divide the objects that belong to a namespace. Many important things in Kubernetes belong to the whole cluster and cannot be divided.

Kind of thingDivided by namespace?Why it matters
Pods, Services, ConfigMaps, DeploymentsYesEach team has its own copies
Custom resource definitionsNo, cluster-wideTwo teams cannot install conflicting versions of the same definition
Cluster roles and bindingsNo, cluster-wideReal administrator rights cannot be safely handed out
Admission webhooksNo, cluster-wideOne team’s webhook can affect everyone, or break everyone
Namespaces themselvesNoA team cannot create its own namespaces without cluster-level rights
Kubernetes version and API featuresNoEveryone must use the same version

Where teams feel the pain

A platform team that wants to test a new version of an operator must install its custom definitions on the shared cluster, where they may clash with the production version. A developer who wants cluster administrator rights to experiment cannot be given them. A team that needs several namespaces to model a multi-part application has to ask an administrator each time. These are not rare edge cases. They are the daily friction that makes teams ask for their own clusters.

Simple Analogy

Namespaces are like marked tables in a shared canteen. Each group has its own table and cannot easily steal the others’ food, but everyone shares the same menu, the same kitchen and the same rules. A group that wants to serve a different menu or rebuild the kitchen simply cannot do so from its table.

!
Soft Boundaries

Namespaces are often called a soft multi-tenancy tool. They keep honest, cooperating teams tidy, but they are not designed to make strong guarantees against a determined misuse of cluster-wide features.

3Real Clusters: Strong Walls at a High Price

The other extreme gives the best separation and the highest cost.

The opposite approach is to give each team or customer a completely separate cluster. This provides the strongest separation, because nothing is shared. A team can be administrator of its own cluster, install anything, run any version and break anything without affecting others.

The costs, however, are heavy and multiply with each new cluster. Creating one takes minutes at best and much longer if approvals and networking changes are involved. Each cluster needs its own control plane, its own add-ons and its own upgrades. Idle capacity is wasted separately in each cluster. And people have to remember to delete clusters nobody uses anymore, which they often forget, so abandoned clusters keep costing money.

Separate real clusters: Advantages

  • Strongest isolation between teams
  • Complete freedom over versions, definitions and cluster-wide settings
  • Failures and mistakes stay contained
  • Simple mental model

Separate real clusters: Trade-offs

  • High fixed cost for each control plane and its tooling
  • Slow to create and to delete
  • Idle capacity is wasted many times over
  • Many clusters to patch, monitor and secure
  • Sprawl is easy to create and hard to clean up
Simple Analogy

Building a separate house for every family is the safest and the most private choice. It is also slow and costly, and every house needs its own plumbing and power connection to be maintained. Few cities build that way unless privacy is worth the price.

The gap in between

Namespaces are cheap and fast but too limited for teams that need real freedom. Real clusters give freedom but are too slow and costly to hand out to every developer and every test run. There is a clear gap between them, and that gap is exactly where virtual clusters sit. They aim to deliver most of the freedom of a real cluster at something close to the speed and cost of a namespace.

QuestionNamespaceReal cluster
Time to get oneSecondsMinutes to hours or days
Cost of one moreAlmost nothingHigh, fixed costs repeated
Own custom definitions and versionsNoYes
Administrator rights safely handed outNoYes
Operational burdenLowHigh
i
Right Tool, Right Job

Neither extreme is wrong. Namespaces suit simple sharing among trusting teams, and real clusters suit strict separation. Virtual clusters fill the large middle ground.

4What Is a Virtual Cluster?

A Kubernetes cluster that lives inside a namespace of another Kubernetes cluster.

A virtual cluster is a fully working Kubernetes control plane that runs as ordinary workloads inside a namespace of an existing cluster. The existing cluster is called the host cluster. The virtual cluster has its own API server, so a user can connect to it with the usual tools and see what looks like a normal cluster. They can create namespaces, install custom resource definitions, define cluster roles and even run as the administrator of their own cluster.

The trick is that the virtual cluster does not bring its own machines. When a user creates a Pod inside the virtual cluster, a helper copies a version of that Pod into the host namespace, where the host cluster’s scheduler places it on one of the real machines and the host’s container runtime starts it. The user sees the Pod running in their virtual cluster, and the host sees an ordinary Pod in an ordinary namespace.

Simple Analogy

Virtual machines let one physical server pretend to be many computers, each with its own operating system. A virtual cluster does the same one level up. One real cluster pretends to be many clusters, each with its own control plane and its own view of the world, while the heavy machinery of running containers is shared.

flowchart TD
    subgraph HOST["Host cluster with shared machines"]
        subgraph NSA["Namespace for virtual cluster A"]
            A1["Virtual cluster A control plane"]
            A2["Workload Pods of cluster A"]
        end
        subgraph NSB["Namespace for virtual cluster B"]
            B1["Virtual cluster B control plane"]
            B2["Workload Pods of cluster B"]
        end
        N["Real nodes, scheduler, network and storage"]
    end
    UA["Team A uses its own API"] --> A1
    UB["Team B uses its own API"] --> B1
    A2 --> N
    B2 --> N
        
FIG 1 — Each team talks to its own virtual control plane, while all Pods run on the shared host machines

The open source project

The best known implementation is an open source project called vcluster. It packages a virtual control plane, a component that copies resources to the host, and tooling to create, connect to and manage virtual clusters. It has been certified as a conformant Kubernetes distribution by the Cloud Native Computing Foundation, which means that applications written for standard Kubernetes should behave the same inside it. The project was created by the company Loft Labs and is developed in the open.

TermMeaning
Host clusterThe real cluster with real machines that runs everything
Virtual clusterA control plane and a set of synced resources living in a host namespace
SyncerThe component that copies chosen resources between virtual and host clusters
TenantThe team or customer using a virtual cluster
i
Two Views of One Pod

Every Pod in a virtual cluster exists twice: once in the virtual cluster, where the tenant sees it, and once in the host namespace, where the real work happens. Understanding this double life explains almost everything about how virtual clusters behave.

5Architecture: What Runs Inside the Namespace

A small group of Pods that together act as a complete cluster brain.

When a virtual cluster is created, the host namespace receives a small set of workloads that together form the virtual cluster’s brain. The details vary between versions and configurations, but the main pieces are always the same.

flowchart TD
    U["Tenant using kubectl"] --> API["Virtual API server"]
    API --> DS["Data store holding virtual objects"]
    API --> CM["Virtual controller manager"]
    CM --> API
    API --> SY["Syncer"]
    SY --> HAPI["Host cluster API server"]
    HAPI --> HS["Host scheduler and kubelets"]
    HS --> HP["Real Pods in the host namespace"]
    DNS["Virtual cluster DNS"] --> API
        
FIG 2 — The virtual control plane lives in the host namespace and uses the syncer to reach the host
Brain

Virtual API server

Receives all requests from the tenant. It speaks the normal Kubernetes API, so every standard tool works against it.

Memory

Data store

Holds all the objects of the virtual cluster, such as Deployments, namespaces, roles and custom resources. It is separate from the host’s own database.

Reconciler

Virtual controller manager

Runs the usual controllers that turn Deployments into ReplicaSets and ReplicaSets into Pods, but only inside the virtual cluster.

Bridge

Syncer

The component that copies Pods and other chosen resources into the host namespace, and brings status information back.

Names

Virtual DNS

A name service inside the virtual cluster, so that Services are found by the names tenants expect.

Missing

Nodes and scheduler

By default, there are no machines belonging to the virtual cluster. The host’s machines and scheduler do that job.

It is just a few Pods

The control plane of a virtual cluster is ordinary software running in ordinary Pods, usually as a small stateful workload. It needs modest resources, typically a fraction of a processor core and a few hundred megabytes of memory for a small cluster, though the amount grows with the number of objects and activity. That is why dozens of virtual clusters can share a host cluster that could never afford dozens of real control planes.

Simple Analogy

An apartment has its own front door, its own rooms and its own light switches. But the electricity comes from the building’s shared supply, and the water from the building’s shared pipes. The virtual control plane is the apartment’s door and switches, and the host machines are the shared supply.

i
Control Plane Is Separate From Workloads

The Pods that make up the control plane are separate from the Pods that tenants run. Tenants cannot see the control plane Pods from inside their virtual cluster, but the host administrator can see them in the host namespace.

6Control Plane Choices: Distributions and Data Stores

What kind of Kubernetes runs inside, and where it keeps its memory.

Distributions

The virtual API server and controllers do not have to be the same as the host’s. The project supports several Kubernetes distributions for the virtual control plane, including lightweight ones such as K3s and K0s, and upstream Kubernetes. A lightweight distribution uses less memory and starts faster. Upstream Kubernetes is closest to what runs in many production clusters and may suit teams that need exact behaviour. The default has changed between versions of the project, so check the current documentation.

ChoiceStrengthConsider when
Lightweight distributionSmall footprint and fast startMany short-lived or small virtual clusters
Upstream KubernetesClosest to standard production behaviourFaithful testing or longer-lived clusters

Data stores

The data store holds every object of the virtual cluster. Options range from a simple embedded database to an embedded copy of etcd, or an external database for stronger durability and scale. A simple embedded store is quick to set up and light on resources, and fits throwaway environments. An embedded or external etcd, or an external database, suits clusters that must survive failures or hold more data.

Option

Embedded simple database

Lightest and fastest to start. The data lives on a volume attached to the control plane Pod. Best for temporary environments.

Option

Embedded etcd

Familiar to Kubernetes operators and able to run in a group of several replicas for resilience.

Option

External database

Moves the data outside the cluster to a managed database, which can simplify backup and durability for longer-lived virtual clusters.

Simple Analogy

Choosing a data store is like choosing where to keep a notebook. A sticky note on the desk is quick and good for a one-day task. A locked filing cabinet is better for things you must keep for years. The right choice depends on how long and how carefully you need to remember.

Version independence

Because the virtual control plane is its own software, it can run a different Kubernetes version from the host, within the range that the project supports. This lets a platform team test an application against a newer or older version of Kubernetes without building a new real cluster. The workloads still run on the host’s nodes, so the node-level behaviour follows the host, even if the API behaviour follows the virtual control plane.

!
Version Skew Has Limits

A virtual control plane and the host’s kubelets still have to understand each other through the synced objects. Wide gaps between versions can cause surprises, so stay within the supported range.

7The Syncer: What Is Copied and What Stays Virtual

The syncer is the clever bridge that makes shared machines possible.

If the virtual cluster has no machines, something must connect it to the real ones. That something is the syncer. Its job is simple to describe. It watches the virtual cluster for objects that need real resources, mainly Pods, and creates matching objects in the host namespace. It also watches the host objects and copies status information back, so that a Pod shown as running in the virtual cluster really is running on the host.

Not everything is copied. The idea is to copy only what the host must see to run workloads, and to keep everything else purely virtual. Objects that exist only inside the virtual cluster cost the host almost nothing, because they are just rows in the virtual data store.

Kind of objectWhere it livesWhy
PodsVirtual cluster, and copied to the hostThe host must run the real containers
Services and endpointsVirtual cluster, and copied to the hostNetwork routing happens on the host
ConfigMaps and Secrets used by PodsVirtual cluster, and copied when a Pod needs themContainers on the host need to mount them
Persistent volume claimsVirtual cluster, and copied to the hostReal storage is provided by the host
IngressesOptionally copiedAllows the host’s ingress controller to serve them
Deployments, StatefulSets, JobsVirtual cluster onlyThey only create Pods, which are then synced
Namespaces, roles and bindingsVirtual cluster onlyThe host does not need to know about them
Custom resource definitions and resourcesVirtual cluster onlyTenants can install anything without touching the host
sequenceDiagram
    participant T as Tenant
    participant V as Virtual API server
    participant S as Syncer
    participant H as Host API server
    T->>V: Create a Deployment
    V->>V: Virtual controllers create Pods
    S->>V: Notice a new Pod
    S->>H: Create a matching Pod in the host namespace
    H->>H: Host schedules and starts the Pod
    S->>H: Watch the host Pod status
    S->>V: Copy status back to the virtual Pod
    T->>V: See the Pod running
        
FIG 3 — The syncer creates host objects from virtual ones and reports their status back
Simple Analogy

An office manager keeps a private list of every project and every plan. Only when a project needs a real meeting room does the manager book one on the building’s shared booking system. The shared system sees only the bookings, not the whole plan. The syncer is the manager making those bookings.

Why this keeps costs low

A Deployment with fifty replicas becomes fifty Pods on the host, but the Deployment itself, its ReplicaSets, the namespaces, the roles and any custom resources add nothing to the host’s own database. A tenant who installs a large operator with dozens of custom definitions does not burden the host API server at all, which matters when many virtual clusters share one host.

i
Configurable

Which resources are synced and in which direction is configurable. Teams can switch off syncing for objects they do not need, or turn on additional ones, such as copying real node information into the virtual cluster.

8The Life of a Pod in a Virtual Cluster

Following one Pod from creation to running, and seeing how its two lives connect.

1

The tenant creates a Deployment

The request goes to the virtual API server and is stored in the virtual data store. The host has not heard about it yet.

2

Virtual controllers create a Pod

The virtual controller manager turns the Deployment into a ReplicaSet and then into Pod objects, all inside the virtual cluster. These Pods are not yet assigned to a machine.

3

The syncer creates a host Pod

The syncer copies the Pod into the host namespace. To avoid clashes between names from different virtual namespaces, the host Pod gets a rewritten name that combines the original name, the virtual namespace and the virtual cluster name.

4

The host schedules and starts it

The host scheduler picks a node, the kubelet starts the containers, and normal host rules, such as quotas and policies for the namespace, apply.

5

Status flows back

The syncer reads the host Pod’s status and writes it to the virtual Pod, so the tenant sees it running, ready, or failing, exactly as in a normal cluster.

6

Deletion goes the other way

When the tenant deletes the Deployment, the virtual objects are removed, and the syncer deletes the matching host Pods. If the virtual cluster itself is deleted, everything in its host namespace can be cleaned up together.

Why name rewriting matters

Different virtual namespaces may contain Pods with identical names, yet all of them land in a single host namespace, where names must be unique. The syncer solves this by encoding the original namespace and virtual cluster name into each host Pod name. Administrators looking at the host see long, composite names, and a little practice is needed to read them. The same applies to other copied objects such as Services and ConfigMaps.

Simple Analogy

Several classes in a school may each have a student called Sam. When the school office keeps one big list, it writes “Sam from class 5B” to tell them apart. Composite names on the host are those labels.

!
Look in Both Places When Debugging

A Pod that will not start may have a problem in the virtual cluster, in the syncer or on the host. Checking only one view can leave you guessing. Experienced operators look at the virtual Pod, then the host Pod, then the syncer’s logs.

9Networking: DNS, Services and Ingress

How Pods in a virtual cluster find each other and the outside world.

Networking in a virtual cluster is deliberately simple. Pods run on the host, so they use the host’s network plugin and receive addresses from the host’s Pod ranges. They can talk to each other as usual. What changes is how names and Services are presented to the tenant.

flowchart LR
    P1["Pod in virtual namespace shop"] --> D["Virtual cluster DNS"]
    D --> VS["Virtual Service address"]
    VS --> HS["Synced Service in host namespace"]
    HS --> P2["Backend Pod on a host node"]
    I["External client"] --> IC["Ingress controller on the host"]
    IC --> HS
        
FIG 4 — Names are resolved inside the virtual cluster, and traffic is routed by the host network
Names

Virtual DNS

Each virtual cluster runs its own name service, so tenants resolve Service names such as they would in a normal cluster, with their own namespaces and domains.

Routing

Synced Services

A Service created in the virtual cluster is also created in the host namespace, so the host’s network components can route to the real Pods behind it.

Entry

Ingress

Ingress objects can be synced so that the host’s ingress controller serves them, or tenants can install their own ingress controller inside the virtual cluster.

Bridges

Cross-boundary access

Services can be mapped between the host and a virtual cluster, or between two virtual clusters, so that shared services such as a database or a message broker can be reached by name.

Isolation of traffic

By default, Pods from different virtual clusters live in different host namespaces and the host’s normal rules apply. If the host network plugin allows all traffic by default, Pods from different virtual clusters may be able to reach each other. To prevent this, administrators apply network policies to the host namespace, and some setups create them automatically as part of an isolation mode. Because enforcement is done by the host network plugin, a plugin with good policy support is important.

NeedHow it is handled
Tenant resolves Service namesVirtual DNS inside the virtual cluster
Traffic between Pods in one virtual clusterHost network, through synced Services
Block traffic between virtual clustersNetwork policies on host namespaces
Expose an app to the internetHost ingress controller or the tenant’s own
Share a service across clustersService mapping between clusters
Simple Analogy

Each apartment has its own internal phone book, so family members can call each other by nickname. The building’s switchboard routes real calls using building numbers. Visitors arrive through the building’s main entrance, unless the apartment has been given its own door to the street.

!
Do Not Assume Network Isolation

Having separate virtual clusters does not by itself separate the network. Without policies on the host, traffic between tenants may flow freely, so always plan the network rules deliberately.

10Storage in Virtual Clusters

Persistent data uses the host’s storage, presented through the tenant’s own claims.

When a tenant creates a persistent volume claim in a virtual cluster, the syncer creates a matching claim in the host namespace. The host’s storage provisioner then creates a real disk using the host’s storage classes. The tenant sees a bound claim and a volume in their cluster, and Pods mount it as usual.

1

Tenant creates a claim

The claim names a storage class that is visible in the virtual cluster, usually mirrored from the host.

2

Syncer creates the host claim

The matching claim appears in the host namespace with a rewritten name.

3

Host provisions the disk

The host’s storage driver creates the real volume, and the host claim becomes bound.

4

Status flows back

The virtual claim is shown as bound, and Pods in the virtual cluster can start using the volume.

What to keep in mind

The tenant can only use the storage classes that the host offers, and the host’s quotas on storage still apply. Features such as volume expansion and snapshots depend on the host’s storage driver and on whether the syncer passes the needed information through. The data is physically stored on the host, which has two consequences. Deleting the virtual cluster may delete the claims and, depending on the reclaim rules, the underlying disks. And host administrators can see the volumes in their storage system, which matters for privacy.

Advantages

  • No separate storage system to run per virtual cluster
  • Tenants use familiar claims and classes
  • Host quotas give a simple storage budget

Disadvantages / Trade-offs

  • Tenants cannot install their own storage drivers at the host level
  • Storage behaviour depends on the host’s driver
  • Cleanup rules need care to avoid orphaned or deleted data
Simple Analogy

Each apartment can ask for a storage unit in the basement. The building manager provides one from the shared basement and labels it with the apartment’s name. The family sees its own unit, but the basement belongs to the building.

i
Persistent Data Needs a Plan

For anything valuable, set the reclaim behaviour deliberately and keep backups, because removing a virtual cluster is much easier than recovering lost data.

11Nodes and Scheduling Options

Who decides where Pods run, and which machines they are allowed to use.

By default, a virtual cluster uses the machines of the host cluster. The tenant sees node objects in their virtual cluster, but these may be stand-ins that represent the host nodes in a simplified form, so that tools expecting to see nodes keep working. The host scheduler decides where Pods land, following the usual rules.

Default

Shared nodes

All virtual clusters use the same pool of host nodes. This gives the best utilisation and the lowest cost, but tenants share machines with neighbours.

Targeted

Dedicated node groups

Administrators can steer a virtual cluster’s Pods onto particular host nodes using labels and selectors, so that sensitive tenants do not share machines with others.

Visibility

Real node information

The syncer can show real node details inside the virtual cluster, which helps tools that need accurate node data, at the cost of exposing some host information.

Stronger

Private nodes

Newer versions of the project describe options where a virtual cluster has its own separate nodes joined to it, giving a stronger boundary for the data plane. Check the current documentation for what is available and in which edition.

ModelUtilisationIsolation of workloadsTypical use
Shared nodesHighestLowestDev, test, CI, trusted teams
Dedicated node groups on the hostMediumMediumTeams with compliance preferences
Private nodes per virtual clusterLowerHighest in this familyStricter tenants and sensitive workloads

Custom schedulers

Some virtual clusters run their own scheduler to apply custom placement rules inside the virtual cluster. This is useful when tenants need to test scheduler behaviour. In the common setup, though, the host scheduler does the work, which is simpler and ensures that the host sees consistent usage across all tenants.

Simple Analogy

Guests in a hotel may all share the same lifts and corridors, which is cheap and convenient. Some guests ask for a private floor, and a few want their own wing with separate stairs. The more separate the space, the higher the price.

!
Shared Kernel

Whenever Pods from different tenants share a node, they share one operating system kernel. A serious kernel flaw could cross the boundary, so separate nodes or stronger sandboxes are wise for untrusted tenants.

12The Isolation and Security Model

What a virtual cluster protects, what it does not, and how to strengthen it.

The most important thing to understand about virtual clusters is where the boundary lies. They isolate the control plane strongly and the data plane only as much as the host and the settings allow.

flowchart LR
    A["Shared namespace in one cluster"] --> B["Virtual cluster with shared nodes"]
    B --> C["Virtual cluster with hardened host settings"]
    C --> D["Virtual cluster with dedicated or private nodes"]
    D --> E["Separate real cluster"]
        
FIG 5 — A spectrum from lightest sharing to strongest separation, with virtual clusters spread across the middle
LayerIsolated by default?How to strengthen
API server, objects and custom definitionsYes, each virtual cluster has its ownAlready separate
Administrator rights inside the clusterYes, tenants can be administrators of their own cluster onlyControl who gets access to the virtual API
Admission webhooks and policiesYes, inside the virtual clusterAdd host-side policies for the namespace
Pods on shared nodesOnly as much as the host providesPod security rules, runtime sandboxes, dedicated nodes
NetworkNo, depends on host policiesNetwork policies on host namespaces
Resource consumptionNo, shared poolQuotas and limit ranges on the host namespace
KernelNo, shared on shared nodesSeparate nodes or sandboxed runtimes
Measure 1

Pod security rules

Apply host-side standards to the namespace so that tenants cannot run privileged containers or mount host paths, even if they are administrators inside their virtual cluster.

Measure 2

Isolation mode

The project offers a mode that applies sensible restrictions automatically, such as security settings, resource limits and network rules, on the host namespace.

Measure 3

Sandboxed runtimes

Choosing stronger container runtimes for tenant Pods adds an extra layer between workloads and the shared kernel.

Measure 4

Limited syncer rights

The syncer’s permissions on the host should be limited to its own namespace. That keeps a compromised virtual cluster from touching other parts of the host.

Simple Analogy

Each apartment has a strong front door and its own private lock on every room. But the walls between apartments, the shared pipes and the shared roof still belong to the building. For most families this is plenty. For a family that needs absolute secrecy, the owner adds soundproofing, or moves them to their own building.

!
The Host Admin Sees Everything

Whoever administers the host cluster can see all virtual clusters’ Pods, volumes and secrets that were synced to the host. Virtual clusters do not hide data from the host operator, and tenants should be told so.

13Resource Governance: Quotas, Limits and Fairness

Sharing machines only works if nobody can take more than their share.

Because all virtual clusters share the same machines, one busy tenant could take most of the processor and memory unless limits exist. The tool for this is the same one used for ordinary namespaces. Since every Pod of a virtual cluster lands in one host namespace, a quota on that namespace caps the total resources the entire virtual cluster can use, no matter how many namespaces the tenant creates inside it.

Cap

Resource quota

Limits the total processor, memory, storage and number of objects that the virtual cluster may consume on the host.

Defaults

Limit ranges

Sets default and maximum sizes for individual Pods, so a single container cannot request an absurd amount, and Pods that forget to declare requests receive sensible values.

Priority

Priority classes

Lets important workloads win over less important ones when the host runs short of room.

Count

Object counts

Limits on the number of Pods, Services or claims stop a tenant from flooding the host with objects.

The quota is the real budget

Tenants can create as many namespaces and as many objects as they like inside the virtual cluster, but the host quota is the real budget. When the tenant reaches it, new Pods fail to be created on the host, and the failure appears in the virtual cluster as Pods that cannot start. This can confuse tenants who see plenty of free capacity in their own view. Good documentation and clear error messages help.

ControlApplied whereWhat it prevents
Resource quota on the host namespaceHostA tenant using more than its share overall
Limit range on the host namespaceHostOversized or missing resource requests
Policies inside the virtual clusterVirtualMistakes within the tenant’s own teams
Priority classesHostImportant work being starved
Simple Analogy

A building’s electricity bill is shared. If one apartment runs a hundred heaters, everyone suffers. The building installs a limiter on each apartment’s supply, and the family can use as many sockets as they like inside, but never more power than the limiter allows.

i
Show Tenants Their Budget

Expose quota usage on a dashboard so tenants can see how close they are to the limit. Surprises at the quota edge cause many avoidable support requests.

14Access and Identity

Two sets of doors: one into the virtual cluster, and one into the host.

A user of a virtual cluster receives a kubeconfig, the connection file that tells tools where the virtual API server is and how to authenticate. Access can go through a temporary tunnel set up by the project’s command line tool, through a load balancer or ingress that exposes the virtual API server, or through a management platform that handles identity and sign-in centrally.

Door 1

Virtual cluster access

Controls who can use the tenant’s cluster. Inside, the tenant manages its own roles and bindings, creating users, service accounts and permissions as they wish.

Door 2

Host access

Controls who can see or change the virtual cluster’s control plane Pods and the synced objects in the host namespace. This belongs to the platform team, not to tenants.

Identity

Single sign-on

Virtual clusters can be configured to trust the organisation’s identity provider, so people sign in with the accounts they already have.

Automation

Service accounts for pipelines

CI systems typically receive short-lived credentials for the virtual cluster they create, so that access ends with the pipeline run.

WhoNeeds access toTypical rights
Tenant developerVirtual cluster onlyOften administrator inside their own cluster
Platform teamHost namespace and virtual clustersManage lifecycle, quotas and policies
Security teamHost policies and audit logsReview and enforce guardrails
CI pipelineThe virtual cluster it createdShort-lived administrator rights
Simple Analogy

A family has keys to its own apartment and can let guests in as it likes. The building manager holds the keys to the shared areas and a master key for emergencies. Neither set of keys opens everything, and each has its own rules.

!
Do Not Expose the API Carelessly

If a virtual cluster’s API server is reachable from the internet, protect it with strong authentication and network limits. An exposed administrator endpoint is an invitation for attackers.

15Creating, Connecting and Operating Virtual Clusters

The everyday life cycle, from request to retirement.

Creating a virtual cluster is quick, often taking seconds to a minute or two depending on image availability and the chosen configuration. It is typically done in one of three ways: with the project’s command line tool, by installing its packaged chart on the host with a package manager, or through a GitOps controller that applies a configuration file stored in a repository. A single configuration file describes the choices, such as the distribution, the data store, which resources to sync, resource limits and isolation settings.

flowchart TD
    A["Request a virtual cluster"] --> B["Create a host namespace with quotas and policies"]
    B --> C["Install the virtual control plane in that namespace"]
    C --> D["Wait until the virtual API server is ready"]
    D --> E["Issue credentials to the tenant"]
    E --> F["Tenant deploys workloads"]
    F --> G{"Still needed?"}
    G -->|Yes| H["Operate, monitor and upgrade"]
    G -->|No| I["Delete the virtual cluster and its host namespace"]
    H --> G
        
FIG 6 — The life cycle of a virtual cluster from request to deletion
1

Prepare the host namespace

Create the namespace and attach quotas, limit ranges, pod security rules and network policies before any workloads exist.

2

Install the virtual control plane

Apply the packaged installation with a configuration that matches the intended use.

3

Connect and verify

Obtain a connection file, check that the API responds, and run a simple test workload.

4

Hand over

Give the tenant credentials and documentation on quotas, supported features and support channels.

5

Operate and retire

Monitor, upgrade and, when the environment is no longer needed, delete it completely so costs stop.

Configuration as code

Because a virtual cluster is described by a configuration file and a few host objects, it fits naturally into version control. Teams keep these definitions in a repository and let a GitOps tool create, update and remove virtual clusters, with the same review process as any other infrastructure change. This also makes it easy to create identical copies for different teams.

i
Templates Save Time

Platform teams often define a small set of templates, such as small, standard and hardened, so that tenants choose from tested options instead of inventing their own settings.

Simple Analogy

A hotel does not build each room from scratch for every guest. It has a few room types with standard furniture, ready to be prepared quickly, and cleaned and returned to stock when the guest leaves.

16Cost Control: Sleep Mode, Expiry and Cleanup

The cheapest virtual cluster is the one that is switched off when nobody is using it.

Because virtual clusters are quick to create, it becomes tempting to create many, and because they are easy to forget, many accumulate. Several habits and features keep costs under control.

Pause

Sleep mode

An idle virtual cluster can be put to sleep by scaling its workloads and control plane down to nothing, then woken when someone needs it again. The project’s management platform offers automatic sleeping and waking, so check which edition provides it.

Expire

Time to live

Ephemeral environments, such as those for pull requests, are given an expiry so they delete themselves after a set time, whether or not anyone remembers.

Label

Ownership labels

Every virtual cluster carries labels naming its owner, team and purpose, so costs can be attributed and abandoned clusters can be traced.

Report

Usage reports

Regular reports of usage by team show where money goes and encourage cleaning up.

PracticeSaves money byBest for
Sleep when idleFreeing compute outside working hoursDeveloper and demo environments
Automatic expiryDeleting forgotten environmentsCI and preview environments
QuotasCapping what any one environment can useAll tenants
Ownership labels and reportsMaking waste visibleLarge organisations
Simple Analogy

A well-run hotel switches off the lights and heating in empty rooms, and checks out guests whose booking has ended. A virtual cluster that sleeps when idle and expires when finished does the same job for compute.

!
Cheap Is Not Free

A virtual cluster costs little, but a hundred forgotten ones can add up, especially if each holds persistent volumes. Treat cleanup as part of the design, not an afterthought.

17Upgrades, Backup and Recovery

Virtual clusters are light, but the ones that matter still deserve protection.

For throwaway environments, the best recovery plan is simply to delete the cluster and create a new one from its definition. For longer-lived virtual clusters that hold real work, there are two kinds of state to protect: the contents of the virtual data store, which describe every virtual object, and any persistent volumes holding application data.

1

Keep the definition in version control

The configuration used to create the virtual cluster should be stored, so a replacement can be built quickly.

2

Back up the virtual data store

Take regular copies of the data store, or use the project’s snapshot capabilities where available, so that virtual objects can be restored.

3

Back up application data

Use volume snapshots or application-level backups for databases and other persistent data.

4

Rehearse a restore

Test rebuilding a virtual cluster from backups in a spare namespace, so the procedure is known and trusted.

Upgrading

A virtual cluster has two things to upgrade: the project’s own components, such as the syncer, and the Kubernetes version of its control plane. They can be upgraded separately and independently of the host cluster. The usual approach is to test on a copy first, take a backup, upgrade one step at a time and verify that workloads behave properly. Because virtual clusters are cheap, creating a test copy of a production virtual cluster for upgrade rehearsal is practical in a way that is expensive with real clusters.

Advantages

  • Upgrades are independent of the host cluster
  • Cheap test copies make rehearsal easy
  • Replacing a broken virtual cluster is fast

Disadvantages / Trade-offs

  • Two layers to upgrade and keep compatible
  • Backups of the virtual data store are an extra task
  • Host upgrades can still affect all virtual clusters at once
Simple Analogy

A tenant can redecorate an apartment without asking the building to repaint the hallway. But if the building’s roof is being repaired, every apartment is affected. Virtual clusters can be upgraded on their own schedule, yet they still depend on the host’s health.

!
Deleting the Namespace Deletes Everything

Removing the host namespace removes the virtual control plane and its synced objects. Protect namespaces of important virtual clusters from accidental deletion with permissions and review.

18Observability and Troubleshooting

Two layers to look at, and a calm order in which to look at them.

Because every workload has a virtual view and a host view, monitoring needs to cover both. Host metrics, grouped by namespace, show how much each virtual cluster really uses. The virtual cluster’s own components, such as the API server and syncer, produce logs and metrics that show its health. Tenants see their own metrics, for example through a metrics server inside the virtual cluster, while platform teams watch the host.

SignalWhere to lookWhat it tells you
Control plane Pod healthHost namespaceWhether the virtual cluster is up
Syncer logs and errorsHost namespaceProblems copying objects to or from the host
Resource use per namespaceHost metricsHow close a virtual cluster is to its quota
API server latency and errorsVirtual control plane metricsLoad or health issues in the virtual cluster
Pod eventsVirtual and host viewsWhy a workload did not start
Data store sizeControl plane volumeRisk of running out of room for virtual objects

A calm troubleshooting routine

1

Check the virtual view

Look at the Pod’s status and events inside the virtual cluster. Often the message already explains the cause.

2

Find the host Pod

Locate the copy in the host namespace, using its rewritten name, and read its events.

3

Check quotas and policies

See whether the host quota, limit ranges or security rules rejected the Pod.

4

Read the syncer logs

Look for errors about copying or permissions between the two clusters.

5

Check the control plane

Confirm that the virtual API server and data store are healthy and have enough resources.

Simple Analogy

If a family in an apartment reports that the heating has stopped, a good caretaker first asks the family what they see, then checks the building’s boiler and pipes. Looking at both the apartment and the building avoids chasing the wrong problem.

i
Teach Tenants the Two Views

A short guide explaining that Pods exist in both places, and how quotas work, saves many support tickets and makes tenants more self-sufficient.

19Common Patterns and Use Cases

Where virtual clusters earn their place.

Ephemeral CI environments

A pipeline creates a fresh virtual cluster for each pull request, deploys the application and its dependencies, runs tests and deletes the cluster afterwards. Every run starts clean, with no leftovers from earlier runs, and the cost is a small fraction of creating real clusters.

Per-developer sandboxes

Each developer receives their own virtual cluster where they have full administrator rights, can install operators and break things without fear. When they are finished, or on holiday, the sandbox sleeps or is deleted.

Testing operators and custom definitions

Teams building operators need to install and remove custom definitions repeatedly. In a virtual cluster, they can do this freely without risking a shared cluster.

Testing across Kubernetes versions

Because the virtual control plane can run a different version from the host, a team can try the same application against several versions without building several real clusters.

Multi-tenant platforms for internal teams

A platform team runs a few large, well-managed host clusters and offers each product team its own virtual cluster, giving freedom to teams and control to the platform.

Software vendors with one environment per customer

Providers that deploy a full stack for each customer can use virtual clusters for stronger separation than namespaces give, at a much lower cost than a real cluster per customer, adding dedicated nodes or other hardening for customers with stricter needs.

Training and workshops

Instructors create dozens of identical, isolated clusters for a class in minutes, and delete them when the session ends.

flowchart LR
    PR["Pull request opened"] --> VC["Pipeline creates a virtual cluster"]
    VC --> DEP["Deploy the application and dependencies"]
    DEP --> TEST["Run integration tests"]
    TEST --> RES["Report results"]
    RES --> DEL["Delete the virtual cluster"]
        
FIG 7 — A typical CI flow: a clean cluster for every change, deleted when the tests finish
i
Start With CI and Development

Most teams begin with throwaway environments, where mistakes are cheap and benefits are clear. They expand to longer-lived and more sensitive uses once the team understands the isolation model.

20Best Practices

A checklist that experienced platform teams follow.

Practice 1

Prepare the host namespace first

Apply quotas, limit ranges, pod security rules and network policies before tenants arrive.

Practice 2

Match isolation to trust

Use shared nodes for trusted teams, and dedicated or private nodes and sandboxes for stricter tenants.

Practice 3

Use templates

Offer a few tested configurations instead of free-form choices.

Practice 4

Manage definitions as code

Keep configurations in version control and let a GitOps tool apply them.

Practice 5

Label, expire and sleep

Give every virtual cluster an owner and an expiry, and sleep the idle ones.

Practice 6

Limit the syncer’s reach

Keep the syncer’s host permissions to its own namespace.

Practice 7

Protect what matters

Back up data stores and volumes of long-lived virtual clusters, and rehearse restores.

Practice 8

Document the two views

Teach tenants about quotas, name rewriting and what the host administrator can see.

A checklist before giving a virtual cluster to a team

1

Decide the trust level

Is the tenant a trusted internal team or an outside customer? This decides the isolation settings.

2

Set the budget

Choose quotas for processor, memory, storage and object counts.

3

Apply guardrails on the host

Add security standards and network rules to the namespace.

4

Plan the lifetime

Set an expiry, an owner and a sleep policy.

5

Hand over with documentation

Explain access, limits, support and what is and is not supported.

21Common Mistakes and Anti-patterns

Five habits that regularly cause trouble.

ANTI-PATTERN-01 Avoid
Problem

Treating virtual clusters as equal to separate real clusters for hostile or untrusted tenants, with no extra hardening.

Why It’s Harmful

On shared nodes, tenants share a kernel and often a network. A determined attacker may find ways across the boundary, and the host administrator can see everything.

Correct Approach

Match isolation to trust. Use dedicated or private nodes, sandboxed runtimes, strict host policies and network rules for untrusted tenants, or use separate real clusters.

ANTI-PATTERN-02 Avoid
Problem

Creating virtual clusters without quotas or limit ranges on the host namespace.

Why It’s Harmful

A single tenant can consume the shared nodes and starve everyone else, because the tenant’s own cluster has no idea about the host’s limits.

Correct Approach

Attach quotas and limit ranges to every host namespace before handing it over, and show tenants their usage.

ANTI-PATTERN-03 Avoid
Problem

Letting ephemeral virtual clusters live forever, with no expiry, owner label or cleanup.

Why It’s Harmful

Forgotten environments keep using compute and holding volumes. Over months the bill grows, and nobody knows which ones are safe to delete.

Correct Approach

Give every virtual cluster an owner and expiry, sleep idle ones and report usage by team.

ANTI-PATTERN-04 Avoid
Problem

Running long-lived, valuable workloads in a virtual cluster using the lightest embedded data store, with no backups.

Why It’s Harmful

Losing the control plane volume, or the namespace, can lose the description of every virtual object, and recovery without backups is slow or impossible.

Correct Approach

Choose a more durable data store, back it up, back up application data and rehearse restores.

ANTI-PATTERN-05 Avoid
Problem

Expecting everything to behave exactly like a real cluster, including node-level features, host-level storage drivers and cluster-wide network plugins.

Why It’s Harmful

Features that live on the host cannot be changed from inside the virtual cluster. Tenants may waste time trying to install a network plugin or a storage driver that will never take effect.

Correct Approach

Document what the host provides, and tell tenants clearly which features are theirs to change and which belong to the host.

SymptomLikely causeFirst check
Pods in the virtual cluster stay pending with no nodeHost quota reached or scheduling constraintsHost Pod events and quota usage
Objects exist virtually but not on the hostResource type not syncedSync settings in the configuration
Tenants reach other tenants’ PodsNo host network policiesPolicies on host namespaces
Virtual API server is slowControl plane is starved or data store is largeControl plane resource use
Storage claims never bindHost storage class or driver issueHost claim events

22Advantages, Disadvantages and Trade-offs

A balanced view before you decide.

Advantages

  • Tenants get their own API, namespaces, custom definitions and administrator rights
  • Creation takes seconds to minutes, instead of the long wait for real clusters
  • Much lower cost, because control planes are small and machines are shared
  • Tenants can test different Kubernetes versions on the same hosts
  • A failure or mistake inside a virtual cluster rarely affects the others
  • Fits GitOps and self-service platform models well

Disadvantages / Trade-offs

  • Data plane isolation is weaker than separate clusters unless hardened
  • Host-level features such as the network plugin and storage drivers cannot be changed by tenants
  • Two layers to understand, monitor, upgrade and debug
  • The host administrator can see all synced data
  • The host is a shared failure domain for every virtual cluster on it
  • Some advanced features may belong to commercial editions

How it compares with the alternatives

ApproachIsolationCostSpeed to createTenant freedom
Plain namespacesLightLowestSecondsLimited, no custom definitions or admin rights
Namespaces with extra multi-tenancy toolingLight to mediumLowSecondsSomewhat more, still bound by cluster-wide limits
Virtual clustersMedium, stronger with hardeningLowSeconds to minutesHigh, own API and administrator rights
Separate real clustersStrongestHighestMinutes to daysComplete

Virtual clusters are not a replacement for every other approach. They are a very good fit when teams need freedom and a clean environment more than they need hard hardware boundaries. When regulations or threat models demand physical separation, real clusters, or virtual clusters with private nodes, remain the right answer. Many organisations use all of these side by side, choosing the lightest tool that satisfies each team’s real needs.

“A virtual cluster gives a team the feeling of owning a cluster and the bill of renting a room.”

23Real-World and Industry Examples

How organisations use virtual clusters in practice.

Platform engineering teams

Central teams run a small number of well-governed host clusters and give each product team a virtual cluster through a self-service portal. Teams enjoy freedom to install what they need, and the platform keeps control over quotas, security and cost.

Continuous integration at scale

Organisations with many daily pull requests replace long-lived shared test clusters with short-lived virtual ones. Tests become more reliable because there is no leftover state, and costs fall because the environments disappear after each run.

Open source and vendor testing

Projects that provide operators or add-ons use virtual clusters to test against several Kubernetes versions and configurations, quickly and cheaply, in their own pipelines.

Software as a service with per-customer stacks

Vendors that give each customer an isolated deployment use virtual clusters to improve separation over namespaces, adding dedicated nodes or stricter policies for larger or regulated customers.

Machine learning and data teams

Teams sharing expensive accelerator machines give each researcher a virtual cluster and use sleep and expiry rules to return the scarce hardware to the pool when experiments finish.

Education and certification

Training providers and internal academies create a clean cluster per learner for the length of a course, without managing hundreds of real clusters.

i
Common Thread

Teams that succeed treat virtual clusters as a product with defaults, guardrails and a short life, instead of as a loose collection of experiments.

24Frequently Asked Questions

Short answers to the questions beginners ask most often.

Q1Is a virtual cluster a real Kubernetes cluster?

It has a real Kubernetes API server and controllers, and the project is certified as conformant, so standard tools and applications work. What it lacks by default is its own machines, which it borrows from the host cluster.

Q2Where do my Pods actually run?

On the nodes of the host cluster. The syncer creates a matching Pod in a host namespace, and the host scheduler and kubelet run it.

Q3Can tenants install their own custom resource definitions?

Yes. Definitions and custom resources live in the virtual cluster’s own data store, so they do not clash with those of other tenants or the host.

Q4Is a virtual cluster as secure as a separate cluster?

Not by default. The control plane is separate, but workloads share the host’s nodes, kernel and often network. Stronger isolation needs host policies, dedicated or private nodes, or sandboxed runtimes.

Q5Can a virtual cluster run a different Kubernetes version from the host?

Yes, within the range the project supports. The virtual control plane has its own version, though node behaviour still follows the host.

Q6How are resources limited?

With quotas and limit ranges on the host namespace. The quota caps the total usage of the whole virtual cluster, however many namespaces the tenant creates inside it.

Q7Can the host administrator see what runs inside?

Yes, for everything that is synced to the host, such as Pods, Services, claims and the secrets that Pods use. Virtual clusters do not hide workloads from the host operator.

Q8How long does it take to create one?

Typically seconds to a couple of minutes, depending on the configuration and whether container images are already available on the host. This is far quicker than provisioning a real cluster.

Q9What happens when I delete a virtual cluster?

Its control plane and synced objects are removed from the host namespace. Persistent volumes may or may not be deleted, depending on the reclaim rules, so check them before deleting anything that holds important data.

Q10Should I use virtual clusters instead of namespaces?

Use namespaces when simple sharing among trusting teams is enough. Choose virtual clusters when teams need their own API, custom definitions, administrator rights or clean environments, and the stronger separation of real clusters is not required.

25Summary and Key Takeaways

Namespaces are cheap but cramped, and real clusters are roomy but costly. Virtual clusters sit between them. Each one is a small Kubernetes control plane running in a namespace of a host cluster, with its own API server, data store, namespaces, roles and custom definitions. A syncer copies only what the host needs to run workloads, mainly Pods, Services and claims, so the real machines, network and storage are shared. This gives teams the freedom of their own cluster in seconds and at a fraction of the cost, and makes ephemeral environments, developer sandboxes, operator testing and tenant platforms practical. The trade-off is that isolation of the data plane is only as strong as the host and its settings, so quotas, security policies, network rules, dedicated nodes and a clear understanding of what the host administrator can see are essential. Used with those guardrails, virtual clusters turn cluster creation from a project into a routine.

Key Takeaways

  • A virtual cluster is a control plane in a namespace — it has its own API server and data store, runs as ordinary Pods on a host cluster and is conformant, so standard tools work against it.
  • The syncer is the bridge — it copies Pods, Services, claims and other needed objects to the host and brings status back, while Deployments, roles and custom resources stay purely virtual.
  • Machines, network and storage are shared — Pods run on host nodes and use the host’s network plugin and storage drivers, which is what keeps costs low.
  • Control plane isolation is strong, data plane isolation depends on you — add pod security rules, network policies, dedicated or private nodes and sandboxed runtimes as the tenant’s trust level requires.
  • Quotas on the host namespace are the real budget — they cap total usage for the whole virtual cluster, and tenants should be able to see them.
  • Treat them as short-lived products — use templates, ownership labels, expiry and sleep modes, and keep definitions in version control.
  • Protect what matters and know the limits — back up data stores and volumes for long-lived clusters, remember the host admin can see synced data, and choose real clusters when hard separation is required.