Best practices for projects and namespaces
Background
Elastic resource management is an important feature of cloud-native platforms. Compared to traditional infrastructure platforms, this platform provides more flexible resource planning and quota allocation schemes. In the process of enterprise cloud migration, tenant division and container resource planning can help enterprises to plan and manage container resources reasonably in complex organizational structures, thus ensuring the reliability and stability of applications. By using the resource division best practices provided in this chapter, enterprises can provide reference and guidance, which can help achieve elastic resource management, improve business flexibility and responsiveness.
Glossary
| Parameter | Description |
|---|---|
| Project | In order to better meet the multi-tenant usage requirements of enterprises, the platform combines the resource quotas of one or more clusters to form independent projects, which are subdivided into multiple namespaces to ensure resource and personnel isolation. These projects can represent different parent companies, subsidiaries, departments, or project teams in the enterprise. In project management, you can easily achieve resource isolation between project groups and quota management within tenants. |
| Cluster | A cluster is composed of a group of nodes, each of which is a physical or virtual server. Each node runs a container runtime, such as Docker or Containerd, and Kubernetes components, such as kubelet and kube-proxy. Overall, it is a group of coordinated nodes that together form an environment for deploying and managing containerized applications. |
| Namespace | A smaller resource space that is isolated under a project and is also a workspace for users to implement job production. Multiple namespaces can be created under a project, and the total resource quota that can be occupied cannot exceed the project quota. By dividing the resource quota more finely, namespaces also limit the size of containers (CPU, memory) under the namespace, effectively improving resource utilization. |
The relationship between clusters, projects, and namespaces is as follows:
A project can occupy the resources (CPU, memory, storage) of multiple clusters, and a cluster can be associated with multiple projects.
Multiple namespaces can be created under a project, and the total resource quota of multiple namespaces cannot exceed the total project resource quota.
A namespace’s resource quota can only come from a single cluster, and a namespace can only belong to one project.
Scenario Planning
This section aims to showcase widely adopted solutions for project and namespace planning in the industry, and provide references for your actual business planning. You can flexibly allocate resource planning according to business needs. By referring to the content of this section, you can customize practical strategies that suit your organization.
Business Isolation Mode
When enterprises carry out large-scale projects, they need to isolate and manage different business lines to ensure that each business line can independently develop and deploy, while also ensuring the reliability and stability of the system. For example, when developing a large functional module, the module will be treated as a separate project, and a namespace will be created under the project to allocate environment resources for the development, testing, and product personnel of the module.
In the business development mode, you can regard each business line as an independent project in the platform, developed and maintained by independent business teams. Business leaders create independent isolation environments for each project by creating namespaces for the platform.
-
Platform administrators allocate business resources: Platform administrators uniformly manage the resource allocation of each business line.
-
Business leaders allocate namespace resources: Business leaders plan the resource allocation under the namespace and add namespace administrators to facilitate resource isolation in various development environments. You can also allocate already allocated resources according to the degree of resource demand:
-
When resources are abundant: Platform administrators allocate one or more independent clusters for each business team, and business leaders allocate namespace resources according to business needs as project administrators. The advantage is independent resources, simple structure, easy management, and avoidance of mutual influence between different business components as they are in independent clusters.
-
When resources are limited: Platform administrators collaborate to allocate resources based on the total amount of resources required by business leaders, and create cross-cluster projects to allocate resources of multiple clusters reasonably. The advantage is that cluster resources can be fully utilized, cost is saved, and applications in different namespaces under the same cluster can be accessed conveniently through internal routing, making the usage scenarios more diverse.
-
Organization Isolation Mode
Organization isolation mode refers to isolating different organizations or teams so that they can independently develop, test, and deploy software. For example, a subsidiary can be managed as a separate project and namespaces can be created under the project, with the head of the subsidiary responsible for allocating environment resources to different teams within the subsidiary.
-
Platform administrators allocate organizational resources: Platform administrators manage the resource allocation of each subsidiary and create different projects for each subsidiary.
-
Head of subsidiary allocates namespace resources: The head of the subsidiary plans the resource allocation under the namespace and adds namespace administrators to facilitate resource isolation in different development environments. Resources can be allocated according to demand:
-
When resources are abundant: Platform administrators allocate one or more independent clusters to each subsidiary, and the head of the subsidiary, as the project administrator, allocates namespace resources according to business needs. The advantage of this approach is that resources are independent, the structure is simple, and it is easy to manage. Since each subsidiary is in an independent cluster, it avoids the impact of different business components on each other.
-
When resources are limited: Platform administrators collaborate with the head of the subsidiary to allocate resources based on the total amount of resources required, and create cross-cluster projects to allocate resources from multiple clusters reasonably. The advantage of this approach is that cluster resources can be fully utilized, managed centrally, and cost-effective. Applications in different namespaces under the same cluster can also be accessed conveniently through internal routing, making it more versatile.
-