Templates
Allowed templates are the templates that project members are allowed to use when creating space instances and virtual cluster instances. These will be the only templates visible to be used when creating Spaces and Virtual Clusters in the Project.
Allowing Templates
To configure allowed templates using the UI, follow these steps:
- Navigate to the Projects view using the menu on the left.
- Select the project you'd like to configure using the drop down menu.
- Click on Project Settings.
- You may either edit the YAML directly, or click on Allowed Templates.
- Select the Virtual Cluster Templates or Space Templates tab, depending on which you'd like to configure.
- Click on the input and select the name of the template to add to allowed templates.
All Templates
To allow users to select any space template or virtual cluster template, a special All Templates placeholder can be used.
To configure all templates using the UI:
- Navigate to the Projects view using the menu on the left.
- Select the project you'd like to configure using the drop down menu.
- Click on Project Settings.
- You may either edit the YAML directly, or click on Allowed Templates.
- Select the Virtual Cluster Templates or Space Templates tab, depending on which you'd like to configure.
- Click on the input and select All Templates.
Default Templates
A template can be set as a default template. When creating a space instance or virtual cluster instance, the default template will automatically be selected when creating the instance. The default template is not enforced, and can be deselected before creating the instance.
To configure a default template for the project using the UI:
- Navigate to the Projects view using the menu on the left
- Select the project you'd like to configure using the drop down menu
- Click on Project Settings
- You may either edit the YAML directly, or click on Allowed Templates
- Select the Virtual Cluster Templates or Space Templates tab, depending on which you'd like to configure
- Expand Advanced Options
- Click on the input and select a default template
Namespace Pattern
When creating a space instance or virtual cluster instance, it can be repetitive to specify a spec.clusterRef.
namespace
over and over. Namespace patterns provide a template to use when creating namespaces for space instances
or virtual cluster instances. These can be used to save time or enforce a naming convention.
For example, the namespace pattern {{.Values.loft.project}}-{{.Values.loft.name}}
would result in a namespace with
name my-project-space-1
being created for the space instance named space-1
for a project named my-project
.
To configure a namespace pattern using the UI
- Navigate to the Projects view using the menu on the left.
- Select the project you'd like to configure using the drop down menu.
- Click on Project Settings.
- Click on Allowed Templates.
- Expand the Advanced Options section.
- Click on the Namespace Pattern input and enter a namespace pattern.
The variables available for templating namespacePattern.space
are:
.Values.loft.user.name
: The name of the owner, if the owner is a user.Values.loft.team.name
: The name of the owner, if the owner is a team.Values.loft.name
: The name of the space or virtual cluster instance.Values.loft.project
: The name of the project.Values.loft.cluster
: The name of the connected cluster the space is scheduled to
The variables available for templating namespacePattern.virtualCluster
are:
.Values.loft.user.name
: The name of the owner, if the owner is a user.Values.loft.team.name
: The name of the owner, if the owner is a team.Values.loft.name
: The name of the space or virtual cluster instance.Values.loft.project
: The name of the project.Values.loft.space
: The name of the space containing the virtual cluster.Values.loft.cluster
: The name of the connected cluster the space is scheduled to.Values.loft.virtualClusterName
: The name of the virtual cluster.Values.loft.virtualClusterNamespace
: The name of the space containing the virtual cluster