CN116382852A - Micro-service deployment method and device, electronic equipment and medium - Google Patents

Micro-service deployment method and device, electronic equipment and medium Download PDF

Info

Publication number
CN116382852A
CN116382852A CN202310383469.7A CN202310383469A CN116382852A CN 116382852 A CN116382852 A CN 116382852A CN 202310383469 A CN202310383469 A CN 202310383469A CN 116382852 A CN116382852 A CN 116382852A
Authority
CN
China
Prior art keywords
deployment
service
target
cluster
micro
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310383469.7A
Other languages
Chinese (zh)
Inventor
邵凯
刘涛
罗刚
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Baidu com Times Technology Beijing Co Ltd
Original Assignee
Baidu com Times Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Baidu com Times Technology Beijing Co Ltd filed Critical Baidu com Times Technology Beijing Co Ltd
Priority to CN202310383469.7A priority Critical patent/CN116382852A/en
Publication of CN116382852A publication Critical patent/CN116382852A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45562Creating, deleting, cloning virtual machine instances
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/455Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
    • G06F9/45533Hypervisors; Virtual machine monitors
    • G06F9/45558Hypervisor-specific management and integration aspects
    • G06F2009/45595Network integration; Enabling network access in virtual machine instances

Abstract

The disclosure provides a micro-service deployment method, a micro-service deployment device, electronic equipment and a micro-service deployment medium, relates to the technical field of artificial intelligence, and particularly relates to the field of cloud computing. The micro-service deployment method provided by the present disclosure includes: acquiring target micro-services to be deployed, at least two deployment groups associated with the target micro-services, cluster configuration information of each deployment group, and service deployment sequences among different deployment groups; determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters; and deploying the target micro-service to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment sequence. The method and the device can simplify the micro-service deployment flow, improve the micro-service deployment efficiency, reduce the micro-service deployment cost and ensure the availability of the micro-service.

Description

Micro-service deployment method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of artificial intelligence, and in particular, to the field of cloud computing.
Background
Microservices are an architectural style, a complex business system can be split into one or more microservices, each microservice in the system can be deployed independently, and each microservice is loosely coupled. As cloud computing technology tends to mature, micro-services may migrate into cloud environments for deployment, operation. To improve service stability, micro services that make up a complex service system may be deployed to multiple clusters.
In the related art, a plurality of micro services forming a complex service system are deployed to a plurality of clusters in a manual intervention manner, each cluster is connected manually, and then deployment operation is performed sequentially. Because of the high complexity of the micro-service deployment operation, there are a large number of repetitive operations in the process. The deployment mode has the problems of high deployment cost and low deployment efficiency, and repeated manual operation is easy to introduce errors and can influence the availability of micro services.
Disclosure of Invention
The disclosure provides a micro-service deployment method, a micro-service deployment device, electronic equipment and a medium.
According to an aspect of the present disclosure, there is provided a micro-service deployment method, the method including:
acquiring target micro-services to be deployed, at least two deployment groups associated with the target micro-services, cluster configuration information of each deployment group, and service deployment sequences among different deployment groups;
determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters;
and deploying the target micro-service to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment sequence.
According to another aspect of the present disclosure, there is provided a micro-service deployment apparatus, the apparatus comprising:
the system comprises a deployment data acquisition module, a service deployment module and a service deployment module, wherein the deployment data acquisition module is used for acquiring target micro-services to be deployed, at least two deployment groups associated with the target micro-services, cluster configuration information of each deployment group and service deployment sequences among different deployment groups;
the target cluster determining module is used for determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters;
and the service deployment module is used for deploying the target micro-service to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment sequence.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the micro-service deployment method of any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing a computer to perform the micro-service deployment method according to any of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the micro-service deployment method of any embodiment of the present disclosure.
According to the technology disclosed by the invention, the micro-service deployment flow can be simplified, the micro-service deployment efficiency is improved, the micro-service deployment cost is reduced, and the availability of the micro-service is ensured.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The drawings are for a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is a flow chart of a micro-service deployment method provided in accordance with an embodiment of the present disclosure;
FIG. 2 is a flow chart of another micro-service deployment method provided in accordance with an embodiment of the present disclosure;
FIG. 3 is a flow chart of another micro-service deployment method provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of a micro-service deployment device provided in accordance with an embodiment of the present disclosure;
fig. 5 is a block diagram of an electronic device used to implement a micro-service deployment method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a flowchart of a micro service deployment method provided according to an embodiment of the present disclosure, which is applicable to a case where a micro service is deployed into a plurality of clusters. The method can be performed by a micro-service deployment device, which can be implemented in software and/or hardware and configured for contractual services. As shown in fig. 1, the micro-service deployment method of the present embodiment may include:
s101, acquiring target micro-services to be deployed, at least two deployment groups associated with the target micro-services, cluster configuration information of each deployment group and service deployment sequences among different deployment groups;
s102, determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters;
S103, the target micro-service is deployed to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment sequence.
The target micro-service refers to the micro-service which needs to be deployed. Alternatively, the target micro-service is a distributed micro-service that needs to be deployed into multiple clusters.
The target micro-service is associated with at least two deployment groups, wherein the deployment groups are the minimum granularity for micro-service deployment. The deployment group records at least a correspondence between the target micro-service and the target cluster.
The target cluster is generated in a candidate cluster, the candidate cluster can be used for deploying the target micro-service, the target cluster refers to a candidate cluster which is expected to be deployed by the target micro-service, and the target cluster can be specified in the candidate cluster according to actual service requirements and is not limited herein. Alternatively, the candidate clusters are distributed clusters. Illustratively, the candidate clusters may be container clusters, such as Kubernetes (k 8 s) clusters. Further, the candidate clusters may be distributed in different areas such as Hangzhou, beijing, guangzhou, and the like.
The number of target clusters may be determined based on the number of deployment groups. Alternatively, one deployment group corresponds to one target cluster, that is, one deployment group records only one group of correspondence. How many deployment groups the target microservice is associated with indicates how many clusters the target microservice needs to be deployed into.
It is appreciated that prior to deploying the target microservice to multiple clusters, a differentiated configuration of the different clusters is required. The cluster configuration information of the deployment group is customized for the target cluster corresponding to the deployment group. The target cluster corresponding to the deployment group may be configured based on cluster configuration information of the deployment group.
In deploying a target micro-service to multiple clusters, especially in the context of gray scale delivery of micro-services, special attention needs to be paid to the order in which the target micro-services are deployed to the target clusters. The order in which the target micro-services are deployed to the target cluster may be determined based on the order of service deployment among the different deployment groups.
Optionally, the micro-service deployment method provided by the embodiment of the present disclosure is executed by a service deployment platform, where the service deployment platform supports user-customized cluster configuration information and a service deployment flow. Under the condition that a user has micro service deployment requirements, the target micro service to be deployed, cluster configuration information of each deployment group and service deployment sequences among different deployment groups are submitted to the service deployment platform only through a visual interface of the micro service deployment platform in the form of deployment groups. The service deployment platform may extract a cluster identifier from the deployment group, and then determine a target cluster from the candidate clusters according to the cluster identifier extracted from the deployment group. Then, the target micro-service is deployed to the target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment order.
According to the embodiment of the disclosure, the deployment group is used as the minimum granularity for deploying the target micro-service into a plurality of clusters, the cluster configuration information is customized for the target clusters aiming at the deployment group, the cluster differentiated configuration is realized, and the service deployment flow is cured by setting the service deployment sequence among different deployment groups. Based on the cluster configuration information of the deployment group and the service deployment sequence, the target micro-service is deployed to the target clusters corresponding to the deployment group, so that the target micro-service is deployed to a plurality of target clusters by one key, the micro-service deployment efficiency is improved, and the micro-service deployment cost is reduced. In the embodiment of the disclosure, the cluster configuration process does not need manual intervention, so that manual operation is avoided, and the availability of micro services is ensured.
In an alternative embodiment, after the target micro-service is deployed to the target cluster corresponding to the deployment group, the method further includes: configuring a flow distribution rule for a target cluster corresponding to the deployment group according to the cluster function corresponding to the deployment group; distributing the service access request to the corresponding target cluster based on the traffic distribution rule of the target cluster; wherein the cluster function includes: at least one of a test function, a verification function, a basic service function, and a member service function.
Optionally, the deployment group further records a correspondence between the target cluster and the cluster functions. Optionally, the deployment group is a triplet composed of the target micro-service, the target cluster, and the cluster function. Illustratively, the deployment group may be expressed as < micro-service ID, cluster ID, function ID >. Wherein the micro-service ID is used to uniquely represent the micro-service, and different micro-services can be distinguished based on the micro-service ID. The cluster ID is used to determine a target cluster among the candidate clusters. According to the deployment group to which the function ID and the cluster ID belong, the cluster function of the target cluster can be determined.
Wherein the cluster function is used for determining the traffic distribution rule of the target cluster. Based on the traffic distribution rules of the target cluster, the traffic type flowing to the target cluster may be determined. Optionally, the service access request is distributed to the corresponding target cluster according to the traffic type to which the service access request belongs.
Optionally, the cluster functions include: at least one of a test function, a verification function, a basic service function, and a member service function. The testing function is used for performing downlink testing joint debugging on the target micro-service. Real traffic generated on line does not enter a target cluster providing a test function, and test traffic generated off line enters such a target cluster; the verification function is used for simulating a scene of the target micro-service providing service outside, and checking and verifying the target micro-service before the target micro-service is online. The real traffic generated on-line does not enter the target cluster providing the verification function; the basic service function and the member service function are used for the scene of formally providing services to the outside by the target micro-service. The basic service function is used for providing basic service to the outside, and real traffic generated on line enters a target cluster providing the basic service function by default. The member service function is used for providing member service to the outside, and the online generated member traffic enters a target cluster for providing the member service function.
Alternatively, the cluster functions of different target clusters may be the same or different, and specifically determined according to actual service requirements. Illustratively, the target cluster includes: beijing cluster, hangzhou cluster, and Guangzhou cluster. The cluster functions include: at least one of a test function, a verification function, a basic service function, and a member service function. The cluster functions of the Guangzhou cluster can be deployed as both a base service function and a member service function. The cluster function of the Hangzhou cluster is deployed as a test function. Beijing clusters may also be used as test functions with Hangzhou clusters. Different cluster functions can be deployed in the same cluster because one cluster includes thousands of computing nodes, which are independent of each other and are interconnected by a high-speed network.
According to the technical scheme, the deployment group is used as the minimum granularity, and the target micro-service is deployed into a plurality of clusters. And customizing a cluster function for a target cluster aiming at the deployment group, and determining a flow distribution rule for the target cluster according to the cluster function, so that flow isolation among different clusters is realized, the mutual influence among different clusters is avoided, and the availability of the micro-service is improved.
FIG. 2 is a flow chart of another micro-service deployment method provided in accordance with an embodiment of the present disclosure; this embodiment is an alternative to the embodiments described above.
Referring to fig. 2, the micro service deployment method provided in this embodiment includes:
s201, obtaining a target micro-service to be deployed, at least two deployment groups associated with the target micro-service, cluster configuration information of each deployment group and service deployment sequences among different deployment groups.
S202, determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters.
S203, configuring a target cluster corresponding to the deployment group according to cluster configuration information of the deployment group.
The deployment group records the corresponding relation between the target micro-service and the target cluster. Each deployment group has a target cluster corresponding to it. The cluster configuration information of the deployment group is used for configuring a target cluster corresponding to the deployment group.
The cluster configuration information and the target clusters are in one-to-one correspondence, that is, the cluster configuration information of the deployment group can only be used for configuring the target clusters corresponding to the deployment group and cannot be used for configuring other clusters.
The cluster configuration information includes differentiated configuration items required to deploy the target microservice into the target cluster.
For example, in the case where the target cluster belongs to a k8s cluster, the cluster configuration information of the target cluster may include the number of copies, pod resources, environment variables, and the like. The configuration information of the target cluster may also include a storage address where the target micro service image may be obtained, host port addresses and authentication information of various database software on which the target micro service depends, and the like. The cluster configuration information of the target cluster is not listed here, and is specifically determined according to the actual situation. For the commonality configuration items required for deploying the target micro-services into the target clusters, it is not necessary to record in the cluster configuration information provided to the service deployment platform.
S204, under the condition that the configuration of the target cluster is completed, the target micro-service is deployed to the target cluster corresponding to the deployment group according to the service deployment sequence.
The number of target clusters is at least two, and in the case that the configuration of the target clusters is completed. The service deployment platform deploys the target micro-service to the target clusters corresponding to the deployment groups in sequence according to the service deployment sequence among different deployment groups.
According to the technical scheme, the target clusters corresponding to the deployment groups are configured according to the cluster configuration information of the deployment groups, so that cluster configuration automation is realized, in addition, under the condition that the target cluster configuration is completed, the embodiment of the disclosure can deploy the target micro-service into the target clusters corresponding to the deployment groups based on the service deployment sequence among different deployment groups, thereby realizing one-key deployment of the target micro-service into a plurality of target clusters, improving the micro-service deployment efficiency and reducing the micro-service deployment cost. In the embodiment of the disclosure, the whole cluster configuration process does not need manual intervention, so that manual operation is avoided, and the availability of micro services is ensured.
In an alternative embodiment, configuring the target cluster corresponding to the deployment group according to the cluster configuration information of the deployment group includes: updating original configuration information of a target cluster corresponding to the deployment group according to the cluster configuration information of the deployment group to obtain new configuration information; and calling a resource management interface of the target cluster, and importing the new configuration information into the target cluster based on the resource management interface so as to generate a required target resource object for the target micro-service.
Wherein the cluster configuration information is critical data upon which the target micro-service is deployed into the target cluster. The resource management interface of the target cluster is used to update or create resource objects in the target cluster.
If the target micro-service is deployed into the target cluster for the first time, directly calling a resource management interface of the target cluster, and importing the new configuration information into the target cluster based on the resource management interface so as to create a target resource object required by the target micro-service for the target micro-service in the target cluster.
If the target micro-service has been deployed in the target cluster before, the service deployment platform updates the original configuration information of the target cluster according to the cluster configuration information of the deployment group to obtain new configuration information. Then, the resource management interface of the target cluster is called to update the target resource object required by the target micro-service. In the case where the target cluster is a k8s cluster, the resource management interface may be an API interface that the k8s cluster provides externally available for managing resource objects.
The target resource object is an infrastructure on which the target microservice runs in the target cluster. By way of example, in the case where the target cluster is a k8s cluster, the target resource object may be one or more of a namespace (namespace), a CloneSet controller, a policy Service, ingress processor for Pod logical grouping, and a configuration management component ConfigMap.
According to the technical scheme, the resource management interface of the target cluster is called, new configuration information is imported into the target cluster based on the resource management interface, so that a required target resource object is generated for the target micro-service, and the target micro-service is deployed into the target cluster. The user with micro service deployment requirement only needs to provide the differentiated configuration item of the cluster, the resource object file of the target cluster is not required to be maintained, the service deployment platform automatically generates the target resource object required by the target micro service, the deployment flow of the micro service is simplified, the user is prevented from manually editing the resource object file, the manual editing operation is reduced, the error caused by the manual execution of the cluster command operation by the user is avoided, the online service fault is avoided, and the availability of the micro service is ensured. In addition, by distinguishing the deployment condition of the target micro-service in the target cluster, the technical scheme obtains new configuration information on the basis of the original configuration information under the condition that the target cluster deploys the target micro-service, thereby reducing the invalid occupation of computing resources and improving the resource utilization rate in the service deployment process.
FIG. 3 is a flow chart of another micro-service deployment method provided in accordance with an embodiment of the present disclosure; this embodiment is an alternative to the embodiments described above.
Referring to fig. 3, the micro service deployment method provided in this embodiment includes:
s301, obtaining a target micro-service to be deployed, at least two deployment groups associated with the target micro-service, cluster configuration information of each deployment group and service deployment sequences among different deployment groups.
S302, determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters.
S303, configuring a target cluster corresponding to the deployment group according to cluster configuration information of the deployment group.
S304, under the condition that the configuration of the target clusters is completed, determining the deployment batch of the target clusters corresponding to the deployment group according to the service deployment sequence.
The order in which the target micro-services are deployed to the target cluster may be determined by the order in which the services are deployed between the different deployment groups.
In some business scenarios, such as in the scenario of gray scale delivery of micro services, in order to further improve service deployment efficiency, the target micro services may be deployed in batches into deployment batches of the target cluster. The deployment batches of the target clusters may be determined according to the service deployment order between different deployment groups. The determined deployment batches are then associated to the target clusters corresponding to the deployment group.
S305, based on the deployment batches of the target clusters corresponding to the deployment groups, deploying the target micro-services in a parallel mode in the target clusters belonging to the same deployment batch.
And the service deployment platform deploys the target micro-services in a parallel mode in the target clusters belonging to the same deployment batch according to the deployment batch associated with the target clusters. Optionally, the target micro-services are deployed in a serial fashion in target clusters belonging to different deployment batches. The number of target clusters included between different deployment batches is not correlated. The number of target clusters included in different deployment batches may be the same or different, and is specifically determined according to practical situations.
Illustratively, beijing and Hangzhou clusters belong to a first lot, guangzhou and Suzhou clusters belong to a second lot. According to the deployment batch of the target cluster, the target micro-service is deployed in the Beijing cluster and the Hangzhou cluster in a serial mode, and then the target micro-service is deployed in the Guangzhou cluster and the Suzhou cluster. For Beijing clusters and Hangzhou clusters belonging to the same first batch, the target micro-services are deployed simultaneously in a parallel mode. For both Guangzhou and Suzhou clusters belonging to the second lot, the target micro-services may also be deployed simultaneously in a parallel fashion. It will be understood, of course, that in some business scenarios where deployment efficiency is not a high requirement, target micro-services may also be deployed in a serial fashion in target clusters belonging to the same deployment lot.
According to the method and the device for deploying the micro-service, under the condition that the configuration of the target clusters is completed, the deployment batches of the target clusters corresponding to the deployment groups are determined according to the service deployment sequence, and the target micro-service is deployed in a parallel mode in the target clusters belonging to the same deployment batch based on the deployment batches of the target clusters corresponding to the deployment groups, so that the micro-service deployment efficiency is effectively improved.
In an alternative embodiment, based on a deployment lot of a target cluster corresponding to a deployment group, the target micro-service is deployed in a parallel manner in the target cluster belonging to the same deployment lot, including: monitoring the deployment progress of the target micro-service in the target cluster; if the target micro-service is deployed in the target cluster of the current deployment batch, suspending the deployment of the target micro-service, and verifying the service deployment condition of the current deployment batch; and under the condition that service deployment condition verification is passed, continuing to deploy the target micro service until the target micro service is deployed in the target cluster of the last deployment batch.
In order to give consideration to the deployment effect and the deployment efficiency of the target micro-service, the deployment progress of the target micro-service in the target cluster is monitored in the process of deploying the target micro-service in a parallel mode in the target cluster belonging to the same deployment batch.
If the target micro-service is deployed in the target cluster of the current deployment lot, the target micro-service is suspended from being deployed, and the service deployment condition of the current deployment lot is verified instead of deploying the target micro-service in the target cluster of the next deployment lot, so as to check whether the service deployment condition of the current deployment lot reaches the expected condition.
If the service deployment condition verification is passed, the service deployment condition of the current deployment batch is expected, and the target micro service can be continuously deployed in the target cluster of the next deployment batch until the target micro service is completed in the target cluster of the last deployment batch.
According to the technical scheme, the suspension operation and the verification operation are supported in the deployment process of the target micro-service, specifically, the deployment progress of the target micro-service in the target cluster is monitored in the process of deploying the target micro-service in a parallel mode in the target cluster belonging to the same deployment batch, when the target micro-service is already deployed in the target cluster of the current deployment batch, the service deployment condition of the current deployment batch is verified, and the target micro-service is continuously deployed only when the service deployment condition verification is passed. According to the technical scheme, the deployment effect and the deployment efficiency of the target micro service are considered, and meanwhile, the flexibility of the micro service deployment process is guaranteed.
Fig. 4 is a schematic structural diagram of a micro service deployment apparatus according to an embodiment of the present disclosure. The embodiments of the present disclosure are applicable to situations where micro services are deployed into multiple clusters. The device can be implemented by software and/or hardware, and can implement the micro-service deployment method according to any embodiment of the disclosure.
As shown in fig. 4, the micro service deployment apparatus 400 includes:
a deployment data obtaining module 401, configured to obtain a target micro service to be deployed, at least two deployment groups associated with the target micro service, cluster configuration information of each deployment group, and a service deployment sequence between different deployment groups;
a target cluster determining module 402, configured to determine a target cluster that corresponds to the deployment group and that is expected to be deployed by a target micro-service from candidate clusters;
a service deployment module 403, configured to deploy the target micro-service to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment order.
According to the embodiment of the disclosure, the deployment group is used as the minimum granularity for deploying the target micro-service into a plurality of clusters, the cluster configuration information is customized for the target clusters aiming at the deployment group, the cluster differentiated configuration is realized, and the service deployment flow is cured by setting the service deployment sequence among different deployment groups. Based on the cluster configuration information of the deployment group and the service deployment sequence, the target micro-service is deployed to the target clusters corresponding to the deployment group, so that the target micro-service is deployed to a plurality of target clusters by one key, the micro-service deployment efficiency is improved, and the micro-service deployment cost is reduced. In the embodiment of the disclosure, the cluster configuration process does not need manual intervention, so that manual operation is avoided, and the availability of micro services is ensured.
Optionally, the service deployment module 403 includes: the cluster configuration sub-module is used for configuring a target cluster corresponding to the deployment group according to the cluster configuration information of the deployment group; and the service deployment sub-module is used for deploying the target micro-service to the target cluster corresponding to the deployment group according to the service deployment sequence under the condition that the configuration of the target cluster is completed.
Optionally, the cluster configuration submodule includes: a configuration updating unit, configured to update original configuration information of a target cluster corresponding to the deployment group according to cluster configuration information of the deployment group, so as to obtain new configuration information; and the configuration importing unit is used for calling a resource management interface of the target cluster, importing the new configuration information into the target cluster based on the resource management interface so as to generate a required target resource object for the target micro-service.
Optionally, the service deployment sub-module includes: the batch determining unit is used for determining the deployment batch of the target cluster corresponding to the deployment group according to the service deployment sequence under the condition that the configuration of the target cluster is completed; the service deployment unit is used for deploying the target micro-services in a parallel mode in the target clusters belonging to the same deployment batch based on the deployment batches of the target clusters corresponding to the deployment groups.
Optionally, the service deployment unit includes: the progress monitoring subunit is used for monitoring the deployment progress of the target micro-service in the target cluster; a deployment verification subunit, configured to suspend deployment of the target micro-service if the target micro-service has been deployed in the target cluster of the current deployment lot, and verify a service deployment condition of the current deployment lot; and the service deployment subunit is used for continuing to deploy the target micro-service under the condition that the service deployment condition verification is passed until the target micro-service is deployed in the target cluster of the last deployment batch.
Optionally, the apparatus further includes: the traffic distribution rule determining module is used for configuring traffic distribution rules for the target clusters corresponding to the deployment group according to the cluster functions corresponding to the deployment group after the target micro-service is deployed to the target clusters corresponding to the deployment group; the access request distribution module is used for distributing the service access requests to the corresponding target clusters based on the traffic distribution rules of the target clusters; wherein the cluster function includes: at least one of a test function, a verification function, a basic service function, and a member service function.
The micro-service deployment device provided by the embodiment of the disclosure can execute the micro-service deployment method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of executing the micro-service deployment method.
In the technical scheme of the disclosure, the related user information is collected, stored, used, processed, transmitted, provided, disclosed and the like, all conform to the regulations of related laws and regulations, and the public order is not violated.
According to embodiments of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
Fig. 5 illustrates a schematic block diagram of an example electronic device 500 that may be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 5, the electronic device 500 includes a computing unit 501 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 502 or a computer program loaded from a storage unit 508 into a Random Access Memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the electronic device 500 may also be stored. The computing unit 501, ROM 502, and RAM 503 are connected to each other by a bus 504. An input/output (I/O) interface 505 is also connected to bus 504.
A number of components in electronic device 500 are connected to I/O interface 505, including: an input unit 506 such as a keyboard, a mouse, etc.; an output unit 507 such as various types of displays, speakers, and the like; a storage unit 508 such as a magnetic disk, an optical disk, or the like; and a communication unit 509 such as a network card, modem, wireless communication transceiver, etc. The communication unit 509 allows the electronic device 500 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 501 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 501 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 501 performs the various methods and processes described above, such as the micro-service deployment method. For example, in some embodiments, the micro-service deployment method may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 508. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 500 via the ROM 502 and/or the communication unit 509. When the computer program is loaded into RAM 503 and executed by computing unit 501, one or more steps of the micro-service deployment method described above may be performed. Alternatively, in other embodiments, the computing unit 501 may be configured to perform the micro-service deployment method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable micro-service deployment device, such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
Artificial intelligence is the discipline of studying the process of making a computer mimic certain mental processes and intelligent behaviors (e.g., learning, reasoning, thinking, planning, etc.) of a person, both hardware-level and software-level techniques. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligent software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge graph technology and the like.
Cloud computing (cloud computing) refers to a technical system that a shared physical or virtual resource pool which is elastically extensible is accessed through a network, resources can comprise servers, operating systems, networks, software, applications, storage devices and the like, and resources can be deployed and managed in an on-demand and self-service mode. Through cloud computing technology, high-efficiency and powerful data processing capability can be provided for technical application such as artificial intelligence and blockchain, and model training.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel or sequentially or in a different order, provided that the desired results of the technical solutions of the present disclosure are achieved, and are not limited herein.
The above detailed description should not be taken as limiting the scope of the present disclosure. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present disclosure are intended to be included within the scope of the present disclosure.

Claims (15)

1. A method of micro-service deployment, the method comprising:
acquiring target micro-services to be deployed, at least two deployment groups associated with the target micro-services, cluster configuration information of each deployment group, and service deployment sequences among different deployment groups;
determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters;
and deploying the target micro-service to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment sequence.
2. The method of claim 1, wherein deploying the target micro-service to a target cluster corresponding to a deployment group based on cluster configuration information of the deployment group and the service deployment order comprises:
configuring a target cluster corresponding to the deployment group according to cluster configuration information of the deployment group;
And under the condition that the configuration of the target cluster is completed, deploying the target micro-service to the target cluster corresponding to the deployment group according to the service deployment sequence.
3. The method of claim 2, wherein configuring the target cluster corresponding to the deployment group according to cluster configuration information of the deployment group comprises:
updating original configuration information of a target cluster corresponding to the deployment group according to the cluster configuration information of the deployment group to obtain new configuration information;
and calling a resource management interface of the target cluster, and importing the new configuration information into the target cluster based on the resource management interface so as to generate a required target resource object for the target micro-service.
4. The method of claim 2, wherein deploying the target micro-service to the target cluster corresponding to the deployment group in the service deployment order, with the target cluster configuration completed, comprises:
under the condition that the configuration of the target clusters is completed, determining the deployment batch of the target clusters corresponding to the deployment group according to the service deployment sequence;
and based on the deployment batches of the target clusters corresponding to the deployment groups, deploying the target micro-services in a parallel mode in the target clusters belonging to the same deployment batch.
5. The method of claim 4, wherein deploying the target micro-services in parallel in target clusters belonging to the same deployment lot based on a deployment lot of target clusters corresponding to a deployment group comprises:
monitoring the deployment progress of the target micro-service in the target cluster;
if the target micro-service is deployed in the target cluster of the current deployment batch, suspending the deployment of the target micro-service, and verifying the service deployment condition of the current deployment batch;
and under the condition that service deployment condition verification is passed, continuing to deploy the target micro service until the target micro service is deployed in the target cluster of the last deployment batch.
6. The method of claim 1, after deploying the target micro-service to a target cluster corresponding to a deployment group, the method further comprising:
configuring a flow distribution rule for a target cluster corresponding to the deployment group according to the cluster function corresponding to the deployment group;
distributing the service access request to the corresponding target cluster based on the traffic distribution rule of the target cluster;
wherein the cluster function includes: at least one of a test function, a verification function, a basic service function, and a member service function.
7. A micro-service deployment device, the device comprising:
the system comprises a deployment data acquisition module, a service deployment module and a service deployment module, wherein the deployment data acquisition module is used for acquiring target micro-services to be deployed, at least two deployment groups associated with the target micro-services, cluster configuration information of each deployment group and service deployment sequences among different deployment groups;
the target cluster determining module is used for determining a target cluster which corresponds to the deployment group and is expected to be deployed by the target micro-service from the candidate clusters;
and the service deployment module is used for deploying the target micro-service to a target cluster corresponding to the deployment group based on the cluster configuration information of the deployment group and the service deployment sequence.
8. The apparatus of claim 7, wherein the service deployment module comprises:
the cluster configuration sub-module is used for configuring a target cluster corresponding to the deployment group according to the cluster configuration information of the deployment group;
and the service deployment sub-module is used for deploying the target micro-service to the target cluster corresponding to the deployment group according to the service deployment sequence under the condition that the configuration of the target cluster is completed.
9. The apparatus of claim 8, wherein the cluster configuration submodule comprises:
A configuration updating unit, configured to update original configuration information of a target cluster corresponding to the deployment group according to cluster configuration information of the deployment group, so as to obtain new configuration information;
and the configuration importing unit is used for calling a resource management interface of the target cluster, importing the new configuration information into the target cluster based on the resource management interface so as to generate a required target resource object for the target micro-service.
10. The apparatus of claim 8, wherein the service deployment sub-module comprises:
the batch determining unit is used for determining the deployment batch of the target cluster corresponding to the deployment group according to the service deployment sequence under the condition that the configuration of the target cluster is completed;
the service deployment unit is used for deploying the target micro-services in a parallel mode in the target clusters belonging to the same deployment batch based on the deployment batches of the target clusters corresponding to the deployment groups.
11. The apparatus of claim 10, wherein the service deployment unit comprises:
the progress monitoring subunit is used for monitoring the deployment progress of the target micro-service in the target cluster;
a deployment verification subunit, configured to suspend deployment of the target micro-service if the target micro-service has been deployed in the target cluster of the current deployment lot, and verify a service deployment condition of the current deployment lot;
And the service deployment subunit is used for continuing to deploy the target micro-service under the condition that the service deployment condition verification is passed until the target micro-service is deployed in the target cluster of the last deployment batch.
12. The apparatus of claim 7, the apparatus further comprising:
the traffic distribution rule determining module is used for configuring traffic distribution rules for the target clusters corresponding to the deployment group according to the cluster functions corresponding to the deployment group after the target micro-service is deployed to the target clusters corresponding to the deployment group;
the access request distribution module is used for distributing the service access requests to the corresponding target clusters based on the traffic distribution rules of the target clusters;
wherein the cluster function includes: at least one of a test function, a verification function, a basic service function, and a member service function.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the micro-service deployment method of any one of claims 1-6.
14. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the micro-service deployment method according to any one of claims 1-6.
15. A computer program product comprising a computer program which, when executed by a processor, implements the micro-service deployment method according to any of claims 1-6.
CN202310383469.7A 2023-04-11 2023-04-11 Micro-service deployment method and device, electronic equipment and medium Pending CN116382852A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310383469.7A CN116382852A (en) 2023-04-11 2023-04-11 Micro-service deployment method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310383469.7A CN116382852A (en) 2023-04-11 2023-04-11 Micro-service deployment method and device, electronic equipment and medium

Publications (1)

Publication Number Publication Date
CN116382852A true CN116382852A (en) 2023-07-04

Family

ID=86976626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310383469.7A Pending CN116382852A (en) 2023-04-11 2023-04-11 Micro-service deployment method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN116382852A (en)

Similar Documents

Publication Publication Date Title
CN109933405A (en) Virtual machine creation method and device, electronic equipment, storage medium
CN113766487B (en) Cloud mobile phone information acquisition method, device, equipment and medium
CN113037489B (en) Data processing method, device, equipment and storage medium
CN113032093B (en) Distributed computing method, device and platform
CN113641388A (en) Cloud mobile phone updating method, related device and computer program product
CN114070889B (en) Configuration method, traffic forwarding device, storage medium, and program product
CN114579311B (en) Method, device, equipment and storage medium for executing distributed computing task
CN115481594B (en) Scoreboard implementation method, scoreboard, electronic equipment and storage medium
CN114185641B (en) Virtual machine cold migration method and device, electronic equipment and storage medium
CN116382852A (en) Micro-service deployment method and device, electronic equipment and medium
CN114116288A (en) Fault processing method, device and computer program product
CN114389969A (en) Client test method and device, electronic equipment and storage medium
CN112559632A (en) Method, device, electronic equipment and medium for synchronizing state of distributed graph database
CN113656268B (en) Performance test method and device for business service, electronic equipment and storage medium
CN113360689B (en) Image retrieval system, method, related device and computer program product
CN116521199B (en) Component upgrading method, device, equipment and storage medium
CN114448802B (en) Gateway configuration method, device, electronic equipment and storage medium
CN114650222B (en) Parameter configuration method, device, electronic equipment and storage medium
CN117057411B (en) Large language model training method, device, equipment and storage medium
CN114116142A (en) Identification generation method and device, electronic equipment and storage medium
CN113886842A (en) Dynamic intelligent scheduling method and device based on test
CN116301978A (en) System upgrading method, device, equipment and storage medium
CN118036079A (en) Method, apparatus, electronic device, storage medium and computer program product for database access authorization
CN115454647A (en) Data processing method and device, equipment and medium
CN115913954A (en) Cluster management information interaction method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination