A method, device, equipment and readable medium for high availability of cloud components
By deploying multiple cloud component container instances in the cloud platform and establishing communication tunnels, the problem of insufficient availability of cloud components in edge cloud scenarios is solved, and high availability and performance improvement of cloud components are achieved.
Patent Information
- Application Number
- CN202111102428.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-19
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2041-09-19
AI Technical Summary
The traditional cloud computing model cannot meet the needs of smart terminal devices for timeliness, capacity and computing power, causing cloud computing capabilities to sink to the edge. It is necessary to improve the availability and performance of cloud components in edge cloud scenarios.
Deploy multiple container instances of cloud components in the cloud platform, execute preset iptables rules through kube-apiserver, establish a communication tunnel between each cloud component and edge component, and modify the kubeletendpoint port of the edge component to be connected Port information for cloud components to ensure high availability and load balancing.
It achieves high availability of cloud components in edge cloud scenarios, improves the reliability and performance of cloud component services, and ensures effective allocation and operation of cloud platform resources.
Smart Images

Figure CN114124948B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and more specifically to a method, apparatus, device and readable medium for high availability of cloud components in an edge cloud scenario. Background Art
[0002] With the rapid increase in the number of intelligent Internet terminals and the advent of 5G and the Internet of Things, the centralized storage and computing model of traditional cloud computing centers can no longer meet the terminal devices' needs for timeliness, capacity, and computing power. It will be an important development trend of cloud computing to sink cloud computing capabilities to the edge and device sides and to perform unified delivery, operation, maintenance, and management through the center. Kubernetes-based cloud computing platforms are also sinking Kubernetes capabilities to the edge to provide users with edge container orchestration solutions that are easier to operate and maintain. Summary of the invention
[0003] In view of this, the purpose of the present invention is to propose a method, device, equipment and readable medium for high availability of cloud components in an edge cloud scenario. By using the technical solution of the present invention, high availability of cloud components in edge cloud scenarios can be achieved, and the reliability and performance of cloud component services can be improved.
[0004] Based on the above objectives, one aspect of the present invention provides a method for high availability of cloud components in an edge cloud scenario, comprising the following steps:
[0005] Deploy several container instances of cloud components in the cloud platform so that each container instance of the cloud component can provide services externally;
[0006] In response to the successful deployment of the container instance of the cloud component, the preset iptbales rules are executed on the node where the kube-apiserver is located;
[0007] Establishing a communication tunnel between each cloud component and an edge component connected to the cloud component to enable the edge component to communicate with the cloud platform;
[0008] Change the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected.
[0009] According to one embodiment of the present invention, establishing a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform includes:
[0010] Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component;
[0011] The edge component obtains the resource information of the cloud platform through the resource tunnel;
[0012] The edge component responds to requests from the kube-apiserver node through the operation and maintenance tunnel.
[0013] According to one embodiment of the present invention, it also includes:
[0014] Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
[0015] According to one embodiment of the present invention, in response to successful deployment of a container instance of a cloud component, executing a preset iptbales rule on the node where the kube-apiserver is located includes:
[0016] In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located:
[0017] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0018] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0019] iptables -t nat -A OUTPUT -p tcp --dport 10353-j DNAT --to Cloudcore3IP:10003.
[0020] Another aspect of the present invention further provides a device for high availability of cloud components in an edge cloud scenario, the device comprising:
[0021] A deployment module, the deployment module is configured to deploy a number of container instances of cloud components in the cloud platform so that each container instance of the cloud component provides services externally;
[0022] An execution module, where the execution module is configured to execute a preset iptbales rule on the node where the kube-apiserver is located in response to successful deployment of the container instance of the cloud component;
[0023] An establishment module, wherein the establishment module is configured to establish a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform;
[0024] Modify the module and configure the module to change the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected.
[0025] According to one embodiment of the present invention, the establishment module is further configured to:
[0026] Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component;
[0027] The edge component obtains the resource information of the cloud platform through the resource tunnel;
[0028] The edge component responds to requests from the kube-apiserver node through the operation and maintenance tunnel.
[0029] According to one embodiment of the present invention, a setting module is further included, and the setting module is configured to:
[0030] Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
[0031] According to one embodiment of the present invention, the execution module is further configured to:
[0032] In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located:
[0033] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0034] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0035] iptables -t nat -A OUTPUT -p tcp --dport 10353-j DNAT --to Cloudcore3IP:10003.
[0036] Another aspect of the present invention further provides a computer device, the computer device comprising:
[0037] at least one processor; and
[0038] The memory stores computer instructions executable on the processor, and the instructions implement the steps of any one of the above methods when executed by the processor.
[0039] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of any one of the above methods are implemented.
[0040] The present invention has the following beneficial technical effects: the method for high availability of cloud components in edge cloud scenarios provided by the present invention deploys several container instances of cloud components in a cloud platform so that each container instance of the cloud component provides services to the outside world; in response to the successful deployment of the container instance of the cloud component, a preset iptbales rule is executed on the node where the kube-apiserver is located; a communication tunnel is established between each cloud component and an edge component connected to the cloud component so that the edge component can communicate with the cloud platform; the technical solution of modifying the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected can achieve high availability of cloud components in edge cloud scenarios and improve the reliability and performance of cloud component services. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other embodiments can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic flowchart of a method for high availability of cloud components in an edge cloud scenario according to an embodiment of the present invention;
[0043] Figure 2 A schematic diagram of a device for high availability of cloud components in an edge cloud scenario according to an embodiment of the present invention;
[0044] Figure 3 is a schematic diagram of a computer device according to an embodiment of the present invention;
[0045] Figure 4 FIG. 1 is a schematic diagram of a computer-readable storage medium according to an embodiment of the present invention. DETAILED DESCRIPTION
[0046] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the embodiments of the present invention are further described in detail below in combination with specific embodiments and with reference to the accompanying drawings.
[0047] Based on the above objectives, a first aspect of an embodiment of the present invention provides an embodiment of a method for high availability of cloud components in an edge cloud scenario. Figure 1 Shown is a schematic flow chart of the method.
[0048] like Figure 1 As shown in , the method may include the following steps:
[0049] S1 deploys several container instances of cloud components in the cloud platform so that each container instance of the cloud component provides services to the outside world.
[0050] To ensure high availability, multiple cloudcore (cloud component) container instances can be deployed. All containers have the ability to provide services to the outside world. Cloudcore does not elect a master, but each container provides services normally. The load balancing module distributes the load. The container to which the load is distributed will provide the service. Therefore, the reliability of cloud components can be improved.
[0051] In response to the successful deployment of the container instance of the cloud component, S2 executes the preset iptbales rules on the node where the kube-apiserver is located.
[0052] After the cloudcore container is successfully created, the following iptbales rules need to be executed on the node where the kube-apiserver is located:
[0053] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0054] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0055] iptables-t nat-A OUTPUT-p tcp--dport 10353-j DNAT--to Cloudcore3IP:10003 is used to ensure that when operating and maintaining the container on the corresponding edge node, the corresponding cloudcore can be found, and then the corresponding operation and maintenance tunnel can be found to issue commands. The 10351, 10352, and 10353 in the rule are the port numbers of the cloud components.
[0056] S3 establishes a communication tunnel between each cloud component and the edge component connected to the cloud component to enable the edge component to communicate with the cloud platform.
[0057] Two tunnels are created between cloudcore and edgecore (edge node). Both tunnels are established by edgecore. One tunnel is used by edge components to obtain cloud k8s resource information, including deployment, statefulset, pod, service and other resource information, so as to create corresponding container instances on edge nodes. This tunnel is called a resource tunnel. The other tunnel is an operation and maintenance channel, which is used to respond to requests from apiserver, such as executing kubectl logs, kubectl exec, promethus metrics and other requests. This tunnel is called an operation and maintenance tunnel.
[0058] S4 modifies the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected.
[0059] When creating a cloudcore container, the port corresponding to each cloudcore will be maintained in the configmap named tunnelport. The port number starts from 10350 and increases by one. For example, the first cloud component cloudcore1 uses port 10351, and the second cloud component cloudcore2 uses port 10352. This port is the kubeletendpoint port corresponding to the edge component node after it joins the kubernetes cluster, that is, the port used in the url when making a kubectl logs request. When the edgecore is connected to a cloudcore through the load balancing module, the resource tunnel is established. At the same time, the cloudcore will modify the kubeletendpoint port in the edge component's node information and change the port to the port corresponding to the cloudcore, so that the edgecore, cloudcore, and kubeletendpoint ports correspond one to one.
[0060] Through the technical solution of the present invention, high availability of cloud components in edge cloud scenarios can be achieved, and the reliability and performance of cloud component services can be improved.
[0061] In a preferred embodiment of the present invention, establishing a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform includes:
[0062] Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component;
[0063] The edge component obtains the resource information of the cloud platform through the resource tunnel;
[0064] The edge component responds to the request of the kube-apiserver node through the operation and maintenance tunnel. The resource tunnel is used by the edge component to obtain the k8s resource information in the cloud, including deployment, statefulset, pod, service and other resource information, so as to create the corresponding container instance on the edge node. The operation and maintenance tunnel is used to respond to the request of the apiserver, such as executing kubectl logs, kubectl exec, promethus metrics and other requests.
[0065] In a preferred embodiment of the present invention, it also includes:
[0066] Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and the port numbers of other cloud components are 1 more than the port number of the first cloud component. For example, the first cloud component cloudcore1 uses port 10351, the second cloud component cloudcore2 uses port 10352, and the third cloud component cloudcore3 uses port 10353. This port is the kubeletendpoint port corresponding to the edge component node after joining the kubernetes cluster, that is, the port used in the url when making a kubectl logs request.
[0067] In a preferred embodiment of the present invention, in response to successful deployment of a container instance of a cloud component, executing a preset iptbales rule on the node where the kube-apiserver is located includes:
[0068] In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located:
[0069] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0070] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0071] iptables-t nat-A OUTPUT-p tcp--dport 10353-j DNAT--to Cloudcore3IP:10003. The above iptables rules are used to ensure that when operating and maintaining the container on the node of the corresponding edge component, the corresponding cloudcore can be found, and then the corresponding operation and maintenance tunnel can be found to issue commands.
[0072] The above scheme is a multi-active mode. In one embodiment of the present invention, a master-slave mode is also recorded. In order to ensure high availability, multiple cloudcore container instances are generally deployed. In order to ensure data consistency, only one container instance provides services to the outside world, and the other containers are in a subordinate state. The leader is selected among multiple containers through the leaderelection mechanism of k8s. According to the hot standby solution of k8s, the concept of lease resources in K8S is used to implement leaderelection. If there are multiple cloudcores competing for the leader, each cloudcore will create this lease resource in etcd. Successful creation means becoming the leader, and the lease (leaseDurationSeconds) must be updated regularly. If the leader does not renew the lease, it will expire, and other followers will take the position of the leader. PodReadinessGate is a field of the pod (container) resource of kubernetes. Only when the status of this field is true in the pod status, the pod will generate the corresponding endpoint, and then the pod backend can be accessed through the service resource. Therefore, only the cloudcore that successfully runs for the leader can be accessed through the service. The edge component sends a request to establish a connection, with the destination address being: cloudcoreVip:10000 port, to establish a websocket connection. The cloud-side nginx listens to the cloudcoreVip:10000 port and forwards the request to the cloudcore's serviceName:10000 port. In this way, even if the leader switches back and forth between multiple copies of cloudcore, it will not affect the provision of services, thereby achieving high availability of cloudcore on the cloud side.
[0073] Through the technical solution of the present invention, high availability of cloud components in edge cloud scenarios can be achieved, and the reliability and performance of cloud component services can be improved.
[0074] It should be noted that a person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be implemented by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a computer-readable storage medium, and when the program is executed, it can include the processes of the embodiments of the above-mentioned methods. The storage medium can be a disk, an optical disk, a read-only memory (ROM) or a random access memory (RAM), etc. The above-mentioned computer program embodiment can achieve the same or similar effect as any of the above-mentioned method embodiments corresponding thereto.
[0075] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a CPU, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the CPU, the above functions defined in the method disclosed in the embodiment of the present invention are performed.
[0076] Based on the above purpose, a second aspect of an embodiment of the present invention provides a high-availability device for cloud components in an edge cloud scenario, such as Figure 2 As shown, the device 200 includes:
[0077] A deployment module 201, the deployment module 201 is configured to deploy a plurality of container instances of cloud components in the cloud platform so that each container instance of the cloud component provides services externally;
[0078] An execution module 202, where the execution module 202 is configured to execute a preset iptbales rule on the node where the kube-apiserver is located in response to successful deployment of the container instance of the cloud component;
[0079] Establishing module 203, establishing module 203 is configured to establish a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform;
[0080] Modification module 204, modification module 204 is configured to modify the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected.
[0081] In a preferred embodiment of the present invention, the establishing module 203 is further configured to:
[0082] Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component;
[0083] The edge component obtains the resource information of the cloud platform through the resource tunnel;
[0084] The edge component responds to requests from the kube-apiserver node through the operation and maintenance tunnel.
[0085] In a preferred embodiment of the present invention, a setting module is further included, and the setting module is configured to:
[0086] Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
[0087] In a preferred embodiment of the present invention, the execution module 202 is further configured to:
[0088] In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located:
[0089] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0090] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0091] iptables -t nat -A OUTPUT -p tcp --dport 10353-j DNAT --to Cloudcore3IP:10003.
[0092] Based on the above purpose, a third aspect of an embodiment of the present invention provides a computer device. Figure 3 FIG. 2 is a schematic diagram of an embodiment of a computer device provided by the present invention. Figure 3 As shown, the embodiment of the present invention includes the following apparatus: at least one processor 21; and a memory 22, the memory 22 stores computer instructions 23 that can be run on the processor, and when the instructions are executed by the processor, the following method is implemented:
[0093] The slave end divides the bitmap into several blocks of the same size, and sends the messages of the divided blocks to the master end for bitmap merging;
[0094] Deploy several container instances of cloud components in the cloud platform so that each container instance of the cloud component can provide services externally;
[0095] In response to the successful deployment of the container instance of the cloud component, the preset iptbales rules are executed on the node where the kube-apiserver is located;
[0096] Establishing a communication tunnel between each cloud component and an edge component connected to the cloud component to enable the edge component to communicate with the cloud platform;
[0097] Change the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected.
[0098] In a preferred embodiment of the present invention, establishing a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform includes:
[0099] Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component;
[0100] The edge component obtains the resource information of the cloud platform through the resource tunnel;
[0101] The edge component responds to requests from the kube-apiserver node through the operation and maintenance tunnel.
[0102] In a preferred embodiment of the present invention, it also includes:
[0103] Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
[0104] In a preferred embodiment of the present invention, in response to successful deployment of a container instance of a cloud component, executing a preset iptbales rule on the node where the kube-apiserver is located includes:
[0105] In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located:
[0106] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0107] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0108] iptables -t nat -A OUTPUT -p tcp --dport 10353-j DNAT --to Cloudcore3IP:10003.
[0109] Based on the above purpose, a fourth aspect of an embodiment of the present invention provides a computer-readable storage medium. Figure 4 FIG. 2 is a schematic diagram of an embodiment of a computer-readable storage medium provided by the present invention. Figure 4 As shown, the computer readable storage medium 31 stores a computer program 32 that performs the following method when executed by a processor:
[0110] The slave end divides the bitmap into several blocks of the same size, and sends the messages of the divided blocks to the master end for bitmap merging;
[0111] Deploy several container instances of cloud components in the cloud platform so that each container instance of the cloud component can provide services externally;
[0112] In response to the successful deployment of the container instance of the cloud component, the preset iptbales rules are executed on the node where the kube-apiserver is located;
[0113] Establishing a communication tunnel between each cloud component and an edge component connected to the cloud component to enable the edge component to communicate with the cloud platform;
[0114] Change the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected.
[0115] In a preferred embodiment of the present invention, establishing a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform includes:
[0116] Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component;
[0117] The edge component obtains the resource information of the cloud platform through the resource tunnel;
[0118] The edge component responds to requests from the kube-apiserver node through the operation and maintenance tunnel.
[0119] In a preferred embodiment of the present invention, it also includes:
[0120] Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
[0121] In a preferred embodiment of the present invention, in response to successful deployment of a container instance of a cloud component, executing a preset iptbales rule on the node where the kube-apiserver is located includes:
[0122] In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located:
[0123] iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003,
[0124] iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003,
[0125] iptables -t nat -A OUTPUT -p tcp --dport 10353-j DNAT --to Cloudcore3IP:10003.
[0126] In addition, the method disclosed in the embodiment of the present invention can also be implemented as a computer program executed by a processor, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the above functions defined in the method disclosed in the embodiment of the present invention are performed.
[0127] In addition, the above method steps and system units may also be implemented using a controller and a computer-readable storage medium for storing a computer program that enables the controller to implement the above steps or unit functions.
[0128] It will also be appreciated by those skilled in the art that various exemplary logic blocks, modules, circuits and algorithm steps described in conjunction with the disclosure herein can be implemented as electronic hardware, computer software or a combination of the two. In order to clearly illustrate this interchangeability of hardware and software, a general description has been given to the functions of various schematic components, blocks, modules, circuits and steps. Whether this function is implemented as software or hardware depends on specific applications and the design constraints imposed on the entire system. Those skilled in the art can implement the function in various ways for each specific application, but this implementation decision should not be interpreted as causing a departure from the disclosed scope of the embodiments of the present invention.
[0129] In one or more exemplary designs, the function can be implemented in hardware, software, firmware or any combination thereof. If implemented in software, the function can be stored on a computer-readable medium or transmitted by a computer-readable medium as one or more instructions or codes. Computer-readable media include computer storage media and communication media, and the communication media include any media that helps to transfer a computer program from one location to another. The storage medium can be any available medium that can be accessed by a general or special computer. As an example and not limiting, the computer-readable medium may include RAM, ROM, EEPROM, CD-ROM or other optical disk storage devices, disk storage devices or other magnetic storage devices, or any other medium that can be used to carry or store the required program code in the form of an instruction or data structure and can be accessed by a general or special computer or a general or special processor. In addition, any connection can be appropriately referred to as a computer-readable medium. For example, if a coaxial cable, optical fiber cable, twisted pair, digital subscriber line (DSL) or wireless technologies such as infrared, radio and microwaves are used to send software from a website, server or other remote source, the above-mentioned coaxial cable, optical fiber cable, twisted pair, DSL or wireless technologies such as infrared, radio and microwaves are all included in the definition of the medium. As used herein, disk and disc include compact disc (CD), laser disc, optical disc, digital versatile disc (DVD), floppy disk, Blu-ray disc, wherein disks usually reproduce data magnetically, while optical discs reproduce data optically with lasers. Combinations of the above should also be included within the scope of computer-readable media.
[0130] The above are exemplary embodiments disclosed in the present invention, but it should be noted that various changes and modifications may be made without departing from the scope disclosed in the embodiments of the present invention as defined in the claims. The functions, steps and / or actions of the method claims according to the disclosed embodiments described herein do not need to be performed in any particular order. In addition, although the elements disclosed in the embodiments of the present invention may be described or required in individual form, they may also be understood as multiple unless explicitly limited to the singular.
[0131] It should be understood that, as used herein, the singular forms "a", "an" are intended to include the plural forms as well, unless the context clearly supports an exception. It should also be understood that, as used herein, "and / or" refers to any and all possible combinations including one or more of the associated listed items.
[0132] The serial numbers of the embodiments disclosed in the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.
[0133] A person skilled in the art will understand that all or part of the steps to implement the above embodiments may be accomplished by hardware or by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, and the above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.
[0134] A person skilled in the art should understand that the discussion of any of the above embodiments is only exemplary and is not intended to imply that the scope of the disclosure of the embodiments of the present invention (including the claims) is limited to these examples; under the concept of the embodiments of the present invention, the technical features in the above embodiments or different embodiments can also be combined, and there are many other changes in different aspects of the embodiments of the present invention as above, which are not provided in detail for the sake of simplicity. Therefore, any omissions, modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the embodiments of the present invention should be included in the protection scope of the embodiments of the present invention.
Claims
1. A method for high availability of cloud components in an edge cloud scenario, characterized in that: The following steps are involved: Deploy several container instances of cloud components in the cloud platform so that each container instance of the cloud component can provide services externally; In response to the successful deployment of the container instance of the cloud component, the preset iptbales rules are executed on the node where the kube-apiserver is located; Establishing a communication tunnel between each cloud component and an edge component connected to the cloud component to enable the edge component to communicate with the cloud platform; Change the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected; In response to the successful deployment of the container instance of the cloud component, the steps of executing the preset iptbales rule on the node where the kube-apiserver is located include: In response to the successful deployment of the container instance of the cloud component, the following iptbales rules are executed on the node where the kube-apiserver is located: iptables -t nat -A OUTPUT -p tcp --dport 10351-j DNAT --to Cloudcore1IP:10003, iptables -t nat -A OUTPUT -p tcp --dport 10352-j DNAT --to Cloudcore2IP:10003, iptables -t nat -A OUTPUT -p tcp --dport 10353-j DNAT --to Cloudcore3IP:10003, Among them, 10351 represents the port information of the first cloud component, 10352 represents the port information of the second cloud component, and 10353 represents the port information of the third cloud component; The step of establishing a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component can communicate with the cloud platform includes: Establish resource tunnels and operation and maintenance tunnels between each cloud component and the edge component connected to the cloud component; The edge component obtains resource information of the cloud platform via the resource tunnel, and establishes a container instance corresponding to the cloud component connected to it based on the resource information; The edge component responds to the request of the kube-apiserver node via the operation and maintenance tunnel, and operates and maintains the container instance established by it based on the request.
2. The method according to claim 1, characterized in that Also includes: Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
3. A device for high availability of cloud components in an edge cloud scenario, characterized in that: The device comprises: A deployment module, wherein the deployment module is configured to deploy a plurality of container instances of cloud components in the cloud platform so that each container instance of the cloud component provides services externally; An execution module, wherein the execution module is configured to execute a preset iptbales rule on the node where the kube-apiserver is located in response to successful deployment of the container instance of the cloud component; An establishment module, the establishment module being configured to establish a communication tunnel between each cloud component and an edge component connected to the cloud component so that the edge component communicates with the cloud platform; A modification module, wherein the modification module is configured to modify the kubeletendpoint port in the node information of the edge component to the port information of the cloud component to which the edge component is connected; The execution module is further configured to: in response to successful deployment of the container instance of the cloud component, execute the following iptbales rules on the node where the kube-apiserver is located: iptables-t nat-A OUTPUT-p tcp--dport 10351-jDNAT--to Cloudcore1IP:10003, iptables-t nat-A OUTPUT-p tcp--dport 10352-jDNAT--to Cloudcore2IP:10003, iptables-t nat-A OUTPUT-p tcp--dport 10353-jDNAT--to Cloudcore3IP:10003, wherein 10351 represents the port information of the first cloud component, 10352 represents the port information of the second cloud component, and 10353 represents the port information of the third cloud component; The establishment module is also configured to: establish a resource tunnel and an operation and maintenance tunnel between each cloud component and the edge component connected to the cloud component; the edge component obtains resource information of the cloud platform via the resource tunnel, and establishes a container instance corresponding to the cloud component connected to it based on the resource information; the edge component responds to the request of the kube-apiserver node via the operation and maintenance tunnel, and operates and maintains the container instance it establishes based on the request.
4. The device according to claim 3, characterized in that It also includes a setting module, wherein the setting module is configured as follows: Maintain ports for each cloud component, set the port number of the first cloud component to 10350, and add 1 to the port number of the other cloud components.
5. A computer device, characterized in that: include: at least one processor; as well as A memory, wherein the memory stores computer instructions executable on the processor, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 2.
6. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 2 are implemented.
