Deploy a vCluster on EKS Using Helm
In modern Kubernetes deployments, multi-tenancy is a common challenge. Virtual clusters(vClusters) offer a lightweight way to create isolated environments without the overhead of multiple Kubernetes clusters. In this post, I’ll guide you through deploying a vCluster on Amazon EKS using Helm and connecting to it locally.
Published Jan 3, 2025
A vCluster is a virtual Kubernetes cluster that runs on top of another Kubernetes cluster(the host cluster). It can use K8s / K3s or K0s distributions, allowing you to run multiple virtual clusters on a single host cluster. This is ideal for testing, development or tenant isolation.
Before we start, ensure you have the following:
- An EKS Cluster up and running(v1.28+).
- kubectl and Helm installed locally.
- Access to the EKS cluster
- vCluster CLI installed.
Add the vCluster Helm Repository:
helm repo add loft-sh https://charts.loft.sh
Create a dedicated namespace and install the vCluster Helm Chart:
kubectl create ns vcluster
helm install sample-vcluster loft-sh/vcluster -n vcluster
Verify the Installation by checking the vCluster pods:
kubectl get pods -n vcluster
To interact with the vCluster, you need to connect to its control plane. This is done by port-forwarding its API server.
Port-Forward the vCluster API Server:
vcluster connect sample-vcluster -n vcluster
This command:
- Sets up port-forwarding to the vCluster.
- Creates a temporary kubeconfig for the vCluster.
While the above port forwarding is executed, it is possible to check the vCluster components in a separate shell.
Now you are connected to vCluster and just as normal Kubernetes cluster you can deploy workloads to vCluster. It is possible to connect vCluster to ArgoCD or any other tool if the vCluster API endpoint is exposed outside.
This configuration file is used to configure different options and parameters when deploying a vCluster. Since helm is used to deploy the vCluster, values.yaml has different sections to achieve the same configuration changes.
Example:
1. Sync different Kubernetes objects between host cluster and vCluster,
2. Configure external database as the ETCD storage. More info.
3. Enable disable isolation with extra resource quotas
Using helm values.yaml file it is possible to create an ingress resource and expose the vCluster API outside of host cluster. By doing so it is possible to connect to vCluster without port-forwarding.
vCluster provides an efficient way to manage Kubernetes multi-tenancy, allowing developers and teams to work in isolated environments. By using Helm, deploying a vCluster is simple and integrates seamlessly with existing Kubernetes infrastructure like EKS.