Prepare the workspace
This article mainly introduces how to create projects and namespaces, and assign operation permissions to users, in order to create isolated workspaces for resources and personnel based on actual tenant scenarios.
Projects are project environments that can achieve resource and personnel isolation, based on the resource quotas of one or more clusters on the platform, and are divided by the platform to meet the usage scenarios of multiple tenants in enterprises. They can represent different subsidiaries, departments, or project teams in the enterprise. Through project management, resource isolation between project teams and quota management within tenants can be easily achieved.
The platform’s namespace is a smaller resource space that is isolated from each other under the project, and is also a workspace for users to implement job production. Multiple namespaces can be created under a project, and the total amount of resource quotas that can be occupied cannot exceed the project quota. The namespace further divides the resource quota more finely, while also limiting the size of containers (CPU, memory) under the namespace, effectively improving resource utilization.
Tip: When you subscribe to other sub-products of Container Platform (Container Platform, DevOps, Service Mesh), after creating projects and namespaces, you can go to the sub-product interface through the product switching entrance to experience custom applications, pipelines, service meshes, and other functions.
Create project and import members
Tip: Allocate resource quotas to projects reasonably according to the usage scale of the project and the resource usage of the cluster.
-
In the Project Management view, click Create Project.
-
On the Basic information page, configure the relevant parameters according to the following instructions.
Parameter Description Name The name of the project, which cannot be the same as an existing project and cannot be the same as a name in the project name blacklist. Otherwise, the project cannot be created.
Supports input ofa-z,0-9,-,.and must start or end witha-zor0-9, with a maximum length of 32 characters.
Note: The names in the project name blacklist are the names of special namespaces under the platform cluster, including: cpaas-system, cert-manager, default, global-credentials, kube-ovn, kube-public, kube-system, nsx-system, alauda-system, kube-federation-system, ALL-ALL, true.Cluster The cluster associated with the project. Administrators can allocate resource quotas for the selected cluster(s). Click the drop-down box to select one or more clusters.
Note: When a cluster is abnormal, it cannot be selected. -
Click Next. In the project quota setting step, set the resource quotas for the selected cluster(s) in the current project.
Note:
-
Only when GPU plugin are deployed in the cluster, can GPU resource quotas be configured. When the GPU resource is a GPU-Manager or MPS GPU resource, vMemory quota can also be configured. When the GPU resource is a Physical GPU resource, only the Physical GPU quota needs to be configured.
GPU Units: 100 units of virtual cores are equivalent to 1 physical core; GPU-Manager 1 unit of memory is 256 Mi, MPS GPU 1 unit of memory is 1 Gi; the unit of physical GPU is a whole piece and can only be allocated as a whole. -
If no quota is set for a certain resource, the quota for that resource is unlimited by default.
-
The value of the quota set should be within the range of the quota displayed on the page. Below each input box for resource quota, the allocated and total quota information for that resource will be displayed for reference.
-
-
After setting up, click on Create Project.
-
On the left navigation bar, click on Members.
-
Click on Import Member.
-
Click on the selection box before the username to select one or more users.
Tip: You can select a user group from the drop-down menu on the top right of the dialog box and enter the username in the search box to perform a fuzzy search for users.
-
Click on the drop-down menu on the right side of the Bind item at the bottom of the dialog box and select the role named “Project Administrator”.
-
Click on Import.
Create namespaces and import members
-
On the left navigation bar, click on Namespaces > Namespaces.
-
Click on create namespace.
-
Refer to the following instructions to configure the Basic information of the namespace.
-
Cluster: Select the cluster associated with the project.
-
Namespaces: Enter the name of the namespace. The fixed prefix of the name is the project name.
-
-
In the Resource Quota area, configure the Resource Quota of the namespace.
Note:
-
The resource quota of the namespace is part of the project quota in the cluster. For a certain resource, the maximum quota that can be set is the unused resource quota in the project. If the available amount of any resource is 0, you will not be able to create a namespace. Please contact the platform administrator for support.
-
GPU resource quota can only be configured if GPU (virtual GPU/physical GPU) resources are deployed in the cluster. When the GPU resource is Virtualized GPU, vMemory quota can also be configured; when the GPU resource is Physical GPU, only Physical GPU quota needs to be configured.
GPU Units: 100 units of virtual cores are equivalent to 1 physical core; 1 unit of memory is 256 Mi; physical GPU is allocated in whole units.
-
-
In the Container Resource Limits section, refer to the following parameter descriptions to configure the Container Resource Limits (LimitRange).
By setting container quotas, you can control the size of CPU/Memory for containers created in the current namespace. When creating computing components in the namespace, the size of a single container’s CPU and memory cannot exceed the maximum value.
-
max: The maximum limit value (limits) of resources (CPU/memory) that a single container in the namespace can use. When creating computing components in this namespace, the limit value of the container size (limits, displayed as Resource limit in the interface) cannot exceed the max of the namespace.
Caution: If a value greater than this max is set through a YAML orchestration file, the computing component will fail to be created. -
Default Value: The default limit value (limits) of resources (CPU/memory) that a single container in the namespace can use. When creating computing components in this namespace, the limit value of the container size (limits, displayed as Resource limit in the interface) defaults to the namespace’s Default Value, which can be modified. The modified value cannot exceed max.
-
requests: The request value for resources (CPU/memory) that the container in the namespace is set to, which defaults to limits/cluster overselling ratio. When creating computing components in this namespace, the request value of the container size (request, displayed as Resource limit in the interface) defaults to the namespace’s Default Value, which can be modified by editing the YAML orchestration file of the computing component. The modified value cannot exceed max, otherwise the computing component creation will fail.
The requests value is used as a reference and judgment for the scheduler to schedule containers. The scheduler will check the available resources on each node for allocation (total resources - sum of requests of containers scheduled in pods on the node). If the sum of requests of containers in the newly created pod exceeds the remaining available resources on the node, the pod will not be scheduled to this node.
-
-
Click on Create.
-
Under the Namespace Member tab, click on Import Member.
-
Click on the selection box next to the username and choose one or multiple users.
Tip: You can select a user group from the dropdown menu at the top right of the dialog box and search for users by entering their username in the search box for fuzzy search.
-
Click on the dropdown menu to the right of the Bind item at the bottom of the dialog box and choose the name of the role to be assigned (e.g. Namespace Administrator, Developer).
-
Click on Import.