Skip to main content
Version: master

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:

  1. Navigate to the Projects view using the menu on the left.
  2. Select the project you'd like to configure using the drop down menu.
  3. Click on Project Settings.
  4. You may either edit the YAML directly, or click on Allowed Templates.
  5. Select the Virtual Cluster Templates or Space Templates tab, depending on which you'd like to configure.
  6. 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:

  1. Navigate to the Projects view using the menu on the left.
  2. Select the project you'd like to configure using the drop down menu.
  3. Click on Project Settings.
  4. You may either edit the YAML directly, or click on Allowed Templates.
  5. Select the Virtual Cluster Templates or Space Templates tab, depending on which you'd like to configure.
  6. 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:

  1. Navigate to the Projects view using the menu on the left
  2. Select the project you'd like to configure using the drop down menu
  3. Click on Project Settings
  4. You may either edit the YAML directly, or click on Allowed Templates
  5. Select the Virtual Cluster Templates or Space Templates tab, depending on which you'd like to configure
  6. Expand Advanced Options
  7. 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

  1. Navigate to the Projects view using the menu on the left.
  2. Select the project you'd like to configure using the drop down menu.
  3. Click on Project Settings.
  4. Click on Allowed Templates.
  5. Expand the Advanced Options section.
  6. 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