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:
| Label | Description |
|---|---|
app.kubernetes.io/managed-by=vmo-manager | Applied to all namespaces managed by VMO, whether created in the VMO UI or adopted from the cluster |
vmo-manager.spectrocloud.com/origin=created | Distinguishes 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.
| Namespace | Purpose |
|---|---|
default | Default Kubernetes namespace. |
vm-dashboard | The appliance's own namespace, or the configured value. |
vmo-golden-images | Dedicated namespace for golden image DataVolumes. |
Create Namespaces
-
From the VMO left main menu, select Infrastructure > Namespaces.
-
Select Create Namespace. The Create Namespace modal window contains the following tabs.
Tab Description General The namespace name, plus optional labels and annotations. Quotas Optional namespace-wide Resource Quota caps. Limit Range Optional per-container default requests and limits. -
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.
-
(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, usekubectl edit namespacedirectly.Key Value Reserved for labels Reserved 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 ✅ ✅ -
(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.
Field What it caps Total CPU Requests Sum of requests.cpuacross all pods in the namespace.Total CPU Limits Sum of limits.cpuacross all pods.Total Memory Requests Sum of requests.memory.Total Memory Limits Sum of limits.memory.Total Storage Sum of requests.storageacross all Persistent Volume Claims (PVCs) in the namespace.Max Pods Maximum 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.
Field What it sets Default CPU Request per container requests.cpufor containers that do not specify their own.Default CPU Limit per container limits.cpufor containers that do not specify their own.Default Memory Request per container requests.memoryfor containers that do not specify their own.Default Memory Limit per container limits.memoryfor containers that do not specify their own.If a workload already declares its own
resources.requestsorresources.limits, the Limit Range does not override it; it only fills in defaults. -
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.
- From the VMO left main menu, select Infrastructure > Namespaces.
- Select Add Existing.
- 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.
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.
- From the VMO left main menu, select Infrastructure > Namespaces.
- Select the Edit icon beside the namespace.
- Add, remove, and edit fields as necessary.
- Select Save changes when finished.
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.
- From the VMO left main menu, select Infrastructure > Namespaces.
- 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.
- 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.
- From the VMO left main menu, select Infrastructure > Namespaces.
- 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.
- 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.