Skip to main content

Docker (vind) Quick Start

You want a full Kubernetes cluster running locally for development, testing, or CI. You don't want the setup overhead of a cloud environment or the limitations of KinD.

vind (vCluster in Docker) runs a complete Kubernetes cluster in Docker containers. No cloud account, no existing Kubernetes cluster, no kubeadm. If Docker is running, you can have a cluster in under a minute. When you're ready to test against real cloud hardware, vind clusters can also accept actual EC2 or GCP instances as worker nodes through vCluster VPN. That's a hybrid setup that KinD simply can't do.

This guide covers deployment, pause and resume, LoadBalancer services, and virtual worker nodes. Here's how vind compares to KinD:

FeaturevindKinD
Pause and resume without losing stateYesNo — must delete and recreate
LoadBalancer servicesAutomatic on Linux, requires sudo on macOSManual setup required
Virtual worker nodesYesLimited
Join real cloud instancesYes, via VPNNo
Pull-through image cacheUses host Docker daemonDirect registry pulls

Prerequisites​

  • Docker installed and running
  • At least 4 GB RAM available to Docker (Rancher Desktop or Docker Desktop VM size)

Install the vCluster CLI​

brew install loft-sh/tap/vcluster

The binaries in the tap are signed using the Sigstore framework for enhanced security.

Verify the CLI installed successfully.

vcluster --version

Output is similar to:

vCluster version 0.x.x

Deploy a cluster​

Air-gapped environments

If your Docker containers cannot reach public registries or GitHub, complete the air-gapped setup before running these steps.

  1. Configure vCluster to use the Docker driver.

    vcluster use driver docker
  2. Deploy a cluster.

    vcluster create my-cluster
    note

    vCluster deploys Kubernetes v1.36.0 by default. To use a different version, set controlPlane.distro.k8s.image.tag in your vcluster.yaml.

    When deployment finishes, the CLI connects and switches your kube context into the cluster.

  3. Verify the cluster is running.

    kubectl get nodes

Pause and resume​

A vind cluster can pause and resume without losing state. A KinD cluster requires a full delete and recreate.

# Pause the cluster — frees Docker resources immediately
vcluster pause my-cluster

# Check the status
vcluster list

Output is similar to:

NAME | STATUS | CONNECTED | AGE
-------------+--------+-----------+-----
my-cluster | exited | True | 5m
# Resume — cluster is back in seconds
vcluster resume my-cluster
vcluster connect my-cluster

Paused clusters retain all their state. After resume, workloads restart where they left off.

If vcluster disconnect prompts you to select a context, choose your previous cluster context (for example rancher-desktop or docker-desktop).

LoadBalancer services​

On Linux, LoadBalancer services get an external IP automatically. No MetalLB or extra configuration required.

kubectl create deployment hello --image=nginx
kubectl expose deployment hello --port=80 --type=LoadBalancer
kubectl get service hello --watch

Output on Linux is similar to:

NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
hello LoadBalancer 10.96.x.x 127.0.0.1 80:31234/TCP 5s
curl http://localhost

macOS​

On macOS with Docker Desktop or Rancher Desktop, Docker runs inside a Linux VM, so the bridge network IP isn't reachable from your Mac. A cluster created without sudo doesn't support LoadBalancer services. vcluster create prints a warning, and the EXTERNAL-IP stays <pending>. Run the CLI with sudo to enable LoadBalancer services. The CLI then adds loopback addresses on your Mac for the LoadBalancer IPs.

  1. Enable LoadBalancer services on the cluster. To update the cluster you already created, rerun vcluster create with sudo and --upgrade:

    sudo vcluster create my-cluster --upgrade

    For a new cluster, run sudo vcluster create instead.

  2. For ports below 1024, such as port 80 in this example, turn on privileged port forwarding. On Docker Desktop, open Settings > Advanced and turn on Allow privileged port forwarding to external machines. Without this setting, the EXTERNAL-IP stays <pending>.

  3. From your Mac, access the service at its EXTERNAL-IP instead of localhost.

    curl http://<EXTERNAL-IP>

If you created the cluster with sudo, delete it with sudo vcluster delete too. Otherwise the CLI can't remove the cluster's files in ~/.vcluster/docker/.

To skip sudo, use kubectl port-forward instead:

kubectl port-forward deployment/hello 8080:80
curl http://localhost:8080

Add virtual worker nodes​

Test node affinity rules, DaemonSet scheduling, or topology spread constraints without real hardware. Add virtual worker nodes by configuring them in a vcluster.yaml at creation time.

Delete the current cluster first to free resources. Running two clusters simultaneously requires at least 4 GB RAM in your Docker VM.

vcluster delete my-cluster

If you enabled LoadBalancer services with sudo on macOS, run sudo vcluster delete my-cluster instead.

vcluster.yaml
experimental:
docker:
nodes:
- name: worker-1
- name: worker-2
vcluster create second-cluster --values vcluster.yaml
kubectl get nodes

Output is similar to:

NAME STATUS ROLES AGE
second-cluster Ready control-plane 30s
worker-1 Ready <none> 25s
worker-2 Ready <none> 25s

Schedule workloads to specific nodes, add labels and taints, or simulate a realistic multi-node topology. All from a single Docker host.

Join real cloud nodes​

vind clusters accept real cloud instances as worker nodes through vCluster VPN. An EC2 instance, GCP VM, or any Linux machine can join your local vind cluster through a VPN tunnel. The result is a hybrid cluster with a local control plane and real remote compute.

This requires vCluster Platform. See vCluster VPN documentation for setup instructions.

Clean up​

# Delete remaining clusters, if any
vcluster delete my-cluster
vcluster delete second-cluster

All Docker containers and networks created for each cluster are removed. On macOS, a cluster created with sudo leaves a root-owned folder in ~/.vcluster/docker/. Using vcluster delete without sudo can't remove it, so you might see a permission denied warning. This is benign. Each cluster is fully deleted.

Next steps​

Ready for production?

See Build for Production to find the path that matches what you're building.