Quick Start Guide
Key Concepts​
- vCluster Control Plane: Contains a Kubernetes API server, a controller manager, a data store mount, and the Syncer.
- Syncing resources: vCluster runs your workloads by syncing pods from the virtual cluster to the host cluster.
- Pod scheduling: By default, vCluster reuses the host cluster scheduler to schedule workloads, but you can enable the virtual cluster's scheduler.
- Storage: You can use the host's storage classes without the need to create them in the virtual cluster by enabling them to sync from the host cluster to the virtual cluster.
- Networking: vCluster can sync resources such as Service and Ingress resources from the virtual to the host cluster.
- Nodes: By default, vCluster creates pseudo nodes for every pod
spec.nodeName
in the virtual cluster.
Before you begin​
In order to deploy vcluster, you need the following:
- kubectl
- Helm v3.10.0+
- Access to a Kubernetes v1.28+ cluster with permissions to deploy applications into a namespace. This is considered the host cluster for the vCluster deployment.
Since vCluster runs as an application, vCluster can run on any host cluster regardless of OS or Kubernetes distribution. The Kubernetes distribution of vCluster does not need to match the Kubernetes distribution of the host cluster. For example,
you can select a vCluster with k8s
as the distro and run it on host cluster that's running EKS.
Deploy vCluster​
Deploy a vCluster instance called my-vcluster
to namespace team-x
. This guide uses the vCluster CLI to deploy vCluster, but there are multiple ways to deploy vCluster using other tools like Helm, Terraform, ArgoCD, ClusterAPI, etc. Read about the additional options in the deployment section of the docs.
Install the vCluster CLI.
- Homebrew
- Mac (Intel/AMD)
- Mac (Silicon/ARM)
- Linux (AMD)
- Linux (ARM)
- Download Binary
- Windows Powershell
brew install loft-sh/tap/vcluster
The binaries in the tap are signed using the Sigstore framework for enhanced security.
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-darwin-amd64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-darwin-arm64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-linux-amd64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
curl -L -o vcluster "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-linux-arm64" && sudo install -c -m 0755 vcluster /usr/local/bin && rm -f vcluster
Download the binary for your platform from the GitHub Releases page and add this binary to your $PATH.
md -Force "$Env:APPDATA\vcluster"; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]'Tls,Tls11,Tls12';
Invoke-WebRequest -URI "https://github.com/loft-sh/vcluster/releases/latest/download/vcluster-windows-amd64.exe" -o $Env:APPDATA\vcluster\vcluster.exe;
$env:Path += ";" + $Env:APPDATA + "\vcluster";
[Environment]::SetEnvironmentVariable("Path", $env:Path, [System.EnvironmentVariableTarget]::User);Reboot RequiredYou may need to reboot your computer to use the CLI due to changes to the PATH variable (see below).
Check Environment Variable $PATHLine 4 of this install script adds the install directory
%APPDATA%\vcluster
to the$PATH
environment variable. This is only effective for the current Powershell session, i.e. when opening a new terminal window,vcluster
may not be found.Make sure to add the folder
%APPDATA%\vcluster
to thePATH
environment variable after installing vcluster CLI via Powershell. Afterward, a reboot might be necessary.Confirm that you've installed the correct version of the vCluster CLI.
vcluster --version
(Optional) Create a
vcluster.yaml
to configure your vCluster. Various options can be configured before deploying your vCluster, but even without avcluster.yaml
, a vCluster can be deployed with the default options.Refer to the
vcluster.yaml
reference docs to explore all configuration options.vcluster.yaml configurationIf you aren't sure what options you want to configure, you can always upgrade your vCluster after deployment with an updated
vcluster.yaml
to change your configuration. There are some configuration options (e.g. backing store) that can only be defined during deployment and not changed during upgrade.Deploy vCluster using the vCluster CLI. There are other methods to deploy vCluster, but this is the quickest way to get started!
- Default (No vcluster.yaml)
- With vcluster.yaml
vcluster create my-vcluster --namespace team-x
Include your
vcluster.yaml
configuration file.vcluster create my-vcluster --namespace team-x --values vcluster.yaml
Check out the namespaces in your virtual cluster. When the virtual cluster deployment finishes, your kube context is automatically updated to the virtual cluster. When you run
kubectl
commands, it will now be pointed at your virtual cluster instead of the original Kubernetes cluster.kubectl get namespaces # See the namespaces of your virtual cluster
Use your virtual cluster​
After immediately creating your virtual cluster, your kube context is updated to point to the virtual cluster and all these commands are directed at the virtual cluster.
Deploy resources inside the virtual cluster​
To illustrate what happens in the host cluster, create a namespace and deploy NGINX in the virtual cluster.
kubectl create namespace demo-nginx
kubectl create deployment ngnix-deployment -n demo-nginx --image=nginx -r 2
Check that this deployment creates two pods inside the virtual cluster.
kubectl get pods -n demo-nginx