Multi-tenant multi-k8s cluster timing operation management method
By adopting a multi-level management architecture in multi-tenant multi-Kubernetes clusters, the problems of inconsistent task scheduling and difficult status synchronization in scheduled job management are solved, unified management and efficient status monitoring of multi-tenant clusters are realized, and the scalability of the system is improved. sex and stability.
Patent Information
- Application Number
- CN202410854164.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-28
- Publication Date
- 2024-10-18
AI Technical Summary
In a multi-tenant multi-Kubernetes cluster scenario, the management of scheduled jobs has problems such as inconsistent task scheduling and difficulty in status synchronization, resulting in insufficient management efficiency and reliability.
Adopting a multi-level management architecture, including seed clusters, management and control clusters and working clusters, the management and control cluster realizes the regular triggering of scheduled jobs and the delivery of sub-jobs. The working cluster executes and synchronizes the status to the management and control cluster, and then the management and control cluster synchronizes to the seed cluster. Achieve unified management of tenant scheduled jobs.
It improves the scalability and stability of the system, avoids the problem of inconsistent task scheduling, and realizes real-time monitoring and management of sub-job status, providing a more efficient and reliable scheduled job management service.
Smart Images

Figure CN118802441A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of multi-tenant multi-cluster management, and in particular to a multi-tenant multi-k8s cluster scheduled job management method. Background Art
[0002] With the widespread use of Kubernetes clusters, multi-cluster has become a trend, and cluster administrators often need to manage multiple Kubernetes clusters. Cloud platform vendors need to provide platform tenants with PaaS services for multi-cluster management. CronJob is a basic capability of Kubernetes clusters. In multi-tenant and multi-cluster scenarios, tenants' scheduled jobs are expected to be managed in a unified manner.
[0003] In order to solve the above problems, the present invention proposes a multi-tenant multi-k8s cluster scheduled job management method. Summary of the invention
[0004] In view of the above shortcomings of the prior art, the purpose of the invention is to provide a multi-tenant multi-Kubernetes cluster scheduled job management method and system, by establishing a multi-level management architecture, to achieve unified management of multi-tenant multi-Kubernetes clusters, improve the scalability and stability of the system. At the same time, the present invention also solves the problems of inconsistent task scheduling and difficult state synchronization, and provides users with a more efficient and reliable scheduled job management service.
[0005] The first aspect of the present invention provides a multi-tenant multi-k8s cluster scheduled job management method, comprising:
[0006] Step S1: Establish a multi-level management architecture on the cloud platform, including a seed cluster, a control cluster, and a working cluster;
[0007] Step S2: Implement regular triggering of scheduled jobs in the management and control cluster, and send sub-jobs to the working cluster;
[0008] Step S3: The working cluster executes the sub-job and synchronizes the sub-job status to the control cluster, which then synchronizes the sub-job status to the cloud platform seed cluster;
[0009] Step S4: Implement unified management of tenant scheduled jobs in the cloud platform seed cluster.
[0010] Furthermore, the seed cluster is used to manage the cluster to which the platform belongs and provide a user web management platform.
[0011] Furthermore, the control cluster is used to automatically create an independent cluster for a tenant on the cloud platform to manage multiple working clusters of the tenant on multiple cloud platforms.
[0012] Furthermore, the working cluster is used as a tenant's cluster to deploy the tenant's services.
[0013] Furthermore, the sub-job refers to a specific job executed in the working cluster.
[0014] Furthermore, the step S2 implements the periodic triggering of scheduled jobs in the control cluster, and the triggering logic of the scheduled jobs that sends sub-jobs to the working cluster is independent of the cloud platform seed cluster and only depends on the control cluster.
[0015] Furthermore, the step S3: the working cluster executes the sub-job and synchronizes the sub-job status to the management and control cluster, which is then synchronized by the management and control cluster to the cloud platform seed cluster of the cloud platform seed cluster; unified management of tenant scheduled jobs is realized, including creation, deletion, modification, query and sub-job execution information query and stop functions.
[0016] Furthermore, in step S3, the k8s resources of the control cluster are used as a medium.
[0017] Furthermore, the unified management of tenant scheduled jobs in the cloud platform seed cluster in S4 includes creation, deletion, modification, and query.
[0018] Furthermore, the unified management of tenant scheduled jobs in the cloud platform seed cluster in S4 also includes sub-job execution information query and stop functions.
[0019] The beneficial effects of the present invention are as follows:
[0020] By establishing a multi-level management architecture, unified management of multi-tenant and multi-Kubernetes clusters is achieved, improving the scalability and stability of the system; by triggering and scheduling scheduled jobs in the control cluster, the problem of inconsistent task scheduling is avoided; through the status synchronization mechanism between the working cluster and the control cluster, real-time monitoring and management of sub-job status is achieved. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The accompanying drawings are only used to illustrate specific embodiments and are not considered to limit the present invention. In the entire drawings, the same reference symbols represent the same components. Obviously, the drawings described below are only some embodiments recorded in the embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained based on these drawings.
[0022] Figure 1 This is a flow chart of a multi-tenant multi-k8s cluster scheduled job management method according to an embodiment of the present invention;
[0023] Figure 2 This is a diagram of a cloud platform - multi-tenant multi-cluster unified management architecture according to an embodiment of the present invention;
[0024] Figure 3 This is a diagram of a unified management architecture for multi-tenant and multi-cluster operations according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present invention, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, rather than all of the embodiments. It should be understood that these descriptions are only exemplary and are not intended to limit the scope of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in the field without making creative work should fall within the scope of protection of the present invention.
[0026] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in the present invention.
[0027] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the orientation or position relationship indicated by the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inside", "outside", etc. is based on the orientation or position relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation of the present invention. In addition, the terms "first", "second", and "third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The terms "installed", "connected", and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be a connection between the two elements. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0028] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Instead, they are merely examples of methods and systems consistent with some aspects of the present invention as detailed in the appended claims.
[0029] In the present invention, the management of multi-tenant scheduled jobs first requires the management of multiple clusters of tenants. The unified management of multi-tenant multi-cluster is divided into two levels:
[0030] The first layer is multi-cluster management for a single tenant. OCM (Open Cluster Management) is the mainstream implementation of multi-Kubernetes cluster management. Its architecture is as follows: Figure 1 OCM uses one cluster as the control (hub) cluster and other clusters as working (managed) clusters;
[0031] The second layer is the management of multiple tenants. The seed cluster of the cloud platform manages the control cluster of each tenant to indirectly manage the working cluster of each tenant. The overall architecture is as follows: Figure 2 .
[0032] Based on the multi-tenant and multi-cluster management architecture, the ability to uniformly manage scheduled jobs for each tenant is achieved.
[0033] The present invention proposes a multi-tenant multi-k8s cluster scheduled job management method, wherein there are multiple tenants on the cloud platform, and each tenant has multiple Kubernetes clusters. The scheduled jobs of the tenant multi-cluster require unified management capabilities, and the management functions include: creation, deletion, modification, query of scheduled jobs, query and stop of execution information of sub-jobs, etc.
[0034] Next, the present invention describes the following terms:
[0035] Seed cluster: the cluster to which the management platform belongs, providing a user web management platform
[0036] Management cluster: an independent cluster automatically created by the cloud platform for a tenant to manage multiple working clusters of the tenant on multiple cloud platforms
[0037] Working cluster: the tenant's cluster, where tenant services are deployed
[0038] Sub-job: A specific job executed in a working cluster.
[0039] Method Embodiment
[0040] See also Figure 1-Figure 3 The present invention provides a multi-tenant multi-k8s cluster scheduled job management method, comprising:
[0041] Step S1: Establish a multi-level management architecture on the cloud platform, including a seed cluster, a control cluster, and a working cluster;
[0042] Step S2: Implement regular triggering of scheduled jobs in the management and control cluster, and send sub-jobs to the working cluster;
[0043] Step S3: The working cluster executes the sub-job and synchronizes the sub-job status to the control cluster, which then synchronizes the sub-job status to the cloud platform seed cluster;
[0044] Step S4: Implement unified management of tenant scheduled jobs in the cloud platform seed cluster.
[0045] Furthermore, the step S2 implements the periodic triggering of scheduled jobs in the control cluster, and the triggering logic of the scheduled jobs that sends sub-jobs to the working cluster is independent of the cloud platform seed cluster and only depends on the control cluster.
[0046] Furthermore, the step S3: the working cluster executes the sub-job and synchronizes the sub-job status to the management and control cluster, which is then synchronized by the management and control cluster to the cloud platform seed cluster to realize unified management of tenant scheduled jobs in the cloud platform seed cluster, including creation, deletion, modification, query and sub-job execution information query and stop functions.
[0047] Furthermore, in step S3, the k8s resources of the control cluster are used as a medium.
[0048] Furthermore, the cloud platform seed cluster in S4 implements unified management of tenant scheduled jobs, including creation, deletion, modification, query, and sub-job execution information query and stop functions.
[0049] Specifically, it includes two stages: the sub-jobs of the tenant's scheduled job are regularly issued and the sub-jobs and their status are synchronized to the cloud platform.
[0050] Phase 1: Sub-jobs of tenant scheduled jobs are issued regularly
[0051] 1). Tenants edit scheduled jobs through the cloud platform management page and store them in the cloud platform seed cluster.
[0052] 2). The cloud platform sends a scheduled task (CronJob) to the management and control cluster to trigger sub-jobs regularly.
[0053] 3). Manage cluster scheduled tasks (CronJob) to trigger subtasks regularly, create working cluster resource synchronization applications, and synchronize sub-job details to the working cluster.
[0054] 4). The working cluster uses k8s capabilities to execute sub-jobs.
[0055] Phase 2: Synchronize the working cluster sub-jobs and their status to the cloud platform
[0056] 1) The working cluster synchronizes the sub-job status to the control cluster
[0057] 2). The cloud platform seed cluster monitors the application creation and status update events of the management and control cluster, and synchronizes the sub-job creation and status update information to the cloud platform seed cluster in real time.
[0058] In summary, the present invention realizes unified management of multi-tenant and multi-Kubernetes clusters by establishing a multi-level management architecture, thereby improving the scalability and stability of the system; by realizing the triggering and scheduling of scheduled jobs in the control cluster, the problem of inconsistent task scheduling is avoided; through the state synchronization mechanism between the working cluster and the control cluster, real-time monitoring and management of the sub-job status is realized.
[0059] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, rather than to limit them. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that they can still modify the technical solutions recorded in the above embodiments, or replace some of the technical features therein by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention. Any changes or replacements that can be easily thought of by those skilled in the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.
Claims
1. A multi-tenant multi-k8s cluster scheduled job management method, characterized in that: include: Step S1: Establish a multi-level management architecture on the cloud platform, including a seed cluster, a control cluster, and a working cluster; Step S2: Implement regular triggering of scheduled jobs in the management and control cluster, and send sub-jobs to the working cluster; Step S3: The working cluster executes the sub-job and synchronizes the sub-job status to the control cluster, which then synchronizes the sub-job status to the cloud platform seed cluster; Step S4: Implement unified management of tenant scheduled jobs in the seed cluster of the cloud platform.
2. According to a multi-tenant multi-k8s cluster scheduled job management method according to claim 1, it is characterized in that: The seed cluster is used to manage the cluster to which the platform belongs and provide a user web management platform.
3. According to claim 2, a multi-tenant multi-k8s cluster scheduled job management method is characterized in that: The control cluster is used to automatically create an independent cluster for a tenant on the cloud platform to manage multiple working clusters of the tenant on multiple cloud platforms.
4. According to a multi-tenant multi-k8s cluster scheduled job management method according to claim 3, it is characterized in that: The working cluster is used as a tenant's cluster to deploy tenant services.
5. According to claim 4, a multi-tenant multi-k8s cluster scheduled job management method is characterized in that: The sub-job refers to a specific job executed in the working cluster.
6. According to a multi-tenant multi-k8s cluster scheduled job management method according to claim 5, it is characterized in that: The step S2 implements the regular triggering of scheduled jobs in the control cluster, and sends the sub-jobs to the working cluster. The triggering logic of the scheduled jobs is independent of the cloud platform seed cluster and only depends on the control cluster.
7. According to claim 6, a multi-tenant multi-k8s cluster scheduled job management method is characterized in that: The step S3: the working cluster executes the sub-job and synchronizes the sub-job status to the control cluster, which is then synchronized to the cloud platform seed cluster of the cloud platform seed cluster; unified management of tenant scheduled jobs is realized, including creation, deletion, modification, query and sub-job execution information query and stop functions.
8. According to claim 7, a multi-tenant multi-k8s cluster scheduled job management method is characterized in that: In step S3, the k8s resources of the control cluster are used as a medium.
9. A multi-tenant multi-k8s cluster scheduled job management method according to claim 8, characterized in that: The unified management of tenant scheduled jobs in the cloud platform seed cluster in S4 includes creation, deletion, modification, and query.
10. A multi-tenant multi-k8s cluster scheduled job management method according to claim 9, characterized in that: The unified management of tenant scheduled jobs in the cloud platform seed cluster in S4 also includes sub-job execution information query and stop functions.
