CN115617454A - Containerization service deployment method, device, equipment and storage medium - Google Patents

Containerization service deployment method, device, equipment and storage medium Download PDF

Info

Publication number
CN115617454A
CN115617454A CN202211204402.4A CN202211204402A CN115617454A CN 115617454 A CN115617454 A CN 115617454A CN 202211204402 A CN202211204402 A CN 202211204402A CN 115617454 A CN115617454 A CN 115617454A
Authority
CN
China
Prior art keywords
containerization
cluster
service
created
configuration information
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
CN202211204402.4A
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.)
Shanghai Pudong Development Bank Co Ltd
Original Assignee
Shanghai Pudong Development Bank 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 Shanghai Pudong Development Bank Co Ltd filed Critical Shanghai Pudong Development Bank Co Ltd
Priority to CN202211204402.4A priority Critical patent/CN115617454A/en
Publication of CN115617454A publication Critical patent/CN115617454A/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/16Error detection or correction of the data by redundancy in hardware
    • G06F11/20Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements
    • G06F11/202Error detection or correction of the data by redundancy in hardware using active fault-masking, e.g. by switching out faulty elements or by switching in spare elements where processing functionality is redundant
    • 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/4557Distribution of virtual machine instances; Migration and load balancing
    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2201/00Indexing scheme relating to error detection, to error correction, and to monitoring
    • G06F2201/815Virtual

Abstract

The invention discloses a containerization service deployment method, a device, equipment and a storage medium. The method comprises the following steps: acquiring configuration information and a deployment strategy of a containerization service to be created; splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services; after at least two containerized sub-services are deployed on at least two K8S clusters, the containerized sub-services deployed on each K8S cluster are spliced to obtain a target containerized cluster.

Description

Containerization service deployment method, device, equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a containerization service deployment method, a containerization service deployment device, equipment and a storage medium.
Background
Kubernetes (k 8s for short) is an open source container cluster management system. On the basis of a Docker technology (a container virtualization technology), k8s provides a series of complete functions such as deployment and operation, resource scheduling, service discovery, dynamic scaling and the like for a containerized service (also called an application), and convenience in large-scale container cluster management can be improved.
In the prior art, the deployment mode of the containerization service only supports deployment in a single K8S cluster, is limited by the resources and stability of the single K8S cluster, and has high coupling with the K8S cluster. Moreover, since the containerization service is deployed on a single K8S cluster, if the single K8S cluster fails, the containerization service may be unavailable.
Disclosure of Invention
Embodiments of the present invention provide a containerized service deployment method, apparatus, device, and storage medium, which solve the problems of limited resources and stability of a single K8S cluster and high coupling between a containerized service and the K8S cluster, and also solve the problem that the containerized service is unavailable due to the fact that the containerized service is deployed on the single K8S cluster if the single K8S cluster fails. When a single K8S cluster fails, the whole containerization service can still be used, the coupling between the containerization service and the K8S cluster is reduced, the resources of a plurality of K8S clusters can be used simultaneously, and the applicability is higher.
According to an aspect of the present invention, there is provided a containerization service deployment method, including:
acquiring configuration information and a deployment strategy of a containerization service to be created;
splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services;
after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster.
According to another aspect of the present invention, there is provided a containerized service deployment apparatus, including:
the acquisition module is used for acquiring configuration information and a deployment strategy of the containerization service to be created;
the splitting module is used for splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services;
the splicing module is used for splicing the containerization sub-services deployed on each K8S cluster after the at least two containerization sub-services are deployed on the at least two K8S clusters to obtain a target containerization cluster.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores a computer program executable by the at least one processor, the computer program being executable by the at least one processor to enable the at least one processor to perform the containerization service deployment method of any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer-readable storage medium storing computer instructions for causing a processor to implement the containerization service deployment method of any one of the embodiments of the present invention when executed.
The embodiment of the invention obtains the configuration information and the deployment strategy of the containerization service to be created; splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services; after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster, so that the problems that the resources and the stability of a single K8S cluster are limited and the coupling of the containerization service and the K8S cluster is high are solved, and the problem that the containerization service is unavailable due to the fact that the containerization service is deployed on the single K8S cluster if the single K8S cluster fails is solved. When a single K8S cluster fails, the whole containerization service can still be used, the coupling between the containerization service and the K8S cluster is reduced, the resources of a plurality of K8S clusters can be used simultaneously, and the applicability is higher.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present invention, nor do they necessarily limit the scope of the invention. Other features of the present invention will become apparent from the following description.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained according to the drawings without inventive efforts.
FIG. 1 is a flow chart of a containerization service deployment method in an embodiment of the present invention;
FIG. 2 is a flow chart of another method for deploying containerization services in an embodiment of the present invention;
FIG. 3 is a flow chart of another containerization service deployment method of an embodiment of the present invention;
FIG. 4 is a schematic structural diagram of a containerized service deployment apparatus in an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device in an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example one
Fig. 1 is a flowchart of a containerization service deploying method provided in an embodiment of the present invention, where this embodiment is applicable to a situation of containerization service deploying, and the method may be executed by a containerization service deploying apparatus in an embodiment of the present invention, and the apparatus may be implemented in a software and/or hardware manner, as shown in fig. 1, the method specifically includes the following steps:
s110, obtaining configuration information and deployment strategies of the containerization service to be created.
Wherein the containerized service is a service deployed through a container.
Wherein the configuration information may include: at least one of the number of containers, the data capacity supported by the containerization service to be created, and the deployment area (deployed across several K8S clusters) of the containerization service to be created.
The configuration information of the containerized service to be created may be configuration information input by a user through a graphical interface, for example, the configuration information may be preset in a configuration information list, the selected configuration information is displayed in an editing area of the graphical interface in response to a selection operation of the user on the configuration information in the configuration information list on the graphical interface, and the configuration information of the editing area of the graphical interface is acquired after the user clicks a completion control.
The deployment policy is preset rule information, for example, the deployment policy may be: if the remaining space of the K8S cluster is larger than a first threshold value, deploying a first number of containers, and if the remaining space of the K8S cluster is smaller than the first threshold value, deploying a second number of containers, wherein the first number and the second number are related to the total number of containers corresponding to the containerization service to be created; the deployment strategy may also be: the number of deployed containers is in direct proportion to the remaining space of the K8S cluster; the deployment strategy may also be: and uniformly distributing the containers corresponding to the containerization service to be created to each K8S cluster, and if the containers are remained, deploying the remained containers to the K8S cluster with the largest remaining space.
Specifically, the manner of obtaining the configuration information and the deployment policy of the containerized service to be created may be: the method comprises the steps of presetting a configuration information list and a deployment strategy list, displaying selected configuration information in an editing area of a graphical interface by responding to selection operation of configuration information in the configuration information list of a user on the graphical interface, displaying the selected deployment strategy in the editing area of the graphical interface by responding to selection operation of the deployment strategy in the deployment strategy list of the user on the graphical interface, and acquiring the configuration information and the deployment strategy in the editing area of the graphical interface after the user clicks a completion control. The method for acquiring the configuration information and the deployment policy of the containerized service to be created may also be: the method comprises the steps of presetting a configuration information list, responding to selection operation of a user on configuration information in the configuration information list on a graphical interface, displaying selected configuration information in an editing area of the graphical interface, obtaining the configuration information of the editing area of the graphical interface after the user clicks a completion control, and determining a deployment strategy according to the configuration information. The method for acquiring the configuration information and the deployment policy of the containerization service to be created may further be: presetting a configuration information list, wherein the configuration information list comprises: and responding to the selection operation of the configuration information in the configuration information list on the graphical interface by the user, displaying the selected configuration information and the deployment strategy corresponding to the configuration information in the editing area of the graphical interface, and acquiring the configuration information and the deployment strategy of the editing area of the graphical interface after the user clicks the completion control.
S120, splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services.
Specifically, the method for splitting the containerization service to be created according to the configuration information and the deployment policy of the containerization service to be created to obtain at least two containerization sub-services may be as follows: determining the total number of containers and the total number of K8S clusters corresponding to the containerization service to be created according to the configuration information of the containerization service to be created, and splitting the containerization service to be created according to the total number of containers, the total number of K8S clusters and a deployment strategy corresponding to the containerization service to be created to obtain at least two containerization sub-services.
Specifically, the manner of splitting the containerized service to be created according to the configuration information and the deployment policy of the containerized service to be created may be: the deployment strategy is: if the residual space of the K8S cluster is larger than a first threshold value, deploying a first number of containers, and if the residual space of the K8S cluster is smaller than the first threshold value, deploying a second number of containers; alternatively, the deployment policy is: the number of containers deployed is proportional to the remaining space of the K8S cluster. Determining the total number of containers corresponding to the containerization service to be created according to the configuration information of the containerization service to be created, determining the number of the containers distributed by each K8S cluster according to the total number of the containers corresponding to the containerization service to be created and the residual space of the K8S cluster, and splitting the containerization service to be created according to the number of the containers distributed by each K8S cluster. The method for splitting the containerized service to be created according to the configuration information and the deployment strategy of the containerized service to be created may further include: the deployment strategy is: the method includes the steps of equally distributing containers corresponding to the containerization service to be created to each K8S cluster, if the containers are left, deploying the remaining containers in the K8S cluster with the largest remaining space, determining the total number of the containers corresponding to the containerization service to be created according to configuration information of the containerization service to be created, equally distributing the containers according to the total number of the containers corresponding to the containerization service to be created and the total number of the K8S clusters, and if the containers cannot be equally distributed, distributing the remaining containers to the K8S cluster with the largest remaining space, wherein for example, the total number of the containers corresponding to the containerization service to be created is 7, and the containers need to be distributed to 3K 8S clusters, each K8S cluster is firstly distributed with 2 containers, and the last container is distributed to the K8S cluster with the largest remaining space.
S130, after the at least two containerization sub-services are deployed on the at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster.
Specifically, after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster, and the method for obtaining the target containerization cluster may be: after at least two containerized sub-services are deployed on at least two K8S clusters, splicing the containerized sub-services deployed on each K8S cluster to obtain a containerized cluster corresponding to each K8S cluster; and determining a target containerization cluster according to the containerization cluster corresponding to each K8S cluster. Specifically, after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster, and the method for obtaining the target containerization cluster may further be: generating a helm of each K8S cluster according to the configuration information of the containerized service to be created and the deployment strategy; performing helm deployment on the at least two K8S clusters according to the helm of each K8S cluster; and splicing the containerization sub-services deployed on each K8S cluster to obtain a target containerization cluster.
Optionally, the splicing is performed on the containerization sub-services deployed on each K8S cluster to obtain a target containerization cluster, including:
splicing the containerization sub-services deployed on each K8S cluster to obtain a containerization cluster corresponding to each K8S cluster;
and determining a target containerization cluster according to the containerization cluster corresponding to each K8S cluster.
Specifically, the manner of splicing the containerization sub-services deployed on each K8S cluster to obtain the containerization cluster corresponding to each K8S cluster may be: and acquiring identification information of each containerization sub-service, and splicing the containerization sub-services deployed on each K8S cluster according to the identification information of each containerization sub-service to obtain a containerization cluster corresponding to each K8S cluster.
Specifically, the manner of determining the target containerization cluster according to the containerization cluster corresponding to each K8S cluster may be: and merging the containerization clusters corresponding to each K8S cluster to obtain the target containerization cluster.
Optionally, after deploying the at least two containerization sub-services on the at least two K8S clusters, splicing the containerization sub-services deployed on each K8S cluster to obtain a target containerization cluster, including:
generating a helm of each K8S cluster according to the configuration information of the containerized service to be created and the deployment strategy;
and performing helm deployment on the at least two K8S clusters according to the helm of each K8S cluster to obtain a target containerization cluster.
Specifically, the manner of generating the helm of each K8S cluster according to the configuration information of the containerized service to be created and the deployment policy may be: determining configuration information of the helm of at least two K8S clusters according to the configuration information of the containerized service to be created and the deployment strategy; and generating the helm of the at least two K8S clusters according to the configuration information of the helm of the at least two K8S clusters. The manner of generating the helm of each K8S cluster according to the configuration information of the containerized service to be created and the deployment policy may also be: and after the information after the blocking is obtained, respectively creating a helm on at least two K8S clusters corresponding to the containerization service to be created, determining the configuration information of each helm according to the configuration information of the containerization service to be created and the deployment strategy, and sending the configuration information of each helm to the helm in an interface mode.
Specifically, the method for obtaining the target containerization cluster by performing the helm deployment on the at least two K8S clusters according to the helm of each K8S cluster may be: uploading the helm of each K8S cluster to a helm warehouse of each K8S cluster; and performing helm deployment on the at least two K8S clusters to obtain a target containerization cluster.
Optionally, generating a hell of each K8S cluster according to the configuration information of the containerized service to be created and the deployment policy includes:
determining the configuration information of the helm of at least two K8S clusters according to the configuration information of the containerized service to be created and the deployment strategy;
and generating the helm of the at least two K8S clusters according to the configuration information of the helm of the at least two K8S clusters.
Specifically, the configuration information of the helm of at least two K8S clusters is determined according to the configuration information of the containerization service to be created and the deployment policy, for example, if the containerization service to be created corresponds to the K8S cluster a and the K8S cluster B, the configuration information of the helm of the K8S cluster a and the configuration information of the helm of the K8S cluster B are determined according to the configuration information of the containerization service to be created and the deployment policy.
Specifically, the manner of generating the helm of the at least two K8S clusters according to the configuration information of the helm of the at least two K8S clusters may be: the method comprises the steps of creating a plurality of hells on at least two K8S clusters corresponding to the containerization service to be created in advance, and sending configuration information of each hell to the corresponding hells in an interface mode.
Optionally, generating a hell of each K8S cluster according to the configuration information of the containerized service to be created and the deployment policy includes:
obtaining the residual space of at least two K8S clusters;
and if the sum of the residual spaces of the K8S clusters is greater than or equal to the data capacity supported by the containerization service to be created, generating a helm of each K8S cluster according to the configuration information of the containerization service to be created and the deployment strategy.
Specifically, the manner of obtaining the remaining space of at least two K8S clusters may be: determining a deployment area of the containerization service to be created (namely, at least two K8S clusters corresponding to the containerization service to be created) according to the configuration information of the containerization service to be created, and acquiring the remaining space of the at least two K8S clusters corresponding to the containerization service to be created. For example, if the containerization service to be created corresponds to the K8S cluster a and the K8S cluster B, the remaining space of the K8S cluster a and the remaining space of the K8S cluster B may be obtained.
Specifically, if the sum of the remaining spaces of the K8S clusters is greater than or equal to the data capacity supported by the containerization service to be created, the manner of generating the helm of each K8S cluster according to the configuration information of the containerization service to be created and the deployment policy may be: determining the data capacity supported by the containerization service to be created according to the configuration information of the containerization service to be created; and if the sum of the residual spaces of the at least two K8S clusters corresponding to the containerized service to be created is greater than or equal to the data capacity supported by the containerized service to be created, generating a helm of each K8S cluster according to the configuration information of the containerized service to be created and the deployment strategy. And if the sum of the residual spaces of at least two K8S clusters corresponding to the containerization service to be created is less than the data capacity supported by the containerization service to be created, ending the creation process.
Optionally, the remaining space includes: at least one of the remaining memory space, the remaining CPU space and the remaining disk space.
In a specific example, as shown in fig. 2, receiving configuration information and a deployment policy of a containerization service to be created, which are sent by a front end, dividing the containerization service to be created according to the configuration information and the deployment policy of the containerization service to be created to obtain the number of containers deployed on each K8S cluster, creating a helm on each K8S cluster, and determining the configuration information of the helm of each K8S cluster according to the configuration information and the deployment policy of the containerization service to be created; generating a helm of each K8S cluster according to the configuration information of the helm of each K8S cluster; uploading the helm of each K8S cluster to a helm warehouse of each K8S cluster; the method comprises the steps of performing helm deployment on each K8S cluster to obtain a target containerized cluster, configuring nodes of different K8S into different racks by a rack-aware network topology, and ensuring that container copies are deployed in at least 2K 8S clusters.
In another specific example, as shown in fig. 3, receiving configuration information and a deployment policy of a containerization service to be created, which are sent by a front end, dividing the containerization service to be created according to the configuration information and the deployment policy of the containerization service to be created to obtain the number of containers deployed on each K8S cluster, and determining a data capacity supported by the containerization service to be created according to the configuration information of the containerization service to be created; and acquiring the sum of the residual spaces of at least two K8S clusters corresponding to the containerization service to be created, and finishing the creation if the sum of the residual spaces of at least two K8S clusters corresponding to the containerization service to be created is less than the data capacity supported by the containerization service to be created. If the sum of the residual spaces of at least two K8S clusters corresponding to the containerization service to be created is greater than or equal to the data capacity supported by the containerization service to be created, generating a helm of each K8S cluster according to the configuration information of the containerization service to be created and the deployment strategy, issuing the helm in each cluster, judging whether the helm is issued and the service state of the container is normal or not, and if so, ending; if not, judging whether the deployment time is overtime or not, and if not, returning to execute the operation of issuing the helm in each K8S cluster. If the service state of the container is in operation, determining that the service state of the container is normal, and if the service state of the container is not in operation, determining that the service state of the container is abnormal.
In another specific example, an embodiment of the present invention provides a one-key deployment system for containerized services, where the deployment system includes: the system comprises a front-end module, a rear-end configuration module and a container deployment module, wherein the front-end module is used for inputting user configuration, displaying configuration information and deployment strategies and packaging a graphical control interface; the back-end configuration module is used for confirming the configuration information of the required service, partitioning the containerized service, calling the container deployment module and distributing the K8S cluster; the container deployment module manages a plurality of K8S, the help is used for deploying containerized services, smaller container clusters can be deployed on different K8S clusters respectively and then combined into a final service cluster, and therefore high availability of the whole service is improved. Meanwhile, the machine frame perception function is utilized to carry out overall scheduling control, and uneven distribution of nodes and copies is avoided. The creation process of the containerization service comprises the following steps: the user inputs the required cluster configuration and the deployment strategy through a graphical interface. The containerization service is split into portions corresponding to the plurality of K8S clusters. And calculating the number of nodes in each K8S cluster and pre-configuring the corresponding nodes. Corresponding containerization clusters are created on the three K8S clusters. The three clusters are merged into the final containerized cluster. And configuring a rack-aware DNSToSwitchMapping rack topological graph to ensure the high-availability distribution of the data copies of the containerization service.
In another specific example, the creation process of the containerization service includes: the user inputs the desired cluster configuration via a graphical interface. The back-end configuration module firstly acquires configuration information of a container cluster to be created, which is sent by the front end, confirms a K8S cluster to be allocated according to information of an available area, a network and the like, and divides nodes into a plurality of K8S clusters according to information of a CPU, a memory, a disk and the like of the K8S cluster to be allocated averagely so as to ensure the maximum high availability. For example, 7 container three clusters are allocated with 2, 2 and 2 first, and the last node is preferentially allocated to the K8S cluster with the most sufficient resources. And partitioning the containerization service to be created, and performing corresponding configuration pretreatment on containers in each partition. After the information is blocked, a palm is created on each of the K8S clusters, and the configuration information is sent to the palm in the form of an interface. The configuration information is configured into the helm respectively. And uploading the processed helm blocks. After the block configuration preprocessing is completed, each preprocessed helm is uploaded to a helm warehouse of a K8S cluster, and information such as block numbers, uploading results, K8S cluster numbers and the like of all helm processing is recorded in a main program. The helm partitions are merged into the final containerized cluster. After all the helms are uploaded, the helm deployment is carried out on all the K8S clusters, whether the helm processing fails or not is judged, and if the helm processing fails, corresponding error reporting is carried out. If all the helm deployments are successful, an interface method can be called, and a deployment result information set is used as a return parameter, including: and splicing all corresponding data according to the container ip information, the container information, the K8S cluster information, the deployment result and the like, so that complete container information is obtained and returned to the front end. A network topology map of the hosts of the container is input into the containerized cluster to configure the high availability allocation of the data replicas.
According to the technical scheme of the embodiment, the configuration information and the deployment strategy of the containerization service to be created are obtained; splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services; after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster, so that the problems that the resources and the stability of a single K8S cluster are limited and the coupling of the containerization service and the K8S cluster is high are solved, and the problem that the containerization service is unavailable due to the fact that the containerization service is deployed on the single K8S cluster if the single K8S cluster fails is solved. When a single K8S cluster fails, the whole containerization service can still be used, the coupling between the containerization service and the K8S cluster is reduced, the resources of a plurality of K8S clusters can be used simultaneously, and the applicability is higher.
Example two
Fig. 4 is a schematic structural diagram of a containerization service deployment apparatus according to an embodiment of the present invention. The present embodiment may be applicable to the case of containerized service deployment, where the apparatus may be implemented in a software and/or hardware manner, and the apparatus may be integrated in any device providing a containerized service deployment function, as shown in fig. 4, where the containerized service deployment apparatus specifically includes: an acquisition module 210, a splitting module 220, and a splicing module 230.
The system comprises an acquisition module, a configuration module and a deployment module, wherein the acquisition module is used for acquiring configuration information and a deployment strategy of the containerization service to be created;
the splitting module is used for splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services;
and the splicing module is used for splicing the containerized sub-services deployed on each K8S cluster after the at least two containerized sub-services are deployed on the at least two K8S clusters to obtain a target containerized cluster.
The product can execute the method provided by any embodiment of the invention, and has corresponding functional modules and beneficial effects of the execution method.
According to the technical scheme of the embodiment, the configuration information and the deployment strategy of the containerization service to be created are obtained; splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services; after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster, so that the problems that the resources and the stability of a single K8S cluster are limited and the coupling of the containerization service and the K8S cluster is high are solved, and the problem that the containerization service is unavailable due to the fact that the containerization service is deployed on the single K8S cluster if the single K8S cluster fails is solved. When a single K8S cluster fails, the whole containerization service can still be used, the coupling between the containerization service and the K8S cluster is reduced, the resources of a plurality of K8S clusters can be used simultaneously, and the applicability is higher.
EXAMPLE III
FIG. 5 illustrates a schematic diagram of an electronic device 10 that may be used to implement an embodiment of the invention. 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 assistants, cellular phones, smart phones, wearable devices (e.g., helmets, glasses, watches, etc.), 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 inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory communicatively connected to the at least one processor 11, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, and the like, wherein the memory stores a computer program executable by the at least one processor, and the processor 11 can perform various suitable actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from a storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data necessary for the operation of the electronic apparatus 10 may also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to the bus 14.
A number of components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, or the like; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, or the like. The processor 11 performs the various methods and processes described above, such as the containerization service deployment method.
In some embodiments, the containerization service deployment method may be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the containerization service deployment method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the containerization service deployment method by any other suitable means (e.g., by way of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a 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 that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be performed. A computer program can execute entirely on a machine, partly on a machine, as a stand-alone software package partly on a machine and partly on a remote machine or entirely on a remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. A computer readable storage 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. Alternatively, the computer readable storage medium may be a machine readable signal medium. 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 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 an electronic device 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 a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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), blockchain networks, and the internet.
The computing system may include clients and servers. A client and server are generally 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 can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in the present invention may be executed in parallel, sequentially, or in different orders, and are not limited herein as long as the desired results of the technical solution of the present invention can be achieved.
The above-described embodiments should not be construed as limiting the scope of the invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A containerized service deployment method, comprising:
acquiring configuration information and a deployment strategy of a containerization service to be created;
splitting the containerization service to be created according to the configuration information and the deployment strategy of the containerization service to be created to obtain at least two containerization sub-services;
after at least two containerization sub-services are deployed on at least two K8S clusters, the containerization sub-services deployed on each K8S cluster are spliced to obtain a target containerization cluster.
2. The method of claim 1, wherein splicing the containerized sub-services deployed on each K8S cluster to obtain a target containerized cluster comprises:
splicing the containerization sub-services deployed on each K8S cluster to obtain a containerization cluster corresponding to each K8S cluster;
and determining a target containerization cluster according to the containerization cluster corresponding to each K8S cluster.
3. The method of claim 1, wherein after deploying at least two containerized sub-services on at least two K8S clusters, splicing the containerized sub-services deployed on each K8S cluster to obtain a target containerized cluster, comprises:
generating a helm of each K8S cluster according to the configuration information of the containerized service to be created and the deployment strategy;
and performing helm deployment on the at least two K8S clusters according to the helm of each K8S cluster to obtain a target containerization cluster.
4. The method according to claim 3, wherein generating a helm for each K8S cluster according to the configuration information of the containerization service to be created and the deployment policy comprises:
determining the configuration information of the helm of at least two K8S clusters according to the configuration information of the containerized service to be created and the deployment strategy;
and generating the helm of the at least two K8S clusters according to the configuration information of the helm of the at least two K8S clusters.
5. The method according to claim 3, wherein generating a helm for each K8S cluster according to the configuration information of the containerization service to be created and the deployment policy comprises:
acquiring residual spaces of at least two K8S clusters;
and if the sum of the residual spaces of the K8S clusters is greater than or equal to the data capacity supported by the containerization service to be created, generating a helm of each K8S cluster according to the configuration information of the containerization service to be created and the deployment strategy.
6. The method of claim 5, wherein the remaining space comprises: at least one of the remaining memory space, the remaining CPU space, and the remaining disk space.
7. A containerized service deployment apparatus, comprising:
the acquisition module is used for acquiring configuration information and a deployment strategy of the containerization service to be created;
the splitting module is used for splitting the containerized service to be created according to the configuration information and the deployment strategy of the containerized service to be created to obtain at least two containerized sub-services;
the splicing module is used for splicing the containerization sub-services deployed on each K8S cluster after the at least two containerization sub-services are deployed on the at least two K8S clusters to obtain a target containerization cluster.
8. The apparatus of claim 7, wherein the splicing module is specifically configured to:
splicing the containerization sub-services deployed on each K8S cluster to obtain a containerization cluster corresponding to each K8S cluster;
and determining a target containerization cluster according to the containerization cluster corresponding to each K8S cluster.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the containerized service deployment method of any of claims 1-6.
10. A computer-readable storage medium storing computer instructions for causing a processor to perform the containerization service deployment method of any one of claims 1-6 when executed.
CN202211204402.4A 2022-09-29 2022-09-29 Containerization service deployment method, device, equipment and storage medium Pending CN115617454A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211204402.4A CN115617454A (en) 2022-09-29 2022-09-29 Containerization service deployment method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211204402.4A CN115617454A (en) 2022-09-29 2022-09-29 Containerization service deployment method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115617454A true CN115617454A (en) 2023-01-17

Family

ID=84861562

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211204402.4A Pending CN115617454A (en) 2022-09-29 2022-09-29 Containerization service deployment method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115617454A (en)

Similar Documents

Publication Publication Date Title
US10347542B2 (en) Client-initiated leader election in distributed client-server systems
CN113641457A (en) Container creation method, device, apparatus, medium, and program product
CN111143039A (en) Virtual machine scheduling method and device and computer storage medium
CN113608765A (en) Data processing method, device, equipment and storage medium
CN115373861B (en) GPU resource scheduling method and device, electronic equipment and storage medium
CN112615795A (en) Flow control method and device, electronic equipment, storage medium and product
CN105471986B (en) A kind of Constructing data center Scale Revenue Ratio method and device
CN115658311A (en) Resource scheduling method, device, equipment and medium
CN114443057B (en) Deployment of conversation model, conversation method, device, electronic equipment and storage medium
US20230070063A1 (en) Workflow automation utilizing metadata structure
US20230082903A1 (en) Autonomic application service framework
CN115617454A (en) Containerization service deployment method, device, equipment and storage medium
CN114070889A (en) Configuration method, traffic forwarding method, device, storage medium, and program product
US20210241151A1 (en) Device Component Management Using Deep Learning Techniques
CN114374703A (en) Method, device and equipment for acquiring cloud mobile phone information and storage medium
CN113691403A (en) Topological node configuration method, related device and computer program product
CN113641688A (en) Node updating method, related device and computer program product
CN113360689B (en) Image retrieval system, method, related device and computer program product
US11163462B1 (en) Automated resource selection for software-defined storage deployment
CN113641670B (en) Data storage and data retrieval method and device, electronic equipment and storage medium
US11651005B2 (en) Intelligent datastore determination for microservice
CN115913954A (en) Cluster management information interaction method, device, equipment and storage medium
CN115309568A (en) Method, device, equipment and medium for realizing multi-process file sharing
CN115934246A (en) Virtual machine creating method, device, equipment and medium
CN117014312A (en) Capacity management method and related equipment

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