Creating Namespaces
TOC
Understanding 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 namespace in a project by ac CLI
To use ac command-line tool to create a namespace in a project, run the following command: