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.
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.
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.
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.
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.
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.
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 thing | Divided by namespace? | Why it matters |
|---|---|---|
| Pods, Services, ConfigMaps, Deployments | Yes | Each team has its own copies |
| Custom resource definitions | No, cluster-wide | Two teams cannot install conflicting versions of the same definition |
| Cluster roles and bindings | No, cluster-wide | Real administrator rights cannot be safely handed out |
| Admission webhooks | No, cluster-wide | One team’s webhook can affect everyone, or break everyone |
| Namespaces themselves | No | A team cannot create its own namespaces without cluster-level rights |
| Kubernetes version and API features | No | Everyone 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.
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.
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
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.
| Question | Namespace | Real cluster |
|---|---|---|
| Time to get one | Seconds | Minutes to hours or days |
| Cost of one more | Almost nothing | High, fixed costs repeated |
| Own custom definitions and versions | No | Yes |
| Administrator rights safely handed out | No | Yes |
| Operational burden | Low | High |
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.
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
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.
| Term | Meaning |
|---|---|
| Host cluster | The real cluster with real machines that runs everything |
| Virtual cluster | A control plane and a set of synced resources living in a host namespace |
| Syncer | The component that copies chosen resources between virtual and host clusters |
| Tenant | The team or customer using a virtual cluster |
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
Virtual API server
Receives all requests from the tenant. It speaks the normal Kubernetes API, so every standard tool works against it.
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.
Virtual controller manager
Runs the usual controllers that turn Deployments into ReplicaSets and ReplicaSets into Pods, but only inside the virtual cluster.
Syncer
The component that copies Pods and other chosen resources into the host namespace, and brings status information back.
Virtual DNS
A name service inside the virtual cluster, so that Services are found by the names tenants expect.
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.
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.
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.
| Choice | Strength | Consider when |
|---|---|---|
| Lightweight distribution | Small footprint and fast start | Many short-lived or small virtual clusters |
| Upstream Kubernetes | Closest to standard production behaviour | Faithful 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.
Embedded simple database
Lightest and fastest to start. The data lives on a volume attached to the control plane Pod. Best for temporary environments.
Embedded etcd
Familiar to Kubernetes operators and able to run in a group of several replicas for resilience.
External database
Moves the data outside the cluster to a managed database, which can simplify backup and durability for longer-lived virtual clusters.
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.
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 object | Where it lives | Why |
|---|---|---|
| Pods | Virtual cluster, and copied to the host | The host must run the real containers |
| Services and endpoints | Virtual cluster, and copied to the host | Network routing happens on the host |
| ConfigMaps and Secrets used by Pods | Virtual cluster, and copied when a Pod needs them | Containers on the host need to mount them |
| Persistent volume claims | Virtual cluster, and copied to the host | Real storage is provided by the host |
| Ingresses | Optionally copied | Allows the host’s ingress controller to serve them |
| Deployments, StatefulSets, Jobs | Virtual cluster only | They only create Pods, which are then synced |
| Namespaces, roles and bindings | Virtual cluster only | The host does not need to know about them |
| Custom resource definitions and resources | Virtual cluster only | Tenants 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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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.
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.
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.
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.
| Need | How it is handled |
|---|---|
| Tenant resolves Service names | Virtual DNS inside the virtual cluster |
| Traffic between Pods in one virtual cluster | Host network, through synced Services |
| Block traffic between virtual clusters | Network policies on host namespaces |
| Expose an app to the internet | Host ingress controller or the tenant’s own |
| Share a service across clusters | Service mapping between clusters |
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.
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.
Tenant creates a claim
The claim names a storage class that is visible in the virtual cluster, usually mirrored from the host.
Syncer creates the host claim
The matching claim appears in the host namespace with a rewritten name.
Host provisions the disk
The host’s storage driver creates the real volume, and the host claim becomes bound.
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
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.
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.
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.
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.
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.
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.
| Model | Utilisation | Isolation of workloads | Typical use |
|---|---|---|---|
| Shared nodes | Highest | Lowest | Dev, test, CI, trusted teams |
| Dedicated node groups on the host | Medium | Medium | Teams with compliance preferences |
| Private nodes per virtual cluster | Lower | Highest in this family | Stricter 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.
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.
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"]
| Layer | Isolated by default? | How to strengthen |
|---|---|---|
| API server, objects and custom definitions | Yes, each virtual cluster has its own | Already separate |
| Administrator rights inside the cluster | Yes, tenants can be administrators of their own cluster only | Control who gets access to the virtual API |
| Admission webhooks and policies | Yes, inside the virtual cluster | Add host-side policies for the namespace |
| Pods on shared nodes | Only as much as the host provides | Pod security rules, runtime sandboxes, dedicated nodes |
| Network | No, depends on host policies | Network policies on host namespaces |
| Resource consumption | No, shared pool | Quotas and limit ranges on the host namespace |
| Kernel | No, shared on shared nodes | Separate nodes or sandboxed runtimes |
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.
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.
Sandboxed runtimes
Choosing stronger container runtimes for tenant Pods adds an extra layer between workloads and the shared kernel.
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.
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.
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.
Resource quota
Limits the total processor, memory, storage and number of objects that the virtual cluster may consume on the host.
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 classes
Lets important workloads win over less important ones when the host runs short of room.
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.
| Control | Applied where | What it prevents |
|---|---|---|
| Resource quota on the host namespace | Host | A tenant using more than its share overall |
| Limit range on the host namespace | Host | Oversized or missing resource requests |
| Policies inside the virtual cluster | Virtual | Mistakes within the tenant’s own teams |
| Priority classes | Host | Important work being starved |
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.
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.
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.
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.
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.
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.
| Who | Needs access to | Typical rights |
|---|---|---|
| Tenant developer | Virtual cluster only | Often administrator inside their own cluster |
| Platform team | Host namespace and virtual clusters | Manage lifecycle, quotas and policies |
| Security team | Host policies and audit logs | Review and enforce guardrails |
| CI pipeline | The virtual cluster it created | Short-lived administrator rights |
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.
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
Prepare the host namespace
Create the namespace and attach quotas, limit ranges, pod security rules and network policies before any workloads exist.
Install the virtual control plane
Apply the packaged installation with a configuration that matches the intended use.
Connect and verify
Obtain a connection file, check that the API responds, and run a simple test workload.
Hand over
Give the tenant credentials and documentation on quotas, supported features and support channels.
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.
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.
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.
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.
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.
Ownership labels
Every virtual cluster carries labels naming its owner, team and purpose, so costs can be attributed and abandoned clusters can be traced.
Usage reports
Regular reports of usage by team show where money goes and encourage cleaning up.
| Practice | Saves money by | Best for |
|---|---|---|
| Sleep when idle | Freeing compute outside working hours | Developer and demo environments |
| Automatic expiry | Deleting forgotten environments | CI and preview environments |
| Quotas | Capping what any one environment can use | All tenants |
| Ownership labels and reports | Making waste visible | Large organisations |
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.
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.
Keep the definition in version control
The configuration used to create the virtual cluster should be stored, so a replacement can be built quickly.
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.
Back up application data
Use volume snapshots or application-level backups for databases and other persistent data.
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
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.
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.
| Signal | Where to look | What it tells you |
|---|---|---|
| Control plane Pod health | Host namespace | Whether the virtual cluster is up |
| Syncer logs and errors | Host namespace | Problems copying objects to or from the host |
| Resource use per namespace | Host metrics | How close a virtual cluster is to its quota |
| API server latency and errors | Virtual control plane metrics | Load or health issues in the virtual cluster |
| Pod events | Virtual and host views | Why a workload did not start |
| Data store size | Control plane volume | Risk of running out of room for virtual objects |
A calm troubleshooting routine
Check the virtual view
Look at the Pod’s status and events inside the virtual cluster. Often the message already explains the cause.
Find the host Pod
Locate the copy in the host namespace, using its rewritten name, and read its events.
Check quotas and policies
See whether the host quota, limit ranges or security rules rejected the Pod.
Read the syncer logs
Look for errors about copying or permissions between the two clusters.
Check the control plane
Confirm that the virtual API server and data store are healthy and have enough resources.
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.
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"]
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.
Prepare the host namespace first
Apply quotas, limit ranges, pod security rules and network policies before tenants arrive.
Match isolation to trust
Use shared nodes for trusted teams, and dedicated or private nodes and sandboxes for stricter tenants.
Use templates
Offer a few tested configurations instead of free-form choices.
Manage definitions as code
Keep configurations in version control and let a GitOps tool apply them.
Label, expire and sleep
Give every virtual cluster an owner and an expiry, and sleep the idle ones.
Limit the syncer’s reach
Keep the syncer’s host permissions to its own namespace.
Protect what matters
Back up data stores and volumes of long-lived virtual clusters, and rehearse restores.
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
Decide the trust level
Is the tenant a trusted internal team or an outside customer? This decides the isolation settings.
Set the budget
Choose quotas for processor, memory, storage and object counts.
Apply guardrails on the host
Add security standards and network rules to the namespace.
Plan the lifetime
Set an expiry, an owner and a sleep policy.
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.
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.
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.
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.
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.
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.
| Symptom | Likely cause | First check |
|---|---|---|
| Pods in the virtual cluster stay pending with no node | Host quota reached or scheduling constraints | Host Pod events and quota usage |
| Objects exist virtually but not on the host | Resource type not synced | Sync settings in the configuration |
| Tenants reach other tenants’ Pods | No host network policies | Policies on host namespaces |
| Virtual API server is slow | Control plane is starved or data store is large | Control plane resource use |
| Storage claims never bind | Host storage class or driver issue | Host 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
| Approach | Isolation | Cost | Speed to create | Tenant freedom |
|---|---|---|---|---|
| Plain namespaces | Light | Lowest | Seconds | Limited, no custom definitions or admin rights |
| Namespaces with extra multi-tenancy tooling | Light to medium | Low | Seconds | Somewhat more, still bound by cluster-wide limits |
| Virtual clusters | Medium, stronger with hardening | Low | Seconds to minutes | High, own API and administrator rights |
| Separate real clusters | Strongest | Highest | Minutes to days | Complete |
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.
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.
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.
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.
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.
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.
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.
Yes, within the range the project supports. The virtual control plane has its own version, though node behaviour still follows the host.
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.
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.
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.
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.
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.