Skip to main content

What is vcluster.yaml

The vcluster.yaml file contains all configurations when deploying and upgrading virtual clusters. It's optionally passed to the CLI or as the values file for deployments using Helm. It is also possible to create a vCluster without a vcluster.yaml file which will be created with a set of default values.

Example configurations include the vCluster control plane's backing store, resource syncing behavior from and to the host cluster, and exporting the virtual cluster's kubeconfig file.

  • Unified Configuration: All settings for vCluster in one place, simplifying management.
  • Schema Validation: Automatically validate the configuration when using the vCluster CLI.
  • IDE Support: Integrated schema with popular IDEs for autocompletion and validation.

Example vcluster.yaml file

controlPlane:
backingStore:
etcd:
embedded:
enabled: true
ingress:
enabled: true
host: vcluster-k8s-api.example.com
sync:
toHost:
serviceAccounts:
enabled: true
fromHost:
nodes:
enabled: true
clearImageStatus: true
exportKubeConfig:
context: my-vcluster-context
server: https://vcluster-k8s-api.example.com
secret:
name: my-vcluster-kubeconfig

This example configuration defines:

  1. Embedded etcd as the vCluster control plane's backing store to reduce management overhead (Pro feature).
  2. Syncing ServiceAccount resources from the virtual to the host cluster, to support, for example, AWS IRSA.
  3. Deploying an Ingress resource on the host cluster to expose the vCluster control plane's API server at a hostname.
  4. Syncing real node data, rather than the default "pseudo" nodes, but clears the ImageStatuses field within the NodeStatus of the synced nodes.
  5. How to export the kubeconfig file to a secret, so you can use it, for example, in your ArgoCD or Terraform pipelines.

How to Use vcluster.yaml

Creating a New Virtual Cluster

  • Define your configurations in the vcluster.yaml file.
  • Deploy your virtual cluster.
  1. Install the vCluster CLI.

    brew install loft-sh/tap/vcluster-experimental

    If you installed the CLI using brew install vcluster, you should brew uninstall vcluster and then install the experimental version. The binaries in the tap are signed using the Sigstore framework for enhanced security.

    Confirm that you've installed the correct version of the vCluster CLI.

    vcluster --version
  2. Deploy vCluster.

    vcluster create my-vcluster --namespace team-x --values vcluster.yaml

    When the installation finishes, you are automatically connected to the virtual cluster. You Kubernetes context is updated to point to your new virtual cluster. You can run local kubectl commands for the new virtual cluster.

Updating Existing Virtual Clusters

  • Simply update your vcluster.yaml file with the new configurations.
  • Apply the updates.
vcluster create --upgrade VCLUSTER_NAME -n VCLUSTER_NAMESPACE -f vcluster.yaml

Replace:

  • VCLUSTER_NAME with your vCluster instance name.
  • VCLUSTER_NAMESPACE with the namespace where you deployed vCluster.

FAQs

How do I upgrade my 0.19.x and earlier virtual cluster configurations?

If you have existing 0.19.x virtual clusters, you can convert the old configuration values to the new v0.20 format. View the guide for more details.

Is it required to provide a vcluster.yaml file?

No, if a vcluster.yaml file isn't provided, the vCluster will be created using a set of default values.

Can I change the configuration for existing virtual clusters?

Yes, you can run vcluster create VCLUSTER_NAME --upgrade -f vcluster.yaml