liveBook · Manning

Virtual cluster

As explained in Platform Engineering on Kubernetes

A virtual cluster is a Kubernetes-like cluster instantiated inside a host Kubernetes cluster with an isolated Kubernetes API server.

A virtual cluster is a Kubernetes-like cluster created inside a host Kubernetes cluster. It provides tenants with an isolated Kubernetes API server while sharing the host cluster’s underlying capacity. This offers an alternative to choosing between shared Kubernetes namespaces and separate physical clusters. section 6.3.1

Use a virtual cluster when teams need cluster-wide access and control of the Kubernetes API without affecting other tenants. If teams do not need Kubernetes API access, a namespace-based approach is recommended instead. section 6.3.1

A platform can use virtual clusters to provide repeatable development environments:

  • Application teams request an environment through platform APIs. section 6.3.2
  • Crossplane compositions define the provisioning process and use the Crossplane Helm provider to create a virtual cluster. section 6.3.2
  • The platform installs the Conference application Helm Chart into the new environment. section 6.3.2
  • Teams connect to the isolated environment without risking other teams’ setups. section 6.3.2

Provision and connect to a development environment

Submit an Environment resource with apiVersion salaboy.com/v1alpha1, kind Environment, metadata.name team-a-dev-env, and a development composition selector. After provisioning, list environments with kubectl and connect with `vcluster connect team-a-dev-env-jp7j4 --server https://localhost:8443 -- zsh`. section 6.3.2

Figure 6.14 vcluster provides isolation at the Kubernetes (K8s) API server

Shows where the virtual cluster’s isolation occurs: at the Kubernetes API-server layer inside the host cluster. section 6.3.1

How Platform Engineering on Kubernetes covers it

How deep it goes
Defines API-server isolation and demonstrates Helm, Crossplane, resource submission, listing, and connection, without detailing vcluster internals.
Examples
Uses a development Environment resource, kubectl environment listing, a vcluster connection command, and an automatically installed Conference application.
What it assumes
Assumes Kubernetes familiarity and introduces virtual-cluster creation, environment resources, and team connections through concrete workflows.
What you can do after
Apply it via Helm, vcluster CLI, Crossplane compositions, and platform APIs to create and connect to isolated environments.
How it connects
Connects virtual clusters with Kubernetes namespaces, Kubernetes clusters, multi-tenancy, Crossplane, Helm, and platform APIs.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Platform Engineering on Kubernetes. The section links point to the parts of the book it draws on.