An information processing method and device, electronic equipment and storage medium

CN116414515BActive Publication Date: 2026-10-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210006427.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-05
Publication Date
2026-10-27
Estimated Expiration
2042-01-05

AI Technical Summary

Benefits of technology

[0017]本公开实施例的技术方案通过创建预定服务,例如负载均衡服务,然后从IP地址资源池中为预定服务分配目标IP地址,各个预定服务分别映射有一个或多个容器。例如一个预定服务映射一个至少包括一个容器的容器集合(pod)。通过预定服务与容器之间的映射关系,在为预定服务分配目标IP地址后即可通过预定服务的目标IP地址确定相应的容器。由于预定服务与容器之间存在映射关系,每个预定服务都分别映射有相应的容器,将预定服务的目标IP地址广播出去之后,外部访问端即可通过目标IP地址对该目标IP地址映射的一个或多个容器进行访问,如此,可以实现了客户端通过一个IP地址访问多个容器的功能。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116414515B_ABST
    Figure CN116414515B_ABST
Patent Text Reader

Abstract

The technical scheme of the present application provides an information processing method, comprising: creating a predetermined service; allocating a target IP address for the predetermined service from an IP address resource pool; wherein the predetermined service is mapped with one or more containers; broadcasting the target IP address; wherein the target IP address is used to access the containers mapped by the predetermined service.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of information processing, and more particularly to an information processing method, apparatus, electronic device and storage medium. Background Technology

[0002] With the development of cloud service technologies, such as cloud native, more and more applications are being containerized based on container management platforms, such as Kubernetes for containerization and container orchestration. The types of applications or services are also shifting from small-scale single-machine applications to large-scale distributed systems.

[0003] Due to the network architecture of container management platforms such as Kubernetes, services can only be accessed within the Kubernetes cluster via internal Pod IPs. The public internet or other subnets within that network cannot directly access the service using the Pod IP; therefore, it is necessary to effectively expose the service. Summary of the Invention

[0004] This invention provides an information processing method, apparatus, electronic device, and storage medium.

[0005] A first aspect of this disclosure provides an information processing method, comprising: creating a pre-defined service; allocating a target IP address to the pre-defined service from an IP address resource pool; wherein the pre-defined service is mapped to one or more containers; and broadcasting the target IP address; wherein the target IP address is used to access the container mapped by the pre-defined service.

[0006] In another embodiment, the IP address resource pool includes multiple IP addresses; wherein, each IP address has a mapping information; the character length of the mapping information is less than the character length of the IP address; the method includes: generating the IP address configuration for the predetermined service allocation based on the mapping information corresponding to the target IP address.

[0007] In another embodiment, when the number of the predetermined services is N, the step of allocating a target IP address to the predetermined service from the IP address resource pool includes: sequentially determining N target mapping information from the mapping information, wherein the target mapping information is used to determine the target IP address.

[0008] In another embodiment, the reservation service includes: a first type of reservation service supporting IPv4 and a second type of reservation service supporting IPv6.

[0009] In another embodiment, the scheduled service includes a load balancing service.

[0010] A second aspect of this disclosure provides an information processing apparatus, comprising: a creation module for creating a predetermined service; a target IP allocation module for allocating a target IP address to the predetermined service from an IP address resource pool; wherein the predetermined service is mapped to one or more containers; and a broadcast module for broadcasting the target IP address; wherein the target IP address is used to access the container mapped by the predetermined service.

[0011] In another embodiment, the IP address resource pool includes multiple IP addresses; wherein, each IP address has a mapping information; the character length of the mapping information is less than the character length of the IP address; the apparatus includes: a generation module, configured to generate the IP address configuration allocated by the predetermined service based on the mapping information corresponding to the target IP address.

[0012] In another embodiment, the target IP allocation module is further configured to, when the number of predetermined services is N, sequentially determine N target mapping information from the mapping information, wherein the target mapping information is used to determine the target IP address.

[0013] In another embodiment, the reservation service includes: a first type of reservation service supporting IPv4 and a second type of reservation service supporting IPv6.

[0014] In another embodiment, the scheduled service includes a load balancing service.

[0015] A third aspect of this disclosure provides an electronic device, including: a processor; and a memory storing program instructions that, when executed by the processor, cause the electronic device to perform the method described in any of the preceding embodiments.

[0016] A fourth aspect of this disclosure provides a storage medium storing a program that, when run by a processor, executes the method described in any of the preceding embodiments.

[0017] The technical solution of this disclosure creates a pre-defined service, such as a load balancing service, and then allocates a target IP address to the pre-defined service from an IP address resource pool. Each pre-defined service maps to one or more containers. For example, one pre-defined service maps to a container set (pod) that includes at least one container. Through the mapping relationship between pre-defined services and containers, after allocating a target IP address to a pre-defined service, the corresponding container can be determined using the target IP address. Because there is a mapping relationship between pre-defined services and containers, each pre-defined service maps to a corresponding container. After broadcasting the target IP address of the pre-defined service, external access terminals can access one or more containers mapped to that target IP address through the target IP address. Thus, the function of a client accessing multiple containers through a single IP address can be realized.

[0018] The pre-defined services created in this solution are mapped to the containers, eliminating the need for additional nodes to broadcast to the target IP and thus avoiding the configuration of these additional nodes. Furthermore, as the container scales up, there's no need to increase the number of additional nodes, reducing management costs. Additionally, the absence of a limit on the number of pre-defined services improves information processing capabilities. Attached Figure Description

[0019] Figure 1 This is a schematic diagram of an information processing embodiment provided in this disclosure;

[0020] Figure 2 A method based on the embodiments of this disclosure is provided. Figure 1 A schematic diagram;

[0021] Figure 3 A method based on the embodiments of this disclosure is provided. Figure 2 A schematic diagram;

[0022] Figure 4 A method based on the embodiments of this disclosure is provided. Figure 3 A schematic diagram;

[0023] Figure 5 A schematic diagram illustrating an information processing method provided in an embodiment of this disclosure;

[0024] Figure 6 A method based on the embodiments of this disclosure is provided. Figure 5 The created diagram;

[0025] Figure 7 A deployment and embodiment provided by this disclosure Figure 6 A schematic diagram of the corresponding components;

[0026] Figure 8A method provided for embodiments of this disclosure and Figure 6 Corresponding diagram;

[0027] Figure 9 A method based on the embodiments of this disclosure is provided. Figure 6 Another schematic diagram;

[0028] Figure 10 This is a schematic diagram of the structure of an information processing device provided in an embodiment of the present disclosure. Detailed Implementation

[0029] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0030] Kubernetes clusters deployed on bare metal architectures do not natively support LoadBalancer-type service exposure. To use LoadBalancer services, third-party cloud service providers are typically required. Ingress-based service exposure, on the other hand, is based on Nginx forwarding and is more suitable for small-scale microservice scenarios. Therefore, for large-scale distributed services, NodePort-based service exposure is a frequently used method.

[0031] refer to Figure 1 This is a schematic diagram of information processing. In a distributed service, agent nodes are orchestrated using a stateful set approach. Three agent pods provide ports 30001, 30002, and 30003 respectively. Specifically, Agent-1 uses port 30001, Agent-2 uses port 30002, and Agent-3 uses port 30003. When providing services externally, services are exposed using node ports accessible to external machines. NodePort40001, NodePort40002, and NodePort40003 forward traffic to Port30001, Port30002, and Port30003 respectively. When user traffic needs to be sent to an agent pod, it only needs to connect using any IP address of the node and its corresponding NodePort as the socket connection string. For example, accessing Agent-1 via 192.168.1.1:40001.

[0032] Therefore, these three agent services can be exposed using node IP address (NodeIp) and node port (NodePort), for example:

[0033] Agent-1 is exposed via 192.168.1.1:40001, meaning it can be accessed through 192.168.1.1:40001. Agent-2 is exposed via 192.168.1.2:40002, meaning it can be accessed through 192.168.1.2:40002. Agent-3 is exposed via 192.168.1.3:40003, meaning it can be accessed through 192.168.1.2:40003.

[0034] Since NodePort is a globally exposed method, such as the global exposure method based on Kube-proxy, where all nodes share the same port, the same Node IP can also be used for service exposure. For example:

[0035] Agent-1 is exposed via 192.168.1.1:40001, Agent-2 via 192.168.1.1:40002, and Agent-3 via 192.168.1.1:40003.

[0036] In addition, when a node in a Kubernetes cluster crashes, all Pods on that crashed node will be migrated to other nodes and restarted due to container orchestration mechanisms such as Deployment / StatefulSet, meaning that the integrity of the service will not be affected.

[0037] refer to Figure 2 , for the basis Figure 1 This is a schematic diagram. For example, when Node192.168.1.1 goes down, Agent-1 will be reassigned to another node and restarted, and the number of worker nodes of the distributed service will not change.

[0038] However, if Agent-1 exposes its service via 192.168.1.1:40001, the client will be unable to complete the connection request because Node 192.168.1.1 has gone offline. This results in inconsistent service perception: the client believes Agent-1 is offline, while the server believes three agents are still running.

[0039] Typically, a mechanism is needed to ensure service availability is not compromised by the failure of a single node. Since NodePort is global, one of the most common approaches to addressing this single point of failure is to introduce a Keepalived VIP, providing a highly available IP exposure service. (See reference) Figure 3 , as a kind of based Figure 2The diagram illustrates this. For example, pairing Node 192.168.1.1 with 192.168.1.2 creates a VIP 192.168.1.100. This way, a single point of failure in any node under the VIP will not affect the overall use of the cluster. Therefore, the service exposure method will become:

[0040] Agent-1 was exposed via 192.168.1.100:40001, Agent-2 via 192.168.1.100:40002, and Agent-3 via 192.168.1.100:40003.

[0041] In this approach, traffic can become a bottleneck for the entire cluster. Currently, all traffic passes through the Keepalived VIP node 192.168.1.100.

[0042] The network advantages of multiple nodes in a distributed environment cannot be fully utilized; apart from the Keepalived VIP node, the networks of other nodes are in an idle state.

[0043] Therefore, multiple Keepalived VIPs were introduced to distribute the traffic. (Reference) Figure 4 , as a kind of based Figure 3 This is a schematic diagram. In this case, the way the distributed service exposes itself might look like this:

[0044] Agent-1 is exposed via 192.168.1.100:40001, Agent-2 via 192.168.1.100:40002, and Agent-3 via 192.168.1.101:40003. While this multi-Keepalived VIP approach addresses single points of failure, it also introduces new problems, such as: 1) Reduced traffic: Available traffic is only half the total cluster capacity: VIPNumber = NodeNumber / 2. 2) Difficult to scale: As the cluster size increases, more Keepalive nodes need to be added. 3) Poor manageability: An additional number of VIP services equivalent to the number of cluster nodes needs to be managed. 4) High development costs: Software deployment requires maintaining multiple IPs, designing NodePorts, and high coupling.

[0045] refer to Figure 5 This is a schematic diagram illustrating an information processing method provided by the technical solution of this application. The method includes the following steps:

[0046] Step S100: Create a reservation service.

[0047] Step S200: Allocate a target IP address for the scheduled service from the IP address resource pool; the scheduled service mapping has one or more containers.

[0048] Step S300: Broadcast the target IP address; the target IP address is used to access the container mapped to the pre-defined service.

[0049] The booking service includes, but is not limited to: agency services and / or polling services.

[0050] After receiving an access request, the proxy service can transmit the corresponding access request to the container, which will then respond to the final access request. Once the container returns a response, the proxy service will further send the response to the sender of the access request.

[0051] Polling service can be a special type of proxy service that sends access requests to multiple connected or mapped containers in a polling manner by polling containers with the same function, thereby realizing the response to the access request.

[0052] In this embodiment, by creating multiple pre-defined services and then assigning target IP addresses to the pre-defined services, each pre-defined service has a target IP address and each pre-defined service is mapped to one or more containers, thus establishing a mapping relationship between the pre-defined services and containers.

[0053] After broadcasting the target IP address of each scheduled service, external machines (e.g., the client's running device) can access the corresponding scheduled service through the target IP address. Since there is a mapping relationship between the scheduled service and the container, the container corresponding to the scheduled service can be accessed through the target IP address of the scheduled service.

[0054] In one embodiment, the scheduled service is a load balancing service, i.e., a LoadBalancer Service. Access to containers is achieved through the LoadBalancer Service, exposing services running as containers in the cluster. Each LoadBalancer Service can be specifically executed through a load balancer.

[0055] The IP address resource pool can be a pre-configured pool containing multiple IP addresses. The number of IP addresses is not limited and can be determined based on actual needs. The specific method for allocating target IP addresses from the IP address resource pool to the intended service is also not limited; for example, it can be random allocation or allocation in a specific order.

[0056] The method of broadcasting the target IP address is not limited; it can be based on standard routing protocols, such as the Speaker protocol, using Layer 2 mode or Border Gateway Protocol (BGP) mode, to broadcast the target IP address of the pre-defined service. This allows external hosts to access the allocated target IP address through routing policies, and subsequently access the corresponding container through that target IP address. In this embodiment, Layer 2 mode is used to broadcast the target IP address.

[0057] refer to Figure 6 , as a kind of based Figure 5 The diagram illustrates the creation process. A cluster can include multiple containers, with one or more containers bound to physical nodes as pods. Each node contains one pod. By creating pre-defined services for pods and assigning target IP addresses to them, the corresponding pods can be accessed through these target IP addresses. The number of pre-defined services is the same as the number of nodes and pods.

[0058] For example, three LoadBalancer Services are created, and each LoadBalancer Service is assigned a target IP address: 192.168.1.100 for the leftmost LoadBalancer Service, 192.168.1.101 for the middle LoadBalancer Service, and 192.168.1.102 for the rightmost LoadBalancer Service. The LoadBalancer Service with target IP address 192.168.1.100 maps to the leftmost Pod, the LoadBalancer Service with target IP address 192.168.1.101 maps to the middle Pod, and the LoadBalancer Service with target IP address 192.168.1.102 maps to the rightmost Pod.

[0059] The target IP address 192.168.1.100 can be used to access the leftmost Pod. After broadcasting the target IP address 192.168.1.100, external machines can access the leftmost Pod through this target IP address. The target IP address 192.168.1.101 can be used to access the middle Pod. After broadcasting the target IP address 192.168.1.101, external machines can access the middle Pod through this target IP address. After broadcasting the target address 192.168.1.102, external machines can access the rightmost Pod through this target address.

[0060] By creating predefined presets and mapping one preset service to one Pod, the Pod mapped to the preset service can be accessed simply by using the target IP address assigned to the preset service. This eliminates the need for additional nodes to broadcast the target IP, thus saving on configuration operations for these additional nodes. Furthermore, as the container scales up, there's no need to add additional nodes, reducing management costs associated with managing them. Additionally, the absence of a limit on the number of preset services improves information processing capabilities. This also mitigates issues such as traffic reduction, poor scalability, poor manageability, and high development costs.

[0061] In one embodiment, in Layer 2 mode, a leader node is selected from multiple nodes. The target IP address of the LoadBalancer Service is broadcast through the speaker component of this leader node. All traffic, upon reaching the router, is distributed to the leader node, which then forwards the traffic according to the Pod corresponding to the LoadBalancer Service.

[0062] refer to Figure 6 The node in the middle is the master node, also known as the Leader Node. Figure 6 The components shown can be deployed via a daemonset.

[0063] In another embodiment, reference Figure 6 The cluster also includes a controller component that can monitor each LoadBalancer Service. If it finds that no available load balancer is available for a LoadBalancer Service, the controller component will automatically select a target IP address from the address resource pool for that LoadBalancer Service.

[0064] refer to Figure 7 For a deployment and Figure 6 A diagram of the corresponding components.

[0065] Create a cluster (e.g., a namespace), and all related resources to be deployed in Kubernetes must be under this namespace.

[0066] Deployment configuration files, such as Configmap files, are used to configure the IP address resource pool. The IP address resource pool includes the IP pool name, IP addresses, and IP address ranges. From the IP address resource pool, target IP addresses can be assigned to various pre-defined services. The availability of these IPs depends on the network environment of the Kubernetes cluster; typically, the IP addresses in the IP address resource pool are within the same subnet.

[0067] Deploy the relevant container components, including: the first controller component Controller and the protocol component Speaker.

[0068] Deploy a second controller component, such as the Operator component. This component is deployed outside of Kubernetes and needs to be able to connect to the Kubernetes cluster. Once deployed, this component can be used to automatically submit container applications containing the LoadBalancer Service to the Kubernetes cluster, and it also implements automatic IP address allocation.

[0069] Once a target IP address is assigned to a pre-defined service, the Speaker component will broadcast the target IP address to the outside world according to standard routing protocols. External machines can then access the service within the container through this target IP address.

[0070] refer to Figure 8 , in order to Figure 6 The corresponding diagram.

[0071] Each Agent Pod corresponds to a LoadBalancer Service. After detecting the LoadBalancer Service, a target IP address is assigned to the LoadBalancer Service and broadcast.

[0072] When a Node fails and a Pod is migrated, the target IP address of the LoadBalancer Service is also migrated, ensuring consistency between the client and the server.

[0073] When you need to expand the size of a Pod, you only need to add the corresponding LoadBalancer Service.

[0074] By creating a LoadBalancer Service that maps one-to-one with a Pod, and assigning a target IP address to the LoadBalancer Service, each Pod will have an independent IP address, and this IP address will be in the same subnet as the IP address of the Node.

[0075] The pre-defined services created in this solution are mapped to the containers, eliminating the need for additional nodes to broadcast to the target IP and thus avoiding the configuration of these additional nodes. Furthermore, as the container scales up, there's no need to increase the number of additional nodes, reducing management costs. Additionally, the absence of a limit on the number of pre-defined services improves information processing capabilities.

[0076] In another embodiment, the IP address resource pool includes multiple IP addresses; each IP address has a mapping information; the character length of the mapping information is less than the character length of the IP address. The format of the mapping information is not limited, and it can be, for example, a string or an identifier.

[0077] The IP address resource pool includes multiple IP addresses, facilitating the allocation of target IP addresses for each of the multiple pre-booked services. Each IP address has a mapping information, the length of which is shorter than the length of the IP address. IP address allocation is achieved by distributing this mapping information. Because the mapping information is shorter than the IP address, IP address allocation and management are simplified.

[0078] When allocating a target IP address for a pre-defined service from the IP address resource pool, the allocation is based on mapping information. For example, mapping information can be allocated to the pre-defined service. The mapping information is used to determine the pre-defined service, and the corresponding target IP address can be determined based on the mapping information.

[0079] In another embodiment, the method includes: generating an IP address configuration for a predetermined service allocation based on mapping information corresponding to the target IP address.

[0080] After assigning a target IP address to a pre-booked service, allocation record information can be generated based on the mapping information corresponding to the target IP address. This information is the IP address configuration assigned to the pre-booked service and is used to record the allocation status of the target IP address.

[0081] In another embodiment, when the number of pre-ordered services is N, allocating target IP addresses for the pre-ordered services from the IP address resource pool includes:

[0082] N target mapping information are determined sequentially from the mapping information. The target mapping information is used to determine the target IP address. N is a positive integer.

[0083] When there are multiple scheduled services, multiple Pods are accessed. By assigning target IP addresses to multiple scheduled services, the target IP addresses of multiple scheduled services are broadcast, and external machines access multiple Pods through multiple different target IP addresses.

[0084] For example, if you create N LoadBalancer Services, and each LoadBalancer Service maps to a Pod, you need to assign a target IP address to each of the N LoadBalancer Services.

[0085] Specific target IP address allocation methods may include: determining N target mapping information in sequence according to the sorting of the mapping information, and then allocating these N target mapping information to N LoadBalancer Services. This eliminates the need to directly allocate target IP addresses, reducing the likelihood of allocation errors caused by a large number and disordered IP addresses in the IP address resource pool.

[0086] Since each IP address has a mapping information, and the IP address and mapping information are one-to-one, and each IP address has a different mapping information, this can reduce the confusion caused by multiple IP addresses corresponding to the same mapping information. This can reduce the situation where multiple target IP addresses are assigned to the same scheduled service, resulting in always accessing the container corresponding to a certain scheduled service, while other scheduled services may be in an idle state.

[0087] In another embodiment, the reservation service may include: a first type of reservation service supporting IPv4 and a second type of reservation service supporting IPv6. For example, a dual-stack service including both IPv4 and IPv6 services.

[0088] A LoadBalancer Service can only support one type of network service, either IPv4 or IPv6. To support dual-stack, you need to create two LoadBalancer Services for a Pod, one supporting IPv4 and the other supporting IPv6.

[0089] Currently, three routing protocols are supported: ARP, NDP, and BGP. Among them, ARP and NDP belong to layer 2 mode, with ARP used to broadcast IPv4 addresses and NDP used to broadcast IPv6 addresses.

[0090] When configuring dual-stack networking in Kubernetes, Pods created in the Kubernetes environment will have both IPv4 and IPv6 addresses. The communication methods of applications submitted by users through the Operator within Kubernetes will not interfere with the exposure of external network services; the internal communication method is determined by the application itself. The external communication method is determined by the application's LoadBalancer Service. This functionality is supported by the Operator, and the shared key and IP address written when creating the LoadBalancer Service need to be obtained from the Configmap pre-written with IPv4 and IPv6 addresses.

[0091] For a Pod, two LoadBalancer Services can be created: a Type 1 reservation service supporting IPv4 and a Type 2 reservation service supporting IPv6. This means a single Pod can be mapped to two different types of reservation services, one Type 1 service supporting IPv4 and the other Type 2 service supporting IPv6. Using this method, clients can obtain both IPv4 and IPv6 addresses for service access. Clients only need to change their hosts file mappings to easily switch between dual-stack networks.

[0092] refer to Figure 9 , for the basis Figure 6 Another schematic diagram.

[0093] When accessing the Pod corresponding to Port: 30001, you can use the Type 1 reservation service that supports IPv4, specifically the Type 1 reservation service with IP address 192.168.1.100:40001. Alternatively, you can use the Type 2 reservation service that supports IPv6, specifically the Type 2 reservation service with IP address [2401::ff01]:40001.

[0094] Similarly, when accessing the Pod corresponding to Port: 30002, it can be accessed through the first type of reservation service that supports IPv4, namely the first type of reservation service with IP address 192.168.1.101:40002. Alternatively, it can also be accessed through the second type of reservation service that supports IPv6, namely the second type of reservation service with IP address [2401::ff02]:40002.

[0095] Similarly, when accessing the Pod corresponding to Port: 30003, it can be accessed through the first type of reservation service that supports IPv4, namely the first type of reservation service with IP address 192.168.1.102:40003. Alternatively, it can also be accessed through the second type of reservation service that supports IPv6, namely the second type of reservation service with IP address [2401::ff03]:40003.

[0096] In another embodiment, the VIP is primarily specified by adding annotations to the LoadBalancer Service. `metallb.universe.tf / address-pool` specifies the IP pool used, and `metallb.universe.tf / allow-shared-ip` is used to allocate IPs within the IP pool. Services with the same `metallb.universe.tf / allow-shared-ip` share key will use the same IP.

[0097] By default, mapping information (such as shared keys) does not correspond one-to-one with IP addresses, which can lead to a chaotic mapping relationship. In some cases, a single shared key may correspond to multiple IP addresses in a cluster. All of these factors increase management pressure and hinder IP address scaling.

[0098] For example:

[0099] The Operator handles this functionality. Upon startup, the Operator first initializes the entire IP pool (supporting IPv4, IPv6, and dual-stack). In this initialized pool, shared keys and IPs are already bound one-to-one. When a user submits an application, the Operator selects a set of shared keys and IPs from the initialized IP pool. It then assigns the shared key value from `metallb.universe.tf / allow-shared-ip` and the IP value from `spec.loadBalancerIP` to a specific Service, thus binding the shared key and IP mapping. If the application contains multiple Services, the Operator will select multiple sets of shared keys and IPs from the IP pool and assign them to these Services in a round-robin fashion. The order of this round-robin assignment will not be reset during the Operator's lifecycle.

[0100] The method described in the above embodiments can automatically complete the allocation of IP addresses and ports for the Service.

[0101] The method in the above embodiments uses a polling mechanism to assign corresponding IP addresses to all LoadBalancer Services in all applications throughout the lifecycle of the Operator.

[0102] The method described in the above embodiments binds the shared key and the IP value, avoiding the confusion that may result from the default method of generating the correspondence.

[0103] The method described in the above embodiments supports network address allocation in three modes: IPv4, IPv6, and dual-stack.

[0104] The method described above implements Kubernetes support for LoadBalancer network exposure through software, without relying on third-party cloud vendors.

[0105] The service awareness methods differ. After IPs are assigned, Keepalived uses VRRP to continuously exchange information between the two services to determine if the service is alive. This method, on the other hand, uses MemberList to detect if a Node is inaccessible, and when a Node is found to be offline, a new Node will be elected.

[0106] VIP quantity limit. Due to the limitations of the VRRP protocol, Keepalive only allows a maximum of 255 load balancers; this method has no IP quantity limit.

[0107] The configuration methods differ. Keepalived requires pairing in pairs, which can be difficult to manage when there are many load balancer nodes. This method, on the other hand, uses global configuration, making the configuration options simpler; for example, it does not require configuring Virtual Router IDs.

[0108] The IP migration behavior differs. Keepalive's IPs only move between two nodes, while this method migrates IPs across all nodes in the Kubernetes cluster.

[0109] The method described in the above embodiments automatically allocates IP addresses, optimizes the IP allocation method, avoids the problem of confusion in the correspondence between shared keys and IP addresses, and uses a round-robin mechanism to ensure balanced traffic load.

[0110] In another embodiment, reference Figure 10 This is a schematic diagram of the structure of an information processing device, which includes:

[0111] Create module 1 to create reservation services;

[0112] The target IP allocation module 2 is used to allocate a target IP address to the predetermined service from the IP address resource pool; wherein the predetermined service is mapped to one or more containers;

[0113] Broadcast module 3 is used to broadcast the target IP address; wherein the target IP address is used to access the container mapped by the predetermined service.

[0114] In another embodiment, the IP address resource pool includes multiple IP addresses; wherein each IP address has a mapping information; the character length of the mapping information is less than the character length of the IP address;

[0115] The device includes:

[0116] The generation module is used to generate the IP address configuration allocated by the predetermined service based on the mapping information corresponding to the target IP address.

[0117] In another embodiment, the target IP allocation module is further configured to, when the number of predetermined services is N, sequentially determine N target mapping information from the mapping information, wherein the target mapping information is used to determine the target IP address.

[0118] In another embodiment, the reservation service includes: a first type of reservation service supporting IPv4 and a second type of reservation service supporting IPv6.

[0119] In another embodiment, the scheduled service includes a load balancing service.

[0120] The technical solution of this application also provides an electronic device, including:

[0121] processor;

[0122] A memory that stores program instructions, which, when executed by a processor, cause the electronic device to perform the method in any of the above embodiments.

[0123] The technical solution of this application also provides a storage medium storing a program that, when run by a processor, executes the method in any of the above embodiments. This storage medium includes a non-transient storage medium.

[0124] In the several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods, such as: multiple units or components can be combined, or integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the various components shown or discussed can be through some interfaces, and the indirect coupling or communication connection between devices or units can be electrical, mechanical, or other forms.

[0125] The units described above as separate components may or may not be physically separate. The components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of the units may be selected to achieve the purpose of this embodiment according to actual needs.

[0126] In addition, in the various embodiments of the present invention, each functional unit can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the integrated unit can be implemented in hardware or in the form of hardware plus software functional units.

[0127] In some cases, where any two of the above technical features do not conflict, they can be combined to form a new method or technical solution.

[0128] In some cases, where any one or two of the above technical features do not conflict, they can be combined to form a new equipment technical solution.

[0129] Those skilled in the art will understand that all or part of the steps of the above method embodiments can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above method embodiments. The aforementioned storage medium includes various media capable of storing program code, such as mobile storage devices, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0130] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the technical scope disclosed in the present invention should be included within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. An information processing method, characterized in that, include: Create a reservation service; A target IP address is allocated to the pre-defined service from the IP address resource pool; wherein the pre-defined service is mapped to one or more containers; the IP address resource pool includes multiple IP addresses; wherein each IP address has a mapping information; the character length of the mapping information is less than the character length of the IP address. Broadcast the target IP address; wherein the target IP address is used to access the container mapped by the predetermined service; Based on the mapping information corresponding to the target IP address, the IP address configuration allocated to the predetermined service is generated.

2. The method according to claim 1, characterized in that, When the number of pre-booked services is N, the process of allocating target IP addresses to the pre-booked services from the IP address resource pool includes: N target mapping information are sequentially determined from the mapping information, and the target mapping information is used to determine the target IP address.

3. The method according to claim 1, characterized in that, The pre-booked service includes: It supports Category 1 reservation service for IPv4 and Category 2 reservation service for IPv6.

4. The method according to claim 1, characterized in that, The pre-booked services include: load balancing services.

5. An information processing device, characterized in that, include: Create a module for creating pre-booked services; A target IP allocation module is used to allocate a target IP address to the predetermined service from an IP address resource pool; wherein the predetermined service is mapped to one or more containers; the IP address resource pool includes multiple IP addresses; wherein each IP address has a mapping information; the character length of the mapping information is less than the character length of the IP address. A broadcast module is used to broadcast the target IP address; wherein the target IP address is used to access the container mapped by the predetermined service; The generation module is used to generate the IP address configuration allocated by the predetermined service based on the mapping information corresponding to the target IP address.

6. The apparatus according to claim 5, characterized in that, The target IP allocation module is further configured to, when the number of predetermined services is N, sequentially determine N target mapping information from the mapping information, wherein the target mapping information is used to determine the target IP address.

7. The apparatus according to claim 5, characterized in that, The pre-booked service includes: It supports Category 1 reservation service for IPv4 and Category 2 reservation service for IPv6.

8. The apparatus according to claim 5, characterized in that, The pre-booked services include: load balancing services.

9. An electronic device, comprising: processor; A memory storing program instructions that, when executed by the processor, cause the electronic device to perform the method as described in any one of claims 1 to 4.

10. A storage medium storing a program that, when run by a processor, performs the method as described in any one of claims 1 to 4.