Skip to main content
Version: 2.3

Spaces

Spaces are virtual resources that represent regular Kubernetes namespaces. Typically, non-admin users to not have the permission to list, create or delete namespaces in a shared Kubernetes clusters. That's why Loft adds the space resource to Kubernetes. Spaces are not stored in etcd but rather abstract from regular namespaces. Deleting a space will effectively delete the underlying namespace, for example. In turn, any labels and annotations set on a namespace will show up on the corresponding space as well.

Working with Spaces

Space and namespaces are directly coupled via a 1:1 relationship. But unlike with namespaces, it is safe to give non-admin users the permission to create and manage their own spaces.

Create Spaces

To create a space using Loft CLI, run:

loft create space [space-name]
Kube-Context

Running loft create space will automatically add a kube-context to your kube-config file, so you can immediately run kubectl commands right after creating a space.

Delete Spaces
loft delete space [space-name]
Kube-Context

Deleting spaces with Loft CLI has the advantage that Loft CLI will also delete the kube-context for this space from your local kube-config file to keep everything cleaned up.

List Spaces

To see a list of spaces, go to the Spaces view using the main menu on the left.

Spaces & Namespaces

If you are admin in one of the clusters connected to Loft, you will have permission to view all namespaces in the cluster. Since spaces and namespaces have a 1:1 relationship and Loft is often relying on regular Kubernetes RBAC, you will be able to see all namespaces in the Spaces view rather than just namespaces created via Loft.

Prevent Space Deletion

You can prevent space deletion, by setting the annotation loft.sh/non-deletable to true.

Configuration

Owner

JSONPath in CRD:
 spec.user (type: string)         # default: name of current user

Template

Metadata

Name

JSONPath in CRD:
 metadata.name (type: string)

Labels

JSONPath in CRD:
 metadata.labels (type: map[string]string)

Annotations

JSONPath in CRD:
 metadata.annotations (type: map[string]string)

Sleep Mode

Inactivity Timeout

JSONPath in CRD:
 metadata.annotations["sleepmode.loft.sh/sleep-after"] (type: string)

Auto-Delete Timeout

JSONPath in CRD:
 metadata.annotations["sleepmode.loft.sh/delete-after"] (type: string)

Sleep Schedule

JSONPath in CRD:
 metadata.annotations["sleepmode.loft.sh/sleep-schedule"] (type: string)

Wake-Up Schedule

JSONPath in CRD:
 metadata.annotations["sleepmode.loft.sh/wakeup-schedule"] (type: string)

Scheduling Timezone

JSONPath in CRD:
 metadata.annotations["sleepmode.loft.sh/timezone"] (type: string)

Apps

Access To Space

JSONPath in CRD:
 spec.access (type: Access[])