Network communication method and device based on hybrid networking, equipment and storage medium
By building a virtual network in a scenario where the management network and business network are isolated, hybrid networking of K8s clusters is realized, which solves the problem of incomplete separation of management and business traffic in the existing technology and improves security and bandwidth utilization efficiency.
Patent Information
- Application Number
- CN202411038057.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-31
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2044-07-31
AI Technical Summary
In a scenario where the management network and business network are isolated, it is difficult to realize hybrid networking of container clusters with existing technology, resulting in incomplete separation of management and business traffic, low security, and management traffic occupying the bandwidth of the business network card.
By deploying a container cluster in which the management network and business network are isolated from each other, a virtual network is built based on the network virtualization mechanism, the Internet protocol address is obtained and assigned to the resource management component of each node, and the network service request of the target node is responded to to achieve hybrid networking. Network communication.
In the scenario where the management network and business network are isolated, hybrid networking of container clusters is implemented, which meets the isolation requirements of the business network and management network, avoids management traffic occupying the bandwidth of the business network card, and improves security.
Smart Images

Figure CN118764339A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud platform technology, and in particular to a network communication method, device, equipment and storage medium based on hybrid networking. Background Art
[0002] In a network scenario where the management network and the business network are isolated, if you want to build a unified K8s (Kubernetes, an open source platform for managing containers) cluster to manage the services of each business area, the K8s specification requires that the management nodes of the management area must be interoperable with the computing nodes of the business area at layer 2 / 3. Currently, only the management network meets the requirements, but the management network is not suitable for carrying customer containerized services. First, the network card of the management network is generally a Gigabit network card, which cannot meet the business bandwidth requirements. If a network card of 10 Gigabit or above is required, the customer cost increase is unacceptable. Secondly, when the management network is used to form a cluster, the containerized services of each business area have no physical network isolation, which is not security compliant. If the business networks of each business area are connected through the business network card and the management network of the management area to build a cluster, firstly, it does not meet the management and security requirements, and secondly, the management request will occupy the bandwidth of the business network card. Both of the above solutions have disadvantages.
[0003] In addition, there is a multi-NIC solution represented by multus (open source K8s network solution, Kubernetes CNI plug-in), which can allocate multiple network interfaces to container Pods (the basic unit in Kubernetes), such as allocating both the management network and the business network to containers. However, this method still has disadvantages. K8s's Service (a strategy for accessing Pods in a K8s cluster) can only identify one IP address (Internet Protocol Address) of the Pod, called the primary IP. That is, even if multiple IPs are allocated to the Pod, the load can only be distributed to the primary IP when accessing the container service through SVC (Service), and it cannot distinguish whether to use the management network or the business network based on the network type. This function is very limited and can only meet some scenarios where Pods communicate directly, so it is not very versatile. Secondly, this method also affects the isolation between the business networks. The management network is directly exposed to the container Pod, and the business Pods can access each other across business areas through the management network, which has low security.
[0004] Therefore, there is an urgent need to propose a network communication method, device, equipment and storage medium based on hybrid networking that can improve security while satisfying the isolation of the business network and the management network. Summary of the invention
[0005] Based on this, it is necessary to provide a network communication method, device, computer equipment and storage medium that can improve security while meeting the isolation requirements of the business network and the management network in order to address the above technical problems.
[0006] In a first aspect, a network communication method based on hybrid networking is provided, the method comprising:
[0007] Deploy a container cluster in which a management network and a business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node;
[0008] Based on the network virtualization mechanism, build a virtual network connecting multiple nodes;
[0009] obtaining at least one Internet Protocol address in the virtual network and assigning the Internet Protocol address to a resource management component of a target class on each node;
[0010] Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, a network service request issued by a target node is responded to to realize network communication of a hybrid network.
[0011] Optionally, the method for deploying a container cluster in which the management network and the service network are isolated from each other includes:
[0012] Check whether the kernel version of each node in the system meets the preset standards;
[0013] In response to detecting that the kernel version of each node in the system meets the preset standard, setting a unique identifier for each node and synchronizing the time of each node;
[0014] Constructing a mapping relationship between a unique identifier and an Internet protocol corresponding to a physical network, and adding the mapping relationship to a target file corresponding to the node;
[0015] Close the factors that affect the deployment of the container cluster, where the factors at least include firewalls, security protection systems, and swap partitions;
[0016] At the same time, install the containerized deployment environment;
[0017] In response to detecting that the containerized deployment environment has been successfully installed, deploying an initial container cluster based on the selected target container cluster deployment mode;
[0018] During the deployment process, check the status of each node and determine whether there is any abnormality;
[0019] In response to detecting an abnormal node status, determine whether redeployment is required based on the status information and deployment progress of the abnormal node;
[0020] In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
[0021] Optionally, in response to detecting that the initial container cluster has been deployed, the method includes:
[0022] Dividing the initial container cluster into a management area and a business area;
[0023] Connecting the management network card of the management area and / or the business area based on the management network, and connecting the business network card of the corresponding business area based on the target business network, wherein the physical links of the business networks of any two business areas are not connected;
[0024] Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
[0025] Optionally, deploying corresponding nodes according to the region attribute of each region in the container cluster includes:
[0026] In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area;
[0027] In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
[0028] Optionally, based on the network virtualization mechanism, building a virtual network connecting multiple nodes includes:
[0029] In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using Geneve or VXLan strategy;
[0030] Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
[0031] Optionally, the resource management component for allocating the Internet Protocol address on the virtual network to the target class on each node includes:
[0032] Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses;
[0033] In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management type resource management component on each node, wherein the Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management type resource management component.
[0034] Optionally, based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, responding to the service request issued by the target resource management component includes:
[0035] In response to receiving the service request, detecting a category of a target resource management component that issues the service request;
[0036] In response to detecting that the category is a management category, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0037] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, sending the service request to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network;
[0038] In response to detecting that the category is a business class, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0039] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network.
[0040] In a second aspect, a network communication device based on hybrid networking is provided, the device comprising:
[0041] A deployment module, used to deploy a container cluster in which a management network and a business network are isolated from each other, and to deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node;
[0042] A virtual network construction module is used to build a virtual network connecting multiple nodes based on a network virtualization mechanism;
[0043] an allocation module, configured to obtain at least one Internet Protocol address in the virtual network and allocate the Internet Protocol address to a resource management component of a target category on each node;
[0044] The request response module is used to respond to the network service request issued by the target node based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, so as to realize the network communication of the hybrid network.
[0045] In a third aspect, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the following steps are implemented:
[0046] Deploy a container cluster in which a management network and a business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node;
[0047] Based on the network virtualization mechanism, build a virtual network connecting multiple nodes;
[0048] obtaining at least one Internet Protocol address in the virtual network and assigning the Internet Protocol address to a resource management component of a target class on each node;
[0049] Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, a network service request issued by a target node is responded to to realize network communication of a hybrid network.
[0050] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0051] Deploy a container cluster in which a management network and a business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node;
[0052] Based on the network virtualization mechanism, build a virtual network connecting multiple nodes;
[0053] obtaining at least one Internet Protocol address in the virtual network and assigning the Internet Protocol address to a resource management component of a target class on each node;
[0054] Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, a network service request issued by a target node is responded to to realize network communication of a hybrid network.
[0055] In a fifth aspect, a computer program product is provided, the computer program product comprising a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0056] Deploy a container cluster in which a management network and a business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node;
[0057] Based on the network virtualization mechanism, build a virtual network connecting multiple nodes;
[0058] obtaining at least one Internet Protocol address in the virtual network and assigning the Internet Protocol address to a resource management component of a target class on each node;
[0059] Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, a network service request issued by a target node is responded to to realize network communication of a hybrid network.
[0060] The above-mentioned network communication method, device, equipment and storage medium based on hybrid networking, the method includes: deploying a container cluster in which the management network and the business network are isolated from each other, and deploying corresponding nodes according to the regional attributes of each area in the container cluster, the nodes including at least one of the following: computing nodes and management nodes; based on the network virtualization mechanism, building a virtual network connecting multiple nodes; obtaining at least one Internet Protocol address in the virtual network, and assigning the Internet Protocol address to the resource management component of the target category on each node; based on the resource management component to which the Internet Protocol address has been assigned and the virtual network, responding to the network service request issued by the target node to realize network communication of hybrid networking. The present application realizes hybrid networking of container clusters in the scenario where the management network and the business network are isolated, meets the requirements of isolating the business network and the management network in the container cluster, realizes the separation of management and business traffic, avoids the management traffic occupying the bandwidth of the business network card, and realizes network intercommunication of hybrid networking through the virtual network constructed based on the management network, with high security. BRIEF DESCRIPTION OF THE DRAWINGS
[0061] Figure 1 An application environment diagram of a network communication method based on hybrid networking in an embodiment;
[0062] Figure 2 A schematic diagram of a flow chart of a network communication method based on hybrid networking in one embodiment;
[0063] Figure 3 It is a schematic diagram of the structure of a container cluster based on hybrid networking in one embodiment;
[0064] Figure 4 A schematic diagram of the regional division of a container cluster structure based on hybrid networking in one embodiment;
[0065] Figure 5 A schematic diagram of another container cluster structure area division based on hybrid networking in one embodiment;
[0066] Figure 6 The diagram is a schematic diagram of a container cluster structure based on a virtual network based on hybrid networking in one embodiment;
[0067] Figure 7 It is a structural block diagram of a network communication device based on hybrid networking in one embodiment;
[0068] Figure 8FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0070] It should be understood that in the description of the present application, unless the context clearly requires otherwise, words such as "include", "comprises", and the like throughout the specification should be interpreted as including rather than being exclusive or exhaustive; that is, as including but not limited to.
[0071] It should also be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In addition, in the description of this application, unless otherwise specified, "plurality" means two or more.
[0072] It should be noted that the terms "S1", "S2", etc. are only used for the purpose of describing the steps, and do not specifically refer to the order or sequence, nor are they used to limit the present application. They are only for the convenience of describing the method of the present application, and cannot be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in this field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection required by the present application.
[0073] With the rapid development of cloud computing and containerization technology, Kubernetes (K8s, an open source platform for managing containerized applications and service clusters) has become a popular container orchestration system and is widely used in enterprise-level data centers and cloud services. K8s has many network plug-ins, all of which follow the CNI (container networking interface) specification, such as Calico, Flannel, Cilium, kube-ovn (all open source software projects for container networks), etc. The main responsibilities of the CNI plug-in are to assign IP addresses to Pods (resource management components, the most basic execution unit of Kubernetes applications), configure network interfaces, and manage network policies. The use of CNI generally requires that management nodes and business nodes can communicate at Layer 2 or Layer 3. The management components on the business nodes need to access the control plane of the cluster, and the global log / monitoring services on the management nodes also need to be able to access Pods in order to obtain Get business logs and monitoring data; however, the user's real scenario is often much more complicated than this, especially for high-end customers such as finance. In order to ensure security, the management area and different business areas are usually divided. The servers in the management area and each business area are equipped with a management network card (gigabit) to connect. In addition to the management network, the business area also has an independent business network (10 Gigabit+) for carrying business. The business networks between business areas are physically isolated, and the business of each area cannot directly use the management network. The isolation of the management network and the business network has higher security, and also achieves the separation of management and business traffic. According to the background technology, in this network scenario, the existing technology has many disadvantages.
[0074] In order to solve the above technical problems, the present application provides a network communication method, apparatus, equipment and storage medium based on hybrid networking, so that in the scenario where the management network and the business network are isolated, the hybrid networking of the container cluster is realized, the requirements of isolating the business network and the management network in the container cluster are met, the separation of management and business traffic is realized, and the management traffic is avoided from occupying the bandwidth of the business network card. Through the virtual network built on the management network, the network intercommunication of the hybrid networking is realized with high security.
[0075] The network communication method based on hybrid networking provided in this application can be applied to Figure 1 In the application environment shown, the terminal 102 communicates with the data processing platform set on the server 104 through the network, wherein the terminal 102 can be but not limited to various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.
[0076] In one embodiment, Figure 2As shown, a network communication method based on hybrid networking is provided, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0077] S1: Deploy a container cluster in which a management network and a business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, where the nodes include at least one of the following: a computing node and a management node.
[0078] It should be noted that the container cluster refers to the K8s (Kubernetes) container cluster, which is an open source container orchestration platform that provides a series of complete functions such as deployment and operation, resource scheduling, service discovery and dynamic scaling for containerized applications. It aims to improve the convenience of large-scale container cluster management. The regional attributes are management and business. Based on the regional attributes, the K8s container cluster can be divided into business areas and management areas. Corresponding nodes are deployed in each area, such as computing nodes in the business area and management nodes in the management area.
[0079] In some specific embodiments, Figure 3 As shown, the deployment method of the container cluster in which the management network and the service network are isolated from each other includes:
[0080] Pre-deployment environment preparation, including: Check whether the kernel version of each node in the system meets the preset standards to ensure that the system kernel version of all nodes meets the requirements of Kubernetes. Generally, the kernel version is recommended to be above 3.10;
[0081] In response to detecting that the kernel version of each node in the system meets the preset standard, a unique identifier is set for each node, and the time of each node is synchronized, wherein the unique identifier is set to a unique host name for each node, and the time synchronization of all nodes is ensured, and the NTP service (Network Time Protocol, a protocol used to synchronize computer time) can be used for time synchronization;
[0082] Construct a mapping relationship between a unique identifier and an Internet protocol of the corresponding physical network, and add the mapping relationship to a target file of the corresponding node, wherein the target file is the / etc / hosts file, i.e., add a mapping between the host name and the IP address (Internet Protocol address) in the / etc / hosts file of all nodes;
[0083] Disable factors that affect the deployment of container clusters. The factors include at least firewalls, security protection systems (SELinux), and swap partitions. By disabling firewalls and SELinux, you can avoid security policies from affecting the normal operation of the Kubernetes cluster. Kubernetes requires disabling swap partitions to improve cluster stability.
[0084] At the same time, install the containerized deployment environment, that is, install the Docker containerized environment, configure the Docker image accelerator to speed up image downloads, and add the YUM software source to install Kubernetes related components;
[0085] In response to detecting that the containerized deployment environment has been successfully installed, an initial container cluster is deployed based on the selected target container cluster deployment method, wherein the cluster deployment method may include using kubeadm, minikube, and binary packages, etc. In actual operation, the most suitable creation method can be selected according to specific needs and resource conditions. For example, for a test environment, minikube or kubeadm can be used for rapid construction. For a production environment, kubeadm or binary packages can be used to ensure the stability and security of the cluster. The embodiment of the present application uses kubeadm to create a K8s cluster. When the deployment environment is ready, the specific process also includes: using a package manager such as YUM or APT to install Kubernetes core components such as kubeadm, kubelet, and kubectl; using the kubeadm config images list command to view the required image list, and from Docker Download the images required by K8s from Hub or other image repositories; execute the kubeadminit command on the Master node (host node) and complete the initialization of the Master node according to the prompts; add the Node node to the Kubernetes cluster, use the kubeadmjoin command and specify the IP address and port of the Master node; deploy network plug-ins: Kubernetes clusters require network plug-ins to provide network communication between Pods (resource management components). Commonly used network plug-ins include Calico and Flannel.
[0086] During the deployment process, check the status of each node and determine whether there is any abnormality. Use the kubectl get nodes command to view the node status in the cluster and the kubectl get pods --all-namespaces command to view the Pod status of all namespaces in the cluster.
[0087] In response to detecting an abnormal node state, judging whether redeployment is required based on the state information and deployment progress of the abnormal node, that is, when it is detected that the state of the abnormal node deviates greatly from the normal state and / or the impact of redeployment on the progress is small, it is determined that redeployment is required;
[0088] In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
[0089] Further, such as Figure 4 As shown, in response to detecting that the initial container cluster has been deployed, the method includes:
[0090] The initial container cluster is divided into a management area and a business area, that is, a certain proportion of nodes are divided according to the initial container cluster for deploying management nodes, and this area is the management area. The same is true for the business area. The setting ratio of the management area (i.e., the management area) can be 10%, and 90% can be defined as the business area. The business area can serve different business departments. Therefore, the business area can be divided again according to the business service type, such as setting 20% of the business area as the Internet area, and setting the other 20% of the business area as the core business area, etc.;
[0091] The management network card of the management area and / or the business area is connected based on the management network, and the business network card of the corresponding business area is connected based on the target business network, wherein the business network physical links of any two business areas are not connected, that is, the management network card of each node is connected by a switch network to generate a corresponding management network, such as Figure 5 As shown in the figure, the network of the management network is 192.168.0.1 / 16, and the business network cards of the nodes in each subdivided business area are connected by switches to generate multiple business areas such as the Internet business area and the core business area. However, the physical links of the business networks in each business area are not connected. For example, the network of the Internet business area is 172.10.0.1 / 16, and the network of the core business area is 172.20.0.1 / 16, etc.;
[0092] Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
[0093] In some specific implementations, deploying corresponding nodes according to the region attribute of each region in the container cluster includes:
[0094] In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area;
[0095] In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
[0096] Among them, the management node is used to manage the computing nodes. It is generally the master node in the K8s cluster and can provide log services, monitoring services, API servers (ApiServer), controller managers (ControllerManager), etc. The computing nodes are used to process the business corresponding to each area. They are generally slave nodes in the K8s cluster and can include container applications, container services, management agents, etc.
[0097] In the above implementation, a hybrid network with isolated management network and business network is constructed to generate a hybrid network of K8s cluster, thereby realizing the separation of management and business traffic, avoiding the management traffic occupying the bandwidth of the business network card, and meeting the user's K8s cluster business network and management network isolation requirements.
[0098] S2: Based on the network virtualization mechanism, a virtual network connecting multiple nodes is constructed.
[0099] It should be noted that the network virtualization mechanism refers to Geneve or VXLan technology, among which VXLan (Virtual Extensible local area network) is a network virtualization technology. VXLan encapsulates traffic and extends it to the third-layer gateway, so that virtual machines can access servers on external IP subnets; Geneve (Generic network virtualization encapsulation) is a new open source data virtualization encapsulation (tunnel) protocol that aims to solve the current problem of lack of flexibility in data transmission and meet users' various flexible requirements in security and business application support; VXLan and Geneve technologies are both designed to solve the expansion problem during large-scale cloud computing deployment.
[0100] In some specific embodiments, Figure 6 As shown in the figure, based on the network virtualization mechanism, building a virtual network connecting multiple nodes includes:
[0101] In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using a Geneve or VXLan strategy, wherein the virtual network is an Overlay tunnel network;
[0102] Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
[0103] Specifically, on all nodes of the K8s cluster, based on the management network, Geneve / VXLan technology is used to build an Overlay tunnel network as the management network of the K8s container cluster, and the computing nodes and management nodes in the K8s container cluster are connected through the management network, such as Figure 6 As shown, the Overlay network can be 10.10.0.1 / 16, wherein the construction process of the Overlay tunnel network is a common method and will not be repeated here. The embodiment of the present application is illustrated by a vxlan tunnel network, such as Figure 6 As shown in the figure, after its construction is completed, the vxlan tunnel network can be used to achieve two-way network interconnection between the management Pod in the management area and the business Pod in the business area, such as connecting lines ① and ③. The monitoring service in the management area is connected to the management Agent and container application in the Internet business area through the vxlan tunnel network.
[0104] In the above implementation, a virtual network corresponding to the management network is constructed based on network virtualization technology, and the management node and business node of the K8s container cluster are connected through the virtual network to achieve two-way network interconnection between the management node and the business node, thereby improving the reliability of network communication in the container cluster.
[0105] S3: Acquire at least one Internet Protocol address in the virtual network, and assign the Internet Protocol address to a resource management component of a target category on each node.
[0106] It should be noted that the Internet Protocol address refers to the IP address in the Overlay tunnel network, the target category refers to one of the management class and the business class, and the resource management components are the management class Pod and the business class Pod of each node in the K8s container cluster.
[0107] In some specific embodiments, the resource management component that allocates the Internet Protocol address on the virtual network to the target class on each node includes:
[0108] Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses, i.e., available IP addresses and used IP addresses;
[0109] In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management class resource management component on each node. The Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management class resource management component, that is, the management class Pod on the management node and the computing node is allocated the IP address of this Overlay tunnel network. The IP address segment of this Overlay network cannot overlap with the physical network (including the management network and the business network), and management class Pods can communicate with each other based on this IP.
[0110] In some embodiments, the method further comprises:
[0111] Based on the business network, the business network IP address of the business area is directly allocated to the business container Pod without tunnel encapsulation. While ensuring the performance of the business container Pod, applications outside the cluster of the business area can also directly communicate with the business container Pod in the current area, such as Figure 6 The connection line ② shown in the figure can realize the interconnection of the business container Pod in the core business area through the core business network. Among them, the veth at both ends of the connection line ② is a virtual network device in Linux, which exists in pairs and allows communication between two network namespaces. Each pair of veth devices consists of two endpoints. Data sent from one endpoint can be received by the other endpoint, thereby realizing network communication between the two network namespaces.
[0112] In the above implementation, the IP addresses of the virtual network are assigned to management Pods of different nodes, the traffic between business container Pods uses the business network card, and the traffic between management Pods uses the management network card. While the management network is not exposed to the business Pod container, the network interconnection between the management Pod and the business Pod can be achieved through the management network card, thereby improving the versatility and security of network communication in the container cluster.
[0113] S4: Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, respond to the network service request issued by the target node to achieve network communication in the hybrid network.
[0114] It should be noted that the network service request includes a target IP address, i.e., a target Internet Protocol address, which is used to determine the corresponding Pod, i.e., the resource management component.
[0115] In some specific implementations, responding to a service request issued by a target resource management component based on the resource management component to which the Internet Protocol address has been allocated and the virtual network includes:
[0116] In response to receiving a service request, detecting the category of the target resource management component that issued the service request, that is, detecting whether the service request is issued by a management class Pod or a business class Pod, so as to determine the Pod category that needs to be matched;
[0117] In response to detecting that the category is a management class, determining whether the target Internet Protocol address corresponding to the service request is in the node to which the target resource management component belongs, that is, detecting whether the target Internet Protocol address is the IP address of the node where the management class Pod that issued the request is located;
[0118] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network, that is, if the Internet Protocol address is a business class Pod of a non-node, the request is sent to the IP address of the business class Pod of other nodes through the vxlan tunnel network;
[0119] In response to detecting that the category is a business class, determining whether the target Internet Protocol address corresponding to the service request is in the node to which the target resource management component belongs, and similarly, detecting whether the target Internet Protocol address is the IP address of the node where the business class Pod that issued the request is located;
[0120] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network. That is, if the Internet Protocol address is a management Pod of a non-node, the request is sent to the IP address of the management Pod of other nodes through the vxlan tunnel network, thereby realizing two-way network interconnection between the management Pod and the business Pod based on the Overlay tunnel on the management network.
[0121] In some specific implementations, if it is detected that the service request is issued by a service class Pod of a node in a service zone, and its target Internet Protocol address is a service class Pod of a node in the service zone, the service network of the service zone is used for network communication.
[0122] In the above implementation, the business application Pod accesses the log, monitoring and other services provided on the management network based on the constructed virtual network. Conversely, the management service Pod accesses the business container Pod based on this virtual network. During the entire communication process, the business application Pod is unaware of the existence of the real management network. Without multiple IP allocations, network interconnection between the management Pod and the business Pod is achieved with high security. At the same time, the separation of management and business traffic is also achieved, avoiding management traffic from occupying the bandwidth of the business network card, and meeting the user's K8s cluster business network and management network isolation requirements.
[0123] In some specific implementations, in the process of responding to the network service request issued by the target node, the method further includes:
[0124] Perform segment detection on the virtual network, wherein the segmentation can be divided in equal proportion according to the parameters set according to actual needs. For example, if the parameter is 8, the virtual network is divided into 8 network segments in equal proportion, or the virtual network is segmented according to the importance, such as the first 20% is the first-level important network segment, the middle 40% is the second-level important network segment, and the last 40% is the third-level important network segment. The importance corresponding to the second level is greater than that of the third level, and the third level is greater than that of the first level. The segmentation method can be selected according to the actual scenario, and no further examples will be given here;
[0125] In response to detecting that an abnormality occurs in the virtual network of the target segment, a backup link pre-set on the virtual network is obtained, wherein network parameters such as bandwidth can be compared with normal parameters to determine whether an abnormality occurs in the virtual network;
[0126] In response to detecting that the standby link is an available link, matching the bandwidth of the available link with the bandwidth of the virtual network of the target segment;
[0127] In response to detecting that the target available link matches the virtual network of the target segment successfully, that is, the absolute value of the difference between the bandwidths of the two is within a preset range, replacing the virtual network of the target segment with the target available link, wherein the preset range can be set according to actual needs;
[0128] If it is detected that multiple target available links successfully match the virtual network of the target segment, the network communication time of the entire virtual network when each target available link replaces the virtual network of the target segment is first determined;
[0129] Select the target available link with the shortest network communication time as the backup link for final replacement, and perform the replacement;
[0130] If the corresponding backup link is not matched or there is no backup link, an early warning message is sent to the user terminal to remind the user to check and handle the abnormal network in time.
[0131] In the above implementation, the virtual network is monitored in segments to effectively determine the abnormal points, and the abnormal network links are replaced by matching the corresponding backup links to restore the overall network communication in time, and when real-time recovery is not possible, the user is reminded in time, thereby improving the reliability of network communication in the hybrid network.
[0132] In the above-mentioned network communication method based on hybrid networking, the method includes: deploying a container cluster in which the management network and the business network are isolated from each other, and deploying corresponding nodes according to the regional attributes of each area in the container cluster, wherein the nodes include at least one of the following: computing nodes and management nodes; building a virtual network connecting multiple nodes based on a network virtualization mechanism; obtaining at least one Internet Protocol address in the virtual network, and assigning the Internet Protocol address to a resource management component of a target category on each node; responding to a network service request issued by a target node based on the resource management component to which the Internet Protocol address has been assigned and the virtual network to realize network communication of hybrid networking. This application enables the management network and the business network to be isolated in a scenario where the management network and the business network are isolated. , realizing the hybrid networking of K8s cluster. Management service Pod communicates based on management network, and business application Pod communicates based on business network. Business application Pod communicates based on Overlay tunnel network built on management network to access log, monitoring and other services provided on management network. Conversely, management service Pod accesses business container Pod based on this Overlay tunnel network. During the whole communication process, business application Pod is unaware of the existence of real management network. Without multiple IP allocation, network interconnection between management Pod and business Pod is realized, which has high security. Meanwhile, separation of management and business traffic is achieved, avoiding management traffic occupying bandwidth of business network card and meeting the needs of users for isolating business network and management network of K8s cluster.
[0133] It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0134] In one embodiment, Figure 7 As shown, a network communication device based on hybrid networking is provided, including: a deployment module, a virtual network construction module, an allocation module and a request response module, wherein:
[0135] A deployment module, used to deploy a container cluster in which a management network and a business network are isolated from each other, and to deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node;
[0136] A virtual network construction module is used to build a virtual network connecting multiple nodes based on a network virtualization mechanism;
[0137] an allocation module, configured to obtain at least one Internet Protocol address in the virtual network and allocate the Internet Protocol address to a resource management component of a target category on each node;
[0138] The request response module is used to respond to the network service request issued by the target node based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, so as to realize the network communication of the hybrid network.
[0139] As a preferred implementation, in the embodiment of the present invention, the deployment module is specifically used for:
[0140] Check whether the kernel version of each node in the system meets the preset standards;
[0141] In response to detecting that the kernel version of each node in the system meets the preset standard, setting a unique identifier for each node and synchronizing the time of each node;
[0142] Constructing a mapping relationship between a unique identifier and an Internet protocol corresponding to a physical network, and adding the mapping relationship to a target file corresponding to the node;
[0143] Close the factors that affect the deployment of the container cluster, where the factors at least include firewalls, security protection systems, and swap partitions;
[0144] At the same time, install the containerized deployment environment;
[0145] In response to detecting that the containerized deployment environment has been successfully installed, deploying an initial container cluster based on the selected target container cluster deployment mode;
[0146] During the deployment process, check the status of each node and determine whether there is any abnormality;
[0147] In response to detecting an abnormal node status, determine whether redeployment is required based on the status information and deployment progress of the abnormal node;
[0148] In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
[0149] As a preferred implementation, in the embodiment of the present invention, the deployment module is further used to:
[0150] Dividing the initial container cluster into a management area and a business area;
[0151] Connecting the management network card of the management area and / or the business area based on the management network, and connecting the business network card of the corresponding business area based on the target business network, wherein the physical links of the business networks of any two business areas are not connected;
[0152] Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
[0153] As a preferred implementation, in the embodiment of the present invention, the deployment module is further used to:
[0154] In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area;
[0155] In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
[0156] As a preferred implementation, in the embodiment of the present invention, the virtual network construction module is specifically used for:
[0157] In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using Geneve or VXLan strategy;
[0158] Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
[0159] As a preferred implementation, in the embodiment of the present invention, the allocation module is specifically used for:
[0160] Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses;
[0161] In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management type resource management component on each node, wherein the Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management type resource management component.
[0162] As a preferred implementation, in the embodiment of the present invention, the request response module is specifically used for:
[0163] In response to receiving the service request, detecting a category of a target resource management component that issues the service request;
[0164] In response to detecting that the category is a management category, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0165] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, sending the service request to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network;
[0166] In response to detecting that the category is a business class, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0167] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network.
[0168] For the specific definition of the network communication device based on hybrid networking, please refer to the definition of the network communication method based on hybrid networking above, which will not be repeated here. Each module in the above-mentioned network communication device based on hybrid networking can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0169] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a network communication method based on hybrid networking is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0170] Those skilled in the art will understand that Figure 8The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0171] In one embodiment, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
[0172] S1: deploy a container cluster in which the management network and the business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: computing nodes and management nodes;
[0173] S2: Based on the network virtualization mechanism, a virtual network connecting multiple nodes is constructed;
[0174] S3: Obtain at least one Internet Protocol address in the virtual network, and assign the Internet Protocol address to a resource management component of a target category on each node;
[0175] S4: Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, respond to the network service request issued by the target node to achieve network communication in the hybrid network.
[0176] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0177] Check whether the kernel version of each node in the system meets the preset standards;
[0178] In response to detecting that the kernel version of each node in the system meets the preset standard, setting a unique identifier for each node and synchronizing the time of each node;
[0179] Constructing a mapping relationship between a unique identifier and an Internet protocol corresponding to a physical network, and adding the mapping relationship to a target file corresponding to the node;
[0180] Close the factors that affect the deployment of the container cluster, where the factors at least include firewalls, security protection systems, and swap partitions;
[0181] At the same time, install the containerized deployment environment;
[0182] In response to detecting that the containerized deployment environment has been successfully installed, deploying an initial container cluster based on the selected target container cluster deployment mode;
[0183] During the deployment process, check the status of each node and determine whether there is any abnormality;
[0184] In response to detecting an abnormal node status, determine whether redeployment is required based on the status information and deployment progress of the abnormal node;
[0185] In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
[0186] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0187] Dividing the initial container cluster into a management area and a business area;
[0188] Connecting the management network card of the management area and / or the business area based on the management network, and connecting the business network card of the corresponding business area based on the target business network, wherein the physical links of the business networks of any two business areas are not connected;
[0189] Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
[0190] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0191] In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area;
[0192] In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
[0193] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0194] In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using Geneve or VXLan strategy;
[0195] Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
[0196] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0197] Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses;
[0198] In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management type resource management component on each node, wherein the Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management type resource management component.
[0199] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0200] In response to receiving the service request, detecting a category of a target resource management component that issues the service request;
[0201] In response to detecting that the category is a management category, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0202] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, sending the service request to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network;
[0203] In response to detecting that the category is a business class, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0204] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network.
[0205] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0206] S1: deploy a container cluster in which the management network and the business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: computing nodes and management nodes;
[0207] S2: Based on the network virtualization mechanism, a virtual network connecting multiple nodes is constructed;
[0208] S3: Obtain at least one Internet Protocol address in the virtual network, and assign the Internet Protocol address to a resource management component of a target category on each node;
[0209] S4: Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, respond to the network service request issued by the target node to achieve network communication in the hybrid network.
[0210] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0211] Check whether the kernel version of each node in the system meets the preset standards;
[0212] In response to detecting that the kernel version of each node in the system meets the preset standard, setting a unique identifier for each node and synchronizing the time of each node;
[0213] Constructing a mapping relationship between a unique identifier and an Internet protocol corresponding to a physical network, and adding the mapping relationship to a target file corresponding to the node;
[0214] Close the factors that affect the deployment of the container cluster, where the factors at least include firewalls, security protection systems, and swap partitions;
[0215] At the same time, install the containerized deployment environment;
[0216] In response to detecting that the containerized deployment environment has been successfully installed, deploying an initial container cluster based on the selected target container cluster deployment mode;
[0217] During the deployment process, check the status of each node and determine whether there is any abnormality;
[0218] In response to detecting an abnormal node status, determine whether redeployment is required based on the status information and deployment progress of the abnormal node;
[0219] In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
[0220] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0221] Dividing the initial container cluster into a management area and a business area;
[0222] Connecting the management network card of the management area and / or the business area based on the management network, and connecting the business network card of the corresponding business area based on the target business network, wherein the physical links of the business networks of any two business areas are not connected;
[0223] Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
[0224] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0225] In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area;
[0226] In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
[0227] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0228] In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using Geneve or VXLan strategy;
[0229] Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
[0230] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0231] Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses;
[0232] In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management type resource management component on each node, wherein the Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management type resource management component.
[0233] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0234] In response to receiving the service request, detecting a category of a target resource management component that issues the service request;
[0235] In response to detecting that the category is a management category, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0236] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, sending the service request to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network;
[0237] In response to detecting that the category is a business class, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0238] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network.
[0239] In one embodiment, a computer program product is provided, the computer program product comprising a computer program, the computer program when executed by a processor implements the following steps:
[0240] S1: deploy a container cluster in which the management network and the business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: computing nodes and management nodes;
[0241] S2: Based on the network virtualization mechanism, a virtual network connecting multiple nodes is constructed;
[0242] S3: Obtain at least one Internet Protocol address in the virtual network, and assign the Internet Protocol address to a resource management component of a target category on each node;
[0243] S4: Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, respond to the network service request issued by the target node to achieve network communication in the hybrid network.
[0244] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0245] Check whether the kernel version of each node in the system meets the preset standards;
[0246] In response to detecting that the kernel version of each node in the system meets the preset standard, setting a unique identifier for each node and synchronizing the time of each node;
[0247] Constructing a mapping relationship between a unique identifier and an Internet protocol corresponding to a physical network, and adding the mapping relationship to a target file corresponding to the node;
[0248] Close the factors that affect the deployment of the container cluster, where the factors at least include firewalls, security protection systems, and swap partitions;
[0249] At the same time, install the containerized deployment environment;
[0250] In response to detecting that the containerized deployment environment has been successfully installed, deploying an initial container cluster based on the selected target container cluster deployment mode;
[0251] During the deployment process, check the status of each node and determine whether there is any abnormality;
[0252] In response to detecting an abnormal node status, determine whether redeployment is required based on the status information and deployment progress of the abnormal node;
[0253] In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
[0254] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0255] Dividing the initial container cluster into a management area and a business area;
[0256] Connecting the management network card of the management area and / or the business area based on the management network, and connecting the business network card of the corresponding business area based on the target business network, wherein the physical links of the business networks of any two business areas are not connected;
[0257] Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
[0258] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0259] In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area;
[0260] In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
[0261] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0262] In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using Geneve or VXLan strategy;
[0263] Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
[0264] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0265] Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses;
[0266] In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management type resource management component on each node, wherein the Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management type resource management component.
[0267] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0268] In response to receiving the service request, detecting a category of a target resource management component that issues the service request;
[0269] In response to detecting that the category is a management category, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0270] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, sending the service request to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network;
[0271] In response to detecting that the category is a business class, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs;
[0272] In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network.
[0273] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0274] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0275] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application.
Claims
1. A network communication method based on hybrid networking, characterized in that: The method comprises: Deploy a container cluster in which a management network and a business network are isolated from each other, and deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node; Based on the network virtualization mechanism, build a virtual network connecting multiple nodes; obtaining at least one Internet Protocol address in the virtual network and assigning the Internet Protocol address to a resource management component of a target class on each node; Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, a network service request issued by a target node is responded to to realize network communication of a hybrid network.
2. The network communication method based on hybrid networking according to claim 1, characterized in that: The method for deploying a container cluster in which the management network and the service network are isolated from each other includes: Check whether the kernel version of each node in the system meets the preset standards; In response to detecting that the kernel version of each node in the system meets the preset standard, setting a unique identifier for each node and synchronizing the time of each node; Constructing a mapping relationship between a unique identifier and an Internet protocol corresponding to a physical network, and adding the mapping relationship to a target file corresponding to the node; Close the factors that affect the deployment of the container cluster, where the factors at least include firewalls, security protection systems, and swap partitions; At the same time, install the containerized deployment environment; In response to detecting that the containerized deployment environment has been successfully installed, deploying an initial container cluster based on the selected target container cluster deployment mode; During the deployment process, check the status of each node and determine whether there is any abnormality; In response to detecting an abnormal node status, determine whether redeployment is required based on the status information and deployment progress of the abnormal node; In response to detecting that redeployment is required, the process rolls back to the step of deploying the initial container cluster and redeploys.
3. The network communication method based on hybrid networking according to claim 2, characterized in that: In response to detecting that the initial container cluster has been deployed, the method includes: Dividing the initial container cluster into a management area and a business area; Connecting the management network card of the management area and / or the business area based on the management network, and connecting the business network card of the corresponding business area based on the target business network, wherein the physical links of the business networks of any two business areas are not connected; Based on the management network and at least one target service network, a container cluster is generated in which the management network and the service network are isolated from each other.
4. The network communication method based on hybrid networking according to claim 3, characterized in that: Deploying corresponding nodes according to the regional attributes of each region in the container cluster includes: In response to detecting that the area attribute of the target area is a management area, deploying a management node in the target area; In response to detecting that the area attribute of the target area is a business area, a computing node is deployed in the target area.
5. The network communication method based on hybrid networking according to claim 1, characterized in that: Based on the network virtualization mechanism, building a virtual network connecting multiple nodes includes: In response to detecting that the management network is in a normal operating state, constructing a virtual network based on the management network using Geneve or VXLan strategy; Based on the virtual network, multiple nodes in the container cluster are connected, wherein the Internet Protocol address of the virtual network does not overlap with the Internet Protocol addresses of the management network and the service network.
6. The network communication method based on hybrid networking according to claim 1 or 5, characterized in that: The resource management component for allocating Internet Protocol addresses on the virtual network to target classes on each node includes: Obtaining relevant information of the virtual network, the relevant information including available Internet Protocol addresses and used Internet Protocol addresses; In response to detecting an Internet Protocol address allocation request, the available Internet Protocol address is allocated to the management type resource management component on each node, wherein the Internet Protocol address allocation request is used to request allocation of an Internet Protocol address to the management type resource management component.
7. The network communication method based on hybrid networking according to claim 1, characterized in that: Based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, responding to the service request issued by the target resource management component includes: In response to receiving the service request, detecting a category of a target resource management component that issues the service request; In response to detecting that the category is a management category, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs; In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, sending the service request to the business class resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network; In response to detecting that the category is a business class, determining whether a target Internet Protocol address corresponding to the service request is in a node to which a target resource management component belongs; In response to detecting that the target Internet Protocol address corresponding to the service request is not in the node to which the target resource management component belongs, the service request is sent to the management resource management component of other nodes to which the target Internet Protocol address belongs based on the virtual network.
8. A network communication device based on hybrid networking, characterized in that: The device comprises: A deployment module, used to deploy a container cluster in which a management network and a business network are isolated from each other, and to deploy corresponding nodes according to the regional attributes of each region in the container cluster, wherein the nodes include at least one of the following: a computing node and a management node; A virtual network construction module is used to build a virtual network connecting multiple nodes based on a network virtualization mechanism; an allocation module, configured to obtain at least one Internet Protocol address in the virtual network and allocate the Internet Protocol address to a resource management component of a target category on each node; The request response module is used to respond to the network service request issued by the target node based on the resource management component to which the Internet Protocol address has been allocated and the virtual network, so as to realize the network communication of the hybrid network.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Systems and methods for mixed mode handling of IPv6 and IPv4 traffic by a virtual server
CN102771089A
Dynamic IP address acquisition method, system and device for virtual machines
CN104468574A
Method for realizing security isolation of virtual machine based on OpenStack
CN112099913A
Deployment method and device for open virtual network
CN113472575A
Kubernetes network deployment method and device, electronic equipment and storage medium
CN114944971A
Cited By
Intercommunication method, system and equipment for service network and management network of tenant in cloud scene
CN119766875A
Method for publishing network time protocol service and electronic equipment
CN121070528A
Method and system for processing resource request in Kubernetes cluster
CN121098926A
Communication method of networking system, hybrid networking system, device and equipment
CN121644574A
Communication method of networking system, hybrid networking system, apparatus and device
CN121644574B
