A method for deploying cluster services based on incubated middleware instances

By filtering shareable middleware instances in the k8s cluster and using these instances to deploy cluster services, the problems of cluster service deployment complexity and resource waste are solved, and efficient cluster service deployment and sharing and automatic uninstallation of middleware instances are achieved.

CN115766430BActive Publication Date: 2025-03-14CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211453019.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-03-14
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

In cluster service deployment, the prior art requires incubating independent middleware instances for each cluster service, resulting in increased deployment complexity and waste of resources, and it is difficult to efficiently share middleware instances to meet the needs of multiple cluster services.

Method used

By filtering shareable middleware instances in the k8s cluster and having a running status, using these instances to deploy cluster services, and uninstall them according to business needs, efficient sharing and automatic uninstallation of middleware instances are achieved.

Benefits of technology

This method significantly reduces the complexity and resource waste of cluster service deployment, improves cluster service deployment efficiency, and realizes accurate and efficient cluster service offloading in the middleware instance sharing architecture.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115766430B_ABST
    Figure CN115766430B_ABST
Patent Text Reader

Abstract

The present invention relates to the technical field of cluster service deployment, and provides a method for deploying cluster services based on incubated middleware instances, including: constructing basic information of cluster services, uploading installation resource files required by cluster services to a product center; screening middleware instances that can be shared and are in a running state in a k8s cluster; matching the middleware instances screened in step S2 according to the basic information of the middleware instances, and configuring the matched middleware instances; installing the installation resource files to the corresponding namespace according to the configured middleware instances, and executing the deployment of cluster services. The method for deploying cluster services based on incubated middleware instances according to an exemplary embodiment of the present invention can improve the efficiency of cluster service deployment, and realize accurate and efficient automatic uninstallation of successfully deployed cluster services according to business needs in an architecture shared by middleware instances.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of cluster service deployment, and in particular to a method for deploying cluster services based on incubated middleware instances. Background Art

[0002] In the scenario of cluster service deployment, a complete cluster service that can provide services to the outside world includes the cluster service itself and various middleware instances that need to be used. The current main solution is to incubate independent middleware instances for cluster services and perform subsequent middleware instance configuration. This method not only increases the complexity of cluster service deployment, but also requires the deployment of cluster services to focus not only on themselves but also on the deployment of dependent middleware instances, which greatly wastes cluster resources.

[0003] The middleware instance itself supports various levels of isolation and has various solutions for multiple users; cluster services are more concerned with using the capabilities provided by the middleware instance and do not require that the middleware instance be exclusive. Therefore, if multiple cluster services share a middleware instance, it can not only greatly save cluster resources and thus deploy more cluster services, but also improve the efficiency of cluster service deployment.

[0004] In practical applications, how to screen out middleware instances that meet the sharing requirements of cluster services, use them as dependent resources of cluster services, and accurately and efficiently uninstall successfully deployed cluster services according to business needs in the architecture of middleware instance sharing has become a technical problem that needs to be solved urgently. Summary of the invention

[0005] In view of this, in order to overcome the deficiencies of the prior art, the present invention provides a method for deploying cluster services based on an incubated middleware instance.

[0006] In one aspect, the present invention provides a method for deploying a cluster service based on an incubated middleware instance, comprising:

[0007] Step S1: Build the basic information of the cluster service and upload the installation resource files required by the cluster service to the product center;

[0008] Step S2: Filter the middleware instances that can be shared and are in running state in the k8s cluster;

[0009] Step S3: matching the middleware instance screened in step S2 according to the basic information of the middleware instance, and configuring the matched middleware instance;

[0010] Step S4: installing the installation resource file into the corresponding namespace according to the configured middleware instance, and executing the deployment of the cluster service.

[0011] Furthermore, in step S1 of the method for deploying a cluster service based on an incubated middleware instance of the present invention, the basic information of the cluster service includes a name and an authority level.

[0012] Furthermore, step S2 of the method for deploying cluster services based on incubated middleware instances of the present invention includes: screening middleware instances with shared tags and a running status of running in the k8s cluster.

[0013] Furthermore, in step S3 of the method for deploying cluster services based on incubated middleware instances of the present invention, the basic information of the middleware instance includes the type of the middleware, the specification description of the middleware instance, and the configuration parameters of the middleware instance.

[0014] Furthermore, step S3 of the method for deploying cluster services based on the incubated middleware instance of the present invention includes:

[0015] Step S31: matching a corresponding middleware instance among the middleware instances screened in step S2 according to the type of the middleware and the specification description of the middleware instance;

[0016] Step S32: Use the configuration parameters of the middleware instance to configure the matched middleware instance.

[0017] Furthermore, step S4 of the method for deploying cluster services based on the incubated middleware instance of the present invention includes:

[0018] Step S41: Rendering the corresponding resource file according to the permission level of the cluster service, and injecting the rendered resource file into the installation resource file;

[0019] Step S42: Create a namespace according to the name in the basic information of the cluster service;

[0020] Step S43: using the connection information of the middleware instance configured in step S32 as a parameter of the installation resource file, and installing the installation resource file into the corresponding namespace using the parameter;

[0021] Step S44: cyclically checking the deployment status of the cluster service. When the deployment of the cluster service reaches the deployment time threshold but is not completed, the deployment status of the cluster service is updated to deployment failure. When the deployment of the cluster service is completed, the deployment status of the cluster service is updated to deployment success.

[0022] Furthermore, the method for deploying cluster services based on incubated middleware instances of the present invention further includes: uninstalling the cluster services deployed in step S4 according to business requirements.

[0023] Furthermore, in the method for deploying cluster services based on the incubated middleware instance of the present invention, the cluster services deployed in step S4 are uninstalled according to business requirements, including:

[0024] Determine whether the middleware instance corresponding to the cluster service to be uninstalled is isolated, and delete the middleware instance according to the determination result;

[0025] Delete all resources in the corresponding namespace in the k8s cluster according to the name of the cluster service, and delete the corresponding namespace.

[0026] Furthermore, in the method for deploying cluster services based on incubated middleware instances of the present invention, it is determined whether the middleware instance corresponding to the cluster service to be uninstalled is isolated, and the middleware instance is deleted according to the determination result, including:

[0027] If the middleware instance is used by other cluster services at the same time, remove the configuration corresponding to the cluster service to be uninstalled in the middleware instance;

[0028] If the middleware instance is not used by other cluster services, all resources corresponding to the middleware instance in the k8s cluster are deleted.

[0029] On the other hand, the present invention also provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the steps of the method are implemented when the processor executes the program.

[0030] The method for deploying cluster services based on incubated middleware instances of the present invention has the following beneficial effects:

[0031] 1. By screening the sharable and running middleware instances in the k8s cluster, the cluster service does not need to re-incubate the middleware instances, which optimizes the utilization efficiency of the middleware instances in the cluster and improves the cluster service deployment efficiency.

[0032] 2. By judging whether the middleware instance corresponding to the cluster service that needs to be uninstalled is isolated, the middleware instance is deleted according to the judgment result, and the cluster service in the k8s cluster is deleted according to the name of the cluster service. In this way, the successfully deployed cluster services can be automatically uninstalled accurately and efficiently according to business needs in the architecture of middleware instance sharing. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 The flowchart is a method for deploying cluster services based on an incubated middleware instance according to the first exemplary embodiment of the present invention.

[0035] Figure 2 The flowchart is a method for deploying cluster services based on an incubated middleware instance according to the second exemplary embodiment of the present invention.

[0036] Figure 3 It is a flowchart of a method for deploying cluster services based on an incubated middleware instance according to the third exemplary embodiment of the present invention. DETAILED DESCRIPTION

[0037] The embodiments of the present invention are described in detail below with reference to the accompanying drawings.

[0038] It should be noted that the following embodiments and features in the embodiments may be combined with each other in the absence of conflict; and, based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making any creative work are within the scope of protection of the present disclosure.

[0039] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.

[0040] Figure 1 FIG. 1 is a flow chart of a method for deploying a cluster service based on an incubated middleware instance according to an exemplary first embodiment of the present invention. Figure 1 As shown, the method of this embodiment includes:

[0041] Step S1: Build the basic information of the cluster service and upload the installation resource files required by the cluster service to the product center;

[0042] Step S2: Filter the middleware instances that can be shared and are in running state in the k8s cluster;

[0043] Step S3: matching the middleware instance screened in step S2 according to the basic information of the middleware instance, and configuring the matched middleware instance;

[0044] Step S4: installing the installation resource file into the corresponding namespace according to the configured middleware instance, and executing the deployment of the cluster service.

[0045] In actual application, in step S1 of the method of this embodiment, the basic information of the cluster service includes the name and permission level. Step S2 of the method of this embodiment includes: screening middleware instances with shared tags and running status in the k8s cluster. In step S3 of the method of this embodiment, the basic information of the middleware instance includes the type of the middleware, the specification description of the middleware instance, and the configuration parameters of the middleware instance.

[0046] In the method of this embodiment, by screening the sharable and running middleware instances in the k8s cluster, the cluster service does not need to re-hatch the middleware instances, while optimizing the utilization efficiency of the middleware instances in the cluster and improving the cluster service deployment efficiency.

[0047] Figure 2 is a flowchart of a method for deploying cluster services based on an incubated middleware instance according to an exemplary second embodiment of the present invention. Figure 1 The preferred embodiment of the method shown is as follows Figure 2 As shown, step S3 of the method of this embodiment includes:

[0048] Step S31: matching a corresponding middleware instance among the middleware instances screened in step S2 according to the type of the middleware and the specification description of the middleware instance;

[0049] Step S32: Use the configuration parameters of the middleware instance to configure the matched middleware instance.

[0050] Figure 3 is a flowchart of a method for deploying cluster services based on an incubated middleware instance according to an exemplary third embodiment of the present invention. Figure 1 The preferred embodiment of the method shown is as follows Figure 3 As shown, step S4 of the method of this embodiment includes:

[0051] Step S41: Rendering the corresponding resource file according to the permission level of the cluster service, and injecting the rendered resource file into the installation resource file;

[0052] Step S42: Create a namespace according to the name in the basic information of the cluster service;

[0053] Step S43: using the connection information of the middleware instance configured in step S32 as a parameter of the installation resource file, and installing the installation resource file into the corresponding namespace using the parameter;

[0054] Step S44: cyclically checking the deployment status of the cluster service. When the deployment of the cluster service reaches the deployment time threshold but is not completed, the deployment status of the cluster service is updated to deployment failure. When the deployment of the cluster service is completed, the deployment status of the cluster service is updated to deployment success.

[0055] The fourth exemplary embodiment of the present invention provides a method for deploying a cluster service based on an incubated middleware instance. Figure 1 The preferred embodiment of the method shown, the method of this embodiment further includes: uninstalling the cluster service deployed in step S4 according to business needs.

[0056] In practical applications, the method of this embodiment is implemented in the following manner:

[0057] Determine whether the middleware instance corresponding to the cluster service that needs to be uninstalled is isolated, and delete the middleware instance according to the judgment result. Specifically, if the middleware instance is used by other cluster services at the same time, remove the configuration corresponding to the cluster service that needs to be uninstalled in the middleware instance; if the middleware instance is not used by other cluster services, delete all resources corresponding to the middleware instance in the k8s cluster.

[0058] Delete all resources in the corresponding namespace in the k8s cluster according to the name of the cluster service, and delete the corresponding namespace.

[0059] The method of this embodiment determines whether the middleware instance corresponding to the cluster service that needs to be uninstalled is isolated, deletes the middleware instance according to the determination result, and deletes the cluster service in the k8s cluster according to the name of the cluster service. This can realize accurate and efficient automatic uninstallation of successfully deployed cluster services according to business needs in an architecture where middleware instances are shared.

[0060] Finally, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps of the method for deploying cluster services based on an incubated middleware instance of the present invention are implemented.

[0061] The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims

1. A method for deploying a cluster service based on an incubated middleware instance, characterized in that: The method comprises: Step S1: Build the basic information of the cluster service and upload the installation resource files required by the cluster service to the product center; Step S2: Filter the middleware instances that can be shared and are in running state in the k8s cluster; Step S3: matching the middleware instance screened in step S2 according to the basic information of the middleware instance, and configuring the matched middleware instance; Step S4: installing the installation resource file into the corresponding namespace according to the configured middleware instance, and executing the deployment of the cluster service; In step S3, the basic information of the middleware instance includes the type of the middleware, the specification description of the middleware instance, and the configuration parameters of the middleware instance; Step S3 includes: Step S31: matching a corresponding middleware instance among the middleware instances screened in step S2 according to the type of the middleware and the specification description of the middleware instance; Step S32: Use the configuration parameters of the middleware instance to configure the matched middleware instance.

2. The method for deploying cluster services based on an incubated middleware instance according to claim 1, characterized in that: In step S1, the basic information of the cluster service includes a name and an authority level.

3. The method for deploying cluster services based on an incubated middleware instance according to claim 1, characterized in that: Step S2 includes: screening middleware instances with shared tags and a running status of running in the k8s cluster.

4. The method for deploying cluster services based on an incubated middleware instance according to claim 1, characterized in that: Step S4 comprises: Step S41: Rendering the corresponding resource file according to the permission level of the cluster service, and injecting the rendered resource file into the installation resource file; Step S42: Create a namespace according to the name in the basic information of the cluster service; Step S43: using the connection information of the middleware instance configured in step S32 as a parameter of the installation resource file, and installing the installation resource file into the corresponding namespace using the parameter; Step S44: cyclically checking the deployment status of the cluster service. When the deployment of the cluster service reaches the deployment time threshold but is not completed, the deployment status of the cluster service is updated to deployment failure. When the deployment of the cluster service is completed, the deployment status of the cluster service is updated to deployment success.

5. The method for deploying cluster services based on an incubated middleware instance according to claim 1, characterized in that: The method further includes: uninstalling the cluster service deployed in step S4 according to business requirements.

6. The method for deploying cluster services based on an incubated middleware instance according to claim 5, characterized in that: Uninstall the cluster service deployed in step S4 according to business needs, including: Determine whether the middleware instance corresponding to the cluster service to be uninstalled is isolated, and delete the middleware instance according to the determination result; Delete all resources in the corresponding namespace in the k8s cluster according to the name of the cluster service, and delete the corresponding namespace.

7. The method for deploying cluster services based on an incubated middleware instance according to claim 6, characterized in that: Determine whether the middleware instance corresponding to the cluster service to be uninstalled is isolated, and delete the middleware instance according to the determination result, including: If the middleware instance is used by other cluster services at the same time, remove the configuration corresponding to the cluster service to be uninstalled in the middleware instance; If the middleware instance is not used by other cluster services, all resources corresponding to the middleware instance in the k8s cluster are deleted.

8. A computer device, characterized in that: The computer device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 7 when executing the program.

Citation Information

Patent Citations

  • Method for scheduling shared computing resources, shared computing system, server and storage medium

    CN109688222A

  • Service development and realization method and device based on shared service, platform and medium

    CN109710236A