Creating Namespaces
TOC
Understanding namespacesCreating namespaces by using web consoleCreating namespaces by using new web consoleCreate from the Applications viewCreate from the Clusters viewCreating namespace in a project by ac CLICreating namespace by kubectlYAML file examplesCreate via YAML fileCreate via command line directlyUnderstanding namespaces
Refer to the official Kubernetes documentation: Namespaces
In Kubernetes, namespaces provide a mechanism for isolating groups of resources within a single cluster. Names of resources need to be unique within a namespace, but not across namespaces. Namespace-based scoping is applicable only for namespaced objects (e.g. Deployments, Services, etc.) and not for cluster-wide objects (e.g. StorageClass, Nodes, PersistentVolumes, etc.).
Creating namespaces by using web console
Within the cluster associated with the project, create a new namespace aligned with the project's available resource quotas. The new namespace operates within the resource quotas allocated to the project (e.g., CPU, memory), and all resources in the namespace must reside within the associated cluster.
-
In the Project Management view, click on the Project Name for which you want to create a namespace.
-
In the left navigation bar, click on Namespaces > Namespaces.
-
Click on Create Namespace.
-
Configure Basic Information.
-
(Optional) Configure Resource Quota.
Every time a resource limit (limits) for computational or storage resources is specified for a container within the namespace, or each time a new Pod or PVC is added, it will consume the quota set here.
NOTICE:
-
The namespace's resource quota is inherited from the project's allocated quota in the cluster. The maximum allowable quota for a resource type cannot exceed the remaining available quota of the project. If any resource's available quota reaches 0, namespace creation will be blocked. Contact your platform administrator for quota adjustments.
-
GPU Quota Configuration Requirements:
- GPU quotas (vGPU or pGPU) can only be configured if GPU resources are provisioned in the cluster.
- When using vGPU, memory quotas can also be set.
GPU Unit Definitions:
- vGPU Units: 100 virtual GPU units (vGPU) = 1 physical GPU core (pGPU).
- Note: pGPU units are counted in whole numbers only (e.g., 1 pGPU = 1 core = 100 vGPU).
- Memory Units:
- 1 memory unit = 256 MiB.
- 1 GiB = 4 memory units (1024 MiB = 4 × 256 MiB).
-
Default Quota Behavior:
- If no quota is specified for a resource type, the default is unbounded.
- This means the namespace can consume all available resources of that type allocated to the project without explicit limits.
Quota Parameter Description
-
-
(Optional) Configure Container Limit Range; please refer to Limit Range for more details.
-
(Optional) Configure Pod Security Admission; please refer to Pod Security Admission for specific details.
-
(Optional) In the More Configuration area, add labels and annotations for the current namespace.
Tip: You can define the attributes of the namespace through labels or supplement the namespace with additional information through annotations; both can be used to filter and sort namespaces.
-
Click on Create.
Creating namespaces by using new web console
This page mainly describes the legacy console workflow, but namespace creation in the new web console can start from different views.
Create from the Applications view
Use the Applications view when you are creating a namespace for the current project.
Entry path and action order:
- Open the current project, then go to Applications > Namespaces.
- Click Create Namespace.
- Select the target Cluster first, then continue with namespace name, quota, limit range, Pod Security Admission, labels, and annotations.
Before submitting the form, confirm that:
- the target cluster is already associated with the current project
- cluster selection happens before namespace submission because the namespace is created as part of the current project's cluster-scoped governance workflow
- the namespace naming rule matches current project governance expectations
- quota, limit range, security policy, labels, and annotations reflect the intended workload baseline
- the namespace appears afterward in the current project and is associated with the expected cluster
Create from the Clusters view
Use the Clusters view when you are creating a namespace as a cluster resource in a concrete cluster.
Entry path and action order:
- Open the target cluster first.
- Go to Namespaces in that cluster context.
- Click Create Namespace and continue with namespace name, labels, and annotations.
Creating namespace in a project by ac CLI
To use ac command-line tool to create a namespace in a project, run the following command: