Create a tenant cluster from a template
Each tenant cluster that is created in the platform belongs to a project. There are two primary ways which tenant clusters can be created: from a template or manually.
Tenant clusters created from a template inherit all template settings. Standard project users (non project admins) are only allowed to create tenant clusters from templates that the project admin has allowed. This ensures that tenant clusters in each project adhere to the standards set by the project admin.
Project admins and platform admins can create tenant clusters manually, that is without a template.
Once you have created a tenant cluster template you can then refer to that template when creating a new tenant cluster. All template configurations will be automatically applied to the newly created tenant cluster. Tenant clusters referring to templates can be created in the UI or using the vCluster CLI.
See the Platform CLI hub for UI-to-CLI equivalents across common Platform tasks, including tenant cluster commands.
- UI
- CLI
From the project drop-down menu (top left corner), select the project you'd like to create the tenant cluster in.
Click on Tenant Clusters.
Click the button.
The system redirects you to the configure virtual cluster page. Select your template:
If your project has "require template" enabled, choose from a list of available templates
If not, click to select your template
Follow the steps in the UI to create the virtual cluster.
Retrieve a kube-context for a virtual cluster using the CLI:
vcluster connect [vcluster-name] --project [project-name] --driver platform
When creating a tenant cluster from the vCluster CLI, provide the project name to deploy into and the template name to use:
vcluster create [vcluster-name] --project [project-name] --template [template-name] --driver platform
If you omit --template, vCluster Platform resolves one automatically.
- Uses the project's default template if one is set.
- Auto-selects the template if the project only allows one.
- Prompts you to choose if the project allows multiple templates without defining a default.
- Fails with an error if no templates are allowed in the project.
Running vcluster create adds a kube-context to your kube-config file and switches your active context to it. This allows you to immediately run kubectl commands for the new cluster right after creating it.
Disable the automatic context switch by adding --connect=false to the create command.
Template version strings​
Regardless of how you create a tenant cluster from a template, either by the UI or the CLI, you will be prompted to provide a template version string. If you do not provide this string, the latest
version will be automatically selected for you. If you do provide the string though, you can
do something very neat -- you can set any of the MAJOR, MINOR, PATCH version components to an
X wildcard character. This allows the tenant cluster to be automatically updated to a more recent
template version that matches your provided template string.
For example, given a template with a version of 1.0.0, and a tenant cluster created from this template with a version string "1.X.X". Adding a new template version "1.1.0", will cause this tenant cluster to be automatically updated. Whereas adding a new version "2.0.0", will not cause the tenant cluster to be upgraded.
This is a very handy way to keep tenant clusters up to date with the latest templates without having to manually upgrade them.
Note that you can even set the version to "X.X.X" to always have your tenant cluster updated to the latest template version.
The platform uses Helm to manage virtual clusters. If your cluster is running in an air-gapped environment, you may host Helm charts in an OCI compatible private registry. To use a private registry for virtual clusters there are several configuration options:
- Configure the platform for offline Helm charts
- Configure the Helm chart repository and authentication for each virtual cluster.
- Configure the Helm chart repository and authentication using virtual cluster templates.