Skip to main content

Create Namespace

Each namespace that is created in Loft belongs to a project. There are two ways how namespaces can be created inside Loft:

  1. For regular project users: namespaces can only be created by template that are allowed on project level.
  2. For project admins: namespaces can be created without template.

Create From Template

Project members can create a new namespace through the UI or CLI:

  1. Go to the Projects view using the menu on the left

  2. Click on Namespaces and the button

  3. In the popup select the namespace template and click the button

  4. Optional: Select a cluster where to create the namespace in. If no cluster is specified, the platform will automatically select one for you.

  5. Specify a name of the namespace at the top and optionally configure the template parameters and namespace access.

  6. Click on the button

  7. Retrieve a kube-context for this namespace using Loft CLI:

    vcluster platform connect namespace [namespace-name] --project my-project
info

The Kubernetes namespace in the underlying cluster this namespace points to usually has a different name than the namespace inside the project to avoid conflicts, you can adjust the space name pattern within a project.

Template Version Strings

Regardless of how you create a namespace from a template, either by the UI or the CLI, Loft allows you 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 namespace 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 namespace created from this template with a version string "1.X.X". Adding a new template version "1.1.0", will cause this namespace to be automatically updated. Whereas adding a new version "2.0.0", will not cause the namespace to be upgraded.

This is a very handy way to keep namespaces 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 namespace updated to the latest template version!

Create Without Template

Only Project admins can create a virtual cluster without a template:

  1. Go to the Projects view using the menu on the left

  2. Click on Namespaces and the button

  3. In the popup make sure the namespace template field is empty and click the button

  4. Optional: Select a cluster where to create the namespace in. If no cluster is specified, the platform will automatically select one for you.

  5. Specify a name of the namespace at the top and optionally configure the namespace you want to create.

  6. Click on the button

  7. Retrieve a kube-context for this namespace using vcluster CLI:

    vcluster platform connect namespace [namespace-name] --project my-project