Skip to main content

Namespaces

Virtual Machine Orchestrator (VMO) allows you to create, manage, and edit Kubernetes namespaces. You can also apply Resource Quotas and Limit Ranges to those namespaces.

Managed Namespaces​

Namespaces managed by VMO are denoted with the following labels:

LabelDescription
app.kubernetes.io/managed-by=vmo-managerApplied to all namespaces managed by VMO, whether created in the VMO UI or adopted from the cluster
vmo-manager.spectrocloud.com/origin=createdDistinguishes namespaces created by a user in VMO (deletable from the UI) from namespaces created automatically by PaletteAI VM Launchpad

Managed namespaces:

  • Are listed in relevant drop-downs and filters.
  • Can be edited from a single modal.
  • Can be created on-the-fly from various pages (for example, Workloads > Virtual Machines > Create VM).

Resource lists default to All Namespaces, showing resources across all namespaces you can access. For OIDC users with namespace scoped RoleBindings (granted through Settings > Access Management), only their permitted namespaces appear in drop-downs and filters. Users with cluster-wide access can view all managed namespaces. You can filter by a specific namespace using the All Namespaces drop-down.

VMO manages the following namespaces by default.

NamespacePurpose
defaultDefault Kubernetes namespace.
vm-dashboardThe appliance's own namespace, or the configured value.
vmo-golden-imagesDedicated namespace for golden image DataVolumes.

Create Namespaces​

  1. From the VMO left main menu, select Infrastructure > Namespaces.

  2. Select Create Namespace. The Create Namespace modal window contains the following tabs.

    TabDescription
    GeneralThe namespace name, plus optional labels and annotations.
    QuotasOptional namespace-wide Resource Quota caps.
    Limit RangeOptional per-container default requests and limits.
  3. On the General tab, enter a DNS-1123 compliant Namespace name (lowercase letters, digits, and hyphens; up to 63 characters; must start and end with an alphanumeric character). Validation runs as you type.

  4. (Optional) Enter key-value pairs for Labels and Annotations as necessary.

    Reserved Key-Values​

    Certain keys and values are reserved for VMO and Kubernetes operations. The modal window hides these keys to prevent accidental edits. If you need to set a kubernetes.io/ key, use kubectl edit namespace directly.

    KeyValueReserved for labelsReserved for annotations
    app.kubernetes.io/managed-byvmo-manager✅❌
    vmo-manager.spectrocloud.com/origincreated✅❌
    kubernetes.io/... and *.kubernetes.io/...Any✅✅
    k8s.io/... and *.k8s.io/...Any✅✅
    pod-security.kubernetes.io/...Any✅✅
  5. (Optional) Enter Quotas and Limit Range values as necessary.

    • Use Resource Quotas to set resource constraints on all pods in the namespace, keeping resource-hungry namespaces from starving other workloads on the cluster.
    • Use Limit Ranges to automatically set resource constraints for each container within the namespace that does not specify requests or limits for CPU or memory.

    Quota Fields​

    On the Quotas tab, all fields are optional.

    FieldWhat it caps
    Total CPU RequestsSum of requests.cpu across all pods in the namespace.
    Total CPU LimitsSum of limits.cpu across all pods.
    Total Memory RequestsSum of requests.memory.
    Total Memory LimitsSum of limits.memory.
    Total StorageSum of requests.storage across all Persistent Volume Claims (PVCs) in the namespace.
    Max PodsMaximum number of pods in the namespace.

    CPU values use Kubernetes CPU units (1, 500m, 1.5). Memory and storage use binary suffixes (128Mi, 4Gi).

    Limit Range Fields​

    On the Limit Range tab, all fields are optional.

    FieldWhat it sets
    Default CPU Request per containerrequests.cpu for containers that do not specify their own.
    Default CPU Limit per containerlimits.cpu for containers that do not specify their own.
    Default Memory Request per containerrequests.memory for containers that do not specify their own.
    Default Memory Limit per containerlimits.memory for containers that do not specify their own.

    If a workload already declares its own resources.requests or resources.limits, the Limit Range does not override it; it only fills in defaults.

  6. Create the namespace.

    The namespace is created with the appropriate labels set. Any provided Quotas and Limit Range values are applied as a follow-up step. If those follow-up calls fail, the namespace is still created, and you can edit the namespace to adjust values as needed.

Adopt Existing Namespaces​

You can adopt a namespace that already exists in the cluster so that it can be managed by VMO.

  1. From the VMO left main menu, select Infrastructure > Namespaces.
  2. Select Add Existing.
  3. Select one or more unmanaged namespaces from the list and click Adopt Namespace.

Adopted namespaces are labeled app.kubernetes.io/managed-by=vmo-manager but are not labeled vmo-manager.spectrocloud.com/origin=created.

info

The namespace is listed as soon as you adopt it, but virtual machines that already exist in it might take about five minutes to appear in VMO Manager.

Edit Namespaces​

Editing an existing namespace uses a similar process as creating a namespace.

  1. From the VMO left main menu, select Infrastructure > Namespaces.
  2. Select the Edit icon beside the namespace.
  3. Add, remove, and edit fields as necessary.
  4. Select Save changes when finished.
info

Namespace names are immutable. Kubernetes does not allow renaming a namespace, so the name field is shown but disabled in edit mode. To use a different name, create a new namespace, move resources to the new namespace, and delete the old namespace.

Delete Namespaces​

Take the following steps to delete a namespace created using the VMO UI.

  1. From the VMO left main menu, select Infrastructure > Namespaces.
  2. Right-click the namespace you want to delete and select Delete Namespace. This can only be done for namespaces with a VMO Status of Created. Alternatively, use the Delete icon.
  3. Enter the namespace you are deleting, and select Delete.

Unadopt Namespaces​

You can remove the ability to provision VMO-related resources in non-VMO managed namespaces by "unadopting" a namespace, but you cannot delete the namespace itself from the VMO UI. Unadopting a namespace does not remove any resources within the namespace. To delete the underlying namespace, use kubectl or similar tool.

  1. From the VMO left main menu, select Infrastructure > Namespaces.
  2. Right-click the namespace you want to unadopt and select Remove from VMO. This can only be done for namespaces with a VMO Status of Adopted.
  3. Enter the namespace to remove from VMO, and select Remove from VMO. The namespace is required only if there are existing resources in the adopted namespace.