CN115225612B - Management method, device, equipment and medium for K8S cluster reserved IP - Google Patents

Management method, device, equipment and medium for K8S cluster reserved IP Download PDF

Info

Publication number
CN115225612B
CN115225612B CN202210751017.5A CN202210751017A CN115225612B CN 115225612 B CN115225612 B CN 115225612B CN 202210751017 A CN202210751017 A CN 202210751017A CN 115225612 B CN115225612 B CN 115225612B
Authority
CN
China
Prior art keywords
subnet
reservation
reserved
application
user terminal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210751017.5A
Other languages
Chinese (zh)
Other versions
CN115225612A (en
Inventor
赵海丽
杨川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jinan Inspur Data Technology Co Ltd
Original Assignee
Jinan Inspur Data Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jinan Inspur Data Technology Co Ltd filed Critical Jinan Inspur Data Technology Co Ltd
Priority to CN202210751017.5A priority Critical patent/CN115225612B/en
Publication of CN115225612A publication Critical patent/CN115225612A/en
Application granted granted Critical
Publication of CN115225612B publication Critical patent/CN115225612B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application discloses a management method, a device, equipment and a medium of a K8S cluster reserved IP, which relate to the technical field of computers and comprise the following steps: monitoring the use condition of the reserved IP; when the user terminal is monitored to create the application through the reserved IP, searching the reserved IP, and rejecting the used reserved IP so that the user terminal creates the application through the unused reserved IP; when the user terminal is monitored to modify the reserved IP, judging whether the reserved IP is unused reserved IP, if so, allowing modification, and if not, prohibiting modification. Therefore, the application monitors the use condition of the reserved IP through the controller, eliminates the used reserved IP, and creates the application through the unused reserved IP, thereby ensuring that the application can be used normally.

Description

Management method, device, equipment and medium for K8S cluster reserved IP
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for managing a K8S cluster reservation IP.
Background
Kubernetes is an open-source container-based cluster management platform, and is a mechanism for providing application deployment, planning, updating and maintenance, and is called K8S for short. Because the K8S cluster network architecture is complex and the network model itself has certain requirements for certain specific network functions, different network plug-ins are required to meet specific environments and requirements.
The network plug-ins commonly used in the K8S cluster at present comprise a gateway (network planning service), calico, weave, kube-ovn and the like, and the network plug-ins not only can meet the network requirements of the K8S cluster, but also can provide certain specific network functions required by a K8S cluster manager, and have certain flexibility in network implementation. After the K8S cluster is deployed on the kube-ovn network plug-in, the created subnet supports the include_ips, i.e. the reserved IP (Internet Protocol, protocol for interconnection between networks) function. That is, the K8S cluster sets a reserved IP in a subnet CIDR (class-less Inter-Domain Routing) when creating a subnet, and the reserved IP may fill a single IP or may fill an IP range; reserved IP is not automatically allocated but may be used by fixed IP allocation.
The user can use the reserved IP of the subnet when creating the application on the K8S cluster of the kube-ovn network plug-in, but the traditional implementation logic cannot determine which reserved IP is used and which reserved IP is not used, if the created application uses the reserved IP which is already used, the application will fail to be created; in addition, when the user modifies the reserved IP of the subnet, if the reserved IP used is modified, normal application becomes unavailable, and the service on the application is interrupted.
For this reason, ensuring that an application created through reserved IP can be used normally and avoiding the unavailability of the application caused by modification of the reserved IP that has been used is a problem to be solved in the art.
Disclosure of Invention
In view of the above, the present application aims to provide a method, a device and a medium for managing reserved IP of a K8S cluster, which ensure that an application created by the reserved IP can be used normally, and avoid the problem that the application is not available due to modification of the used reserved IP, and the specific scheme is as follows:
in a first aspect, the application discloses a management method of a K8S cluster reserved IP, which is applied to a controller, wherein the controller is deployed in a K8S cluster, and the method comprises:
after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP;
when the user terminal is monitored to create an application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP;
when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP.
Optionally, the method for managing the reserved IP of the K8S cluster further includes:
and if the target application corresponding to the target subnet reservation IP is deleted, determining the target subnet reservation IP as an unused subnet reservation IP.
Optionally, the method for managing the reserved IP of the K8S cluster further includes:
when the user terminal is monitored to delete the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the subnet reserved IP to be deleted, and if so, prohibiting the subnet reserved IP from being deleted.
Optionally, after the monitoring the usage of the subnet-reserved IP, the method further includes:
and transmitting the service condition of the subnet reserved IP to a display screen.
Optionally, the removing the used subnet-reserved IP so that the user terminal creates an application through the unused subnet-reserved IP further includes:
when a plurality of user terminals specify the same unused subnet-reserved IP creation application, determining a target user terminal from the plurality of user terminals, and distributing the subnet-reserved IP for the target user terminal.
Optionally, the determining the target user terminal from the plurality of user terminals includes:
and determining a target user terminal from the plurality of user terminals according to the response time of the plurality of user terminals.
Optionally, after the IP is reserved for the subnet allocated to the target ue, the method further includes:
and carrying out error prompt on the user terminals except the target user terminal in the plurality of user terminals so that the user terminals reserve IP creation application through other subnets.
In a second aspect, the present application discloses a management apparatus for reserving IP for a K8S cluster, which is applied to a controller, where the controller is deployed on the K8S cluster, and the apparatus includes:
the monitoring module is used for monitoring the service condition of the subnet reserved IP after the creation of the subnet and the subnet reserved IP is completed;
the application creation module is used for searching the subnet reserved IP and rejecting the used subnet reserved IP when the user terminal is monitored to create the application through the subnet reserved IP, so that the K8S cluster creates the application through the unused subnet reserved IP;
and the subnet reservation IP modification module is used for judging whether the subnet reservation IP is an unused subnet reservation IP or not when the user terminal is monitored to modify the subnet reservation IP, if the subnet reservation IP is the unused subnet reservation IP, the modification of the subnet reservation IP is allowed, and if the subnet reservation IP is the used subnet reservation IP, the modification of the subnet reservation IP is forbidden.
In a third aspect, the present application discloses an electronic device, comprising:
a memory for storing a computer program;
and the processor is used for executing the computer program to realize the management method of the K8S cluster reserved IP.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; the method for managing the K8S cluster reserved IP is realized when the computer program is executed by a processor.
It can be seen that the present application proposes a management method for a K8S cluster reserved IP, including: after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP; when the user terminal is monitored to create an application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP; when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP. Therefore, the application monitors the use condition of the subnet reservation IP through the controller, eliminates the used subnet reservation IP, and creates the application through the unused subnet reservation IP, so that the application created through the subnet reservation IP can be normally used, and in addition, the unused subnet reservation IP can be modified, so that the application avoids the problem that the application is not available caused by modifying the used subnet reservation IP.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only embodiments of the present application, and that other drawings can be obtained according to the provided drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic architecture diagram of a management method of a K8S cluster reservation IP according to the present disclosure;
FIG. 2 is a flowchart of a method for managing reserved IP of a K8S cluster;
fig. 3 is a flowchart of a specific method for managing a K8S cluster reservation IP according to the present disclosure;
fig. 4 is a schematic structural diagram of a multi-user IP creation application reserved through a subnet according to the present application;
FIG. 5 is a flowchart of a method for managing reserved IP of a specific K8S cluster according to the present application;
fig. 6 is a schematic structural diagram of a management device for reserving IP for a K8S cluster according to the present disclosure;
fig. 7 is a block diagram of an electronic device according to the present disclosure.
Detailed Description
The following description of the embodiments of the present application will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application.
The system architecture related to the application comprises a K8S cluster and a user terminal, wherein in the K8S cluster, an application is created through reserved IP of a subnet, a controller is added, and the use condition of the reserved IP is monitored through the controller, which is shown in fig. 1.
The user can use the reserved IP of the subnet when creating the application on the K8S cluster of the kube-ovn network plug-in, but the traditional implementation logic cannot determine which reserved IP is used, if the created application uses the reserved IP which is used, the application will fail to be created; in addition, when the user modifies the reserved IP of the subnet, if the reserved IP used is modified, normal applications may be rendered unusable.
Therefore, the embodiment of the application provides a management scheme of the reserved IP of the K8S cluster, which can ensure that the application created by the reserved IP can be normally used, and avoid the problem that the application is unavailable caused by modifying the used reserved IP.
The embodiment of the application discloses a management method of a K8S cluster reserved IP, which is applied to a controller, wherein the controller is deployed in the K8S cluster, and the method comprises the following steps of:
step S11: after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP.
It should be noted that, with the development of services, the requirements on the network are higher and higher, some applications need to communicate with other environmental networks, at this time, a certain Pod of the application needs to fix an IP, and cannot change the IP at will, if the system automatically changes the IP after deleting the Pod, the application cannot communicate with other environmental networks, and the normal use of the services on the application is affected, so in order to ensure the normal communication of the application, when the Pod of the application needs to be restarted or deleted, the IP of the application Pod is still the original IP. In order to realize that the IP of the Pod of the application is kept unchanged for the fixed IP, when a subnet needs to be created, filling in a reserved IP, then enabling a certain reserved IP of the subnet to be selected when the application is created, and operating the Pod after the application is created successfully does not change the IP of the Pod.
In this embodiment, the subnet is a network of container clusters, and is capable of providing a set of IP related management functions for the container clusters. After the K8S cluster is deployed on the kube-ovn network plug-in, the created sub-network supports the reserved IP function.
It should be noted that, the controller in the present application monitors the usage of the subnet reserved IP by WebHook, which is a web custom callback function, and when the program generates an alarm action, the controller automatically calls back a designated URL (Uniform Resource Locator ).
In this embodiment, after monitoring the usage of the subnet-reserved IP, the monitored usage of the subnet-reserved IP is transmitted to a display screen, so that the user terminal can reasonably plan the subnet-reserved IP according to the information displayed on the display screen.
Step S12: when the user terminal is monitored to create the application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP.
In this embodiment, if it is monitored that the user terminal creates an application through the subnet-reserved IP, the subnet-reserved IP is searched, and the subnet-reserved IP that has been used is removed, so that the unused subnet-reserved IP is reserved, so that the user terminal creates an application through the unused subnet-reserved IP, and therefore, it is ensured that the application created through the subnet-reserved IP can be normally used.
It will be appreciated that the used subnet reservation IP will be removed by the controller, so the used subnet reservation IP cannot be used to create an application, but if the target application corresponding to the target subnet reservation IP is deleted, the target subnet reservation IP is changed again to the unused subnet reservation IP, at which point the application can be created again by the target subnet reservation IP.
Step S13: when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP.
In this embodiment, when it is monitored that the user terminal modifies the subnet-reserved IP, the controller determines whether the subnet-reserved IP is an unused subnet-reserved IP, if the subnet-reserved IP is an unused subnet-reserved IP, the modification of the subnet-reserved IP is allowed, and if the subnet-reserved IP is an used subnet-reserved IP, the modification of the subnet-reserved IP is prohibited. In this way, the application avoids the problem that the application is not available caused by modifying the used subnet reservation IP.
Correspondingly, when the user terminal is monitored to delete the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP or not through the controller, if the subnet reserved IP is the unused subnet reserved IP, allowing the subnet reserved IP to be deleted, and if the subnet reserved IP is the used subnet reserved IP, prohibiting the subnet reserved IP from being deleted. In this way, the application avoids the problem that the application is not available caused by deleting the used subnet reservation IP.
In addition, in order to ensure that the number of the reserved sub-network IPs is enough, the user terminal blindly reserves excessive reserved sub-network IPs, so that the number of the conventional available IPs is insufficient, the waste of network resources is caused, and reasonable use and allocation of the resources are not facilitated. After the controller is added, the user terminal can reasonably plan the sub-network reserved IP according to the monitoring condition of the controller, and the redundant waste of network resources is greatly reduced.
It can be seen that the present application proposes a management method for a K8S cluster reserved IP, including: after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP; when the user terminal is monitored to create an application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP; when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP. Therefore, the application monitors the use condition of the subnet reservation IP through the controller, eliminates the used subnet reservation IP, and creates the application through the unused subnet reservation IP, so that the application created through the subnet reservation IP can be normally used, and in addition, the unused subnet reservation IP can be modified, so that the application avoids the problem that the application is not available caused by modifying the used subnet reservation IP.
The embodiment of the application discloses a specific management method of a K8S cluster reserved IP, and compared with the previous embodiment, the embodiment further describes and optimizes the technical scheme. Referring to fig. 3, the method specifically includes:
step S21: after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP.
The more specific working process of step S21 is shown in the foregoing disclosed embodiment, and will not be described herein in detail.
Step S22: when the user terminal is monitored to create the application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP.
The more specific working process of step S22 is shown in the foregoing disclosed embodiment, and will not be described herein in detail.
Step S23: when a plurality of user terminals specify the same unused subnet-reserved IP creation application, determining a target user terminal from the plurality of user terminals, and distributing the subnet-reserved IP for the target user terminal.
In a specific embodiment, when a plurality of user terminals specify the same unused subnet-reserved IP creation application, determining a target user terminal from the plurality of user terminals according to response time of the plurality of user terminals, allocating the subnet-reserved IP to the target user terminal, and performing error prompt on user terminals other than the target user terminal in the plurality of user terminals so that the user terminal creates the application through other subnet-reserved IPs. In another specific embodiment, when a plurality of threads specify the same unused subnet reserved IP creation application, a target thread is determined from the plurality of threads, the subnet reserved IP is allocated to the target thread, and then error prompt is performed on threads other than the target thread in the plurality of threads, so that the threads reserve IP creation applications through other subnets. In another specific embodiment, when multiple paths specify the same unused subnet-reserved IP creation application, a target path is determined from the multiple paths, the subnet-reserved IP is allocated to the target path, and then, a thread outside the target path among the multiple paths is error-prompted so that the path reserves the IP creation application through other subnets. Referring to fig. 4, when a user a, a user B and a bottom layer specify the same unused subnet-reserved IP creation application at the same time, an application is successfully created according to response time of the user a, the user B and the bottom layer, and then error prompt is performed on other users except for the successfully created application to prompt the other users that the subnet-reserved IP has been used, and the other subnet-reserved IP is replaced to create the application again, so that the other users create the application through the other subnet-reserved IP. Therefore, the application can avoid the phenomenon that the application cannot work normally caused by that one sub-network reserved IP is occupied by multiple applications.
Step S24: when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP.
The more specific working process of step S24 is shown in the foregoing disclosed embodiment, and will not be described herein in detail.
It can be seen that the present application proposes a management method for a K8S cluster reserved IP, including: monitoring the service condition of the subnet reservation IP after the creation of the subnet and the subnet reservation IP is completed, searching the subnet reservation IP and rejecting the used subnet reservation IP when the user terminal is monitored to create the application through the subnet reservation IP, so that the user terminal creates the application through the unused subnet reservation IP; when a plurality of user terminals specify the same unused subnet reservation IP creation application, determining a target user terminal from the plurality of user terminals, and distributing the subnet reservation IP for the target user terminal; when the user terminal is monitored to modify the subnet reservation IP, judging whether the subnet reservation IP is an unused subnet reservation IP, if the subnet reservation IP is an unused subnet reservation IP, allowing the subnet reservation IP to be modified, and if the subnet reservation IP is an used subnet reservation IP, prohibiting the modification of the subnet reservation IP, monitoring the use condition of the subnet reservation IP through a controller, rejecting the used subnet reservation IP, and creating an application through the unused subnet reservation IP, so that the application created through the subnet reservation IP can be normally used, and in addition, the problem that the application is unavailable due to the modification of the used subnet reservation IP is avoided because the unused subnet reservation IP can be modified. Further, when a plurality of user terminals specify the same unused subnet reservation IP creation application, the application can determine a target user terminal from the plurality of user terminals and allocate the subnet reservation IP to the target user terminal, so that the phenomenon that the application cannot work normally due to the fact that one subnet reservation IP is occupied by multiple applications can be avoided.
Referring to fig. 5, based on the management method of the K8S cluster reserved IP, the present application can specifically include the following:
after the creation of the subnet and the subnet reservation IP is completed, the controller starts to monitor the use condition of the subnet reservation IP, the idle subnet reservation IP allows modification and deletion operations, and the used subnet reservation IP does not allow modification and deletion. When the subnet is modified, the reserved IP of the subnet can be newly added, then the K8S cluster uses the reserved IP of the subnet to create the application, and the controller monitors the reserved IP of the subnet, so that the reserved IP used for creating the application is ensured to be idle, and the application can be normally created. The specific implementation process is as follows:
(1) After the creation of the K8S cluster subnet and the subnet reservation IP is completed, the controller starts to monitor the service condition of the subnet reservation IP;
(2) The K8S cluster uses the subnet reservation IP to create an application, when the subnet reservation IP is selected, the controller searches the subnet reservation IP, the unused subnet reservation IP can be used for creating the application, and the used subnet reservation IP can be filtered;
(3) When a user modifies the subnet reservation IP, the controller judges that the used subnet reservation IP cannot be modified, and the unused subnet reservation IP can be modified;
(4) When the application created by using the reserved IP of the subnet is deleted, the controller automatically monitors and identifies the reserved IP as unused, and can modify and delete the operation, and when the application is created again by using the reserved IP, the application is successfully created;
(5) The controller transmits the monitored service condition of the subnet-reserved IP to the large screen, the large screen displays the service condition of the specific subnet-reserved IP, and the user reasonably plans the subnet-reserved IP according to the large screen display information.
Therefore, the application adds a controller mechanism, monitors the dynamic use condition of the reserved IP of the sub-network in real time, and completes the management of the full life cycle of the reserved IP of the sub-network, and the beneficial effects are as follows: the large screen display directly displays the service condition of the reserved IP of the sub-network, so that a user can reasonably plan the reserved IP according to actual demands, network resource reasonable use and allocation are facilitated, waste of network resources is reduced, and the utilization rate of the network resources is improved; the controller searches the subnet reserved IP, filters the used subnet reserved IP, ensures that the application created by using the subnet reserved IP can be normally used, avoids the situation that the created application cannot be normally used because the subnet reserved IP is occupied, saves time and labor cost, and improves user perception and usability of the system; the method has the advantages that the phenomenon that the used reserved IP of the subnet cannot be modified and deleted, even if people unfamiliar with the service are not familiar with the service, the phenomenon that the application is unavailable due to the deletion of the used reserved IP is avoided, the operation of a system is simplified, and the product quality is improved; when multi-user, multi-thread or multi-path application is created, the phenomenon that one reserved IP is occupied by a plurality of applications, so that the service of the application cannot work normally is prevented.
Correspondingly, the embodiment of the application also discloses a management device of the K8S cluster reserved IP, which is shown in FIG. 6 and comprises the following steps:
a monitoring module 11, configured to monitor a usage situation of a subnet reservation IP after completing creation of the subnet and the subnet reservation IP;
the application creation module 12 is configured to, when it is monitored that the user terminal creates an application through the subnet-reserved IP, retrieve the subnet-reserved IP, and reject the subnet-reserved IP that has been used, so that the K8S cluster creates an application through the subnet-reserved IP that has not been used;
and the subnet reservation IP modifying module 13 is configured to determine whether the subnet reservation IP is an unused subnet reservation IP when the user terminal is monitored to modify the subnet reservation IP, allow modification of the subnet reservation IP if the subnet reservation IP is an unused subnet reservation IP, and prohibit modification of the subnet reservation IP if the subnet reservation IP is an used subnet reservation IP.
It can be seen that the present application proposes a management method for a K8S cluster reserved IP, including: after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP; when the user terminal is monitored to create an application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP; when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP. Therefore, the application monitors the use condition of the subnet reservation IP through the controller, eliminates the used subnet reservation IP, and creates the application through the unused subnet reservation IP, so that the application created through the subnet reservation IP can be normally used, and in addition, the unused subnet reservation IP can be modified, so that the application avoids the problem that the application is not available caused by modifying the used subnet reservation IP.
In some specific embodiments, after the management device of the K8S cluster reservation IP, the method further may further include:
and the subnet reservation IP adding unit is used for determining the target subnet reservation IP as an unused subnet reservation IP if the target application corresponding to the target subnet reservation IP is deleted.
In some specific embodiments, after the management device of the K8S cluster reservation IP, the method further may further include:
and the subnet reservation IP deleting unit is used for judging whether the subnet reservation IP is an unused subnet reservation IP or not when the user terminal is monitored to delete the subnet reservation IP, if the subnet reservation IP is the unused subnet reservation IP, allowing the subnet reservation IP to be deleted, and if the subnet reservation IP is the used subnet reservation IP, prohibiting the subnet reservation IP to be deleted.
In some specific embodiments, after the listening module 11, the method further may further include:
and transmitting the service condition of the subnet reserved IP to a display screen.
In some specific embodiments, after the application creation module 12, the method further may further include:
and the multi-user application creation unit is used for determining a target user terminal from the plurality of user terminals when the plurality of user terminals specify the same unused subnet reservation IP creation application, and distributing the subnet reservation IP for the target user terminal.
In some embodiments, after the application creation module 12, the method specifically may include:
and the target user terminal determining unit is used for determining the target user terminal from the plurality of user terminals according to the response time of the plurality of user terminals.
In some specific embodiments, after the application creation module 12, the method further may further include:
and carrying out error prompt on the user terminals except the target user terminal in the plurality of user terminals so that the user terminals reserve IP creation application through other subnets.
Further, the embodiment of the application also provides electronic equipment. Fig. 7 is a block diagram of an electronic device 20, according to an exemplary embodiment, and is not intended to limit the scope of use of the present application in any way.
Fig. 7 is a schematic structural diagram of an electronic device 20 according to an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display screen 23, an input output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. Wherein the memory 22 is used for storing a computer program, which is loaded and executed by the processor 21 for realizing the following steps:
after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP;
when the user terminal is monitored to create an application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP;
when the user terminal is monitored to modify the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the modification of the subnet reserved IP, and if so, prohibiting the modification of the subnet reserved IP.
In some embodiments, the processor may further include the following steps by executing the computer program stored in the memory:
and if the target application corresponding to the target subnet reservation IP is deleted, determining the target subnet reservation IP as an unused subnet reservation IP.
In some embodiments, the processor may further include the following steps by executing the computer program stored in the memory:
when the user terminal is monitored to delete the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the subnet reserved IP to be deleted, and if so, prohibiting the subnet reserved IP from being deleted.
In some embodiments, the processor may further include the following steps by executing the computer program stored in the memory:
and transmitting the service condition of the subnet reserved IP to a display screen.
In some embodiments, the processor may further include the following steps by executing the computer program stored in the memory:
when a plurality of user terminals specify the same unused subnet-reserved IP creation application, determining a target user terminal from the plurality of user terminals, and distributing the subnet-reserved IP for the target user terminal.
In some embodiments, the processor may specifically implement the following steps by executing the computer program stored in the memory:
and determining a target user terminal from the plurality of user terminals according to the response time of the plurality of user terminals.
In some embodiments, the processor may further include the following steps by executing the computer program stored in the memory:
and carrying out error prompt on the user terminals except the target user terminal in the plurality of user terminals so that the user terminals reserve IP creation application through other subnets.
In this embodiment, the power supply 26 is used to provide an operating voltage for each hardware device on the electronic device 20; the communication interface 25 can create a data transmission channel between the electronic device 20 and an external device, and the communication protocol to be followed is any communication protocol applicable to the technical solution of the present application, which is not specifically limited herein; the input/output interface 24 is used for obtaining external input data or outputting external output data, and the specific interface type thereof may be selected according to the specific application needs, which is not limited herein.
The memory 22 may be a read-only memory, a random access memory, a magnetic disk, an optical disk, or the like, and the resources stored thereon may include the computer program 221, which may be stored in a temporary or permanent manner. The computer program 221 may further include a computer program that can be used to perform other specific tasks, in addition to the computer program that can be used to perform the method of managing the K8S cluster reservation IP performed by the electronic device 20 disclosed in any of the foregoing embodiments.
Further, the embodiment of the application also discloses a computer readable storage medium for storing a computer program; the method for managing the K8S cluster reserved IP is realized when the computer program is executed by a processor.
For specific steps of the method, reference may be made to the corresponding contents disclosed in the foregoing embodiments, and no further description is given here.
In the present disclosure, each embodiment is described in a progressive manner, and each embodiment focuses on the difference from other embodiments, and the same or similar parts between the embodiments refer to each other, that is, for the device disclosed in the embodiments, since the device corresponds to the method disclosed in the embodiments, the description is relatively simple, and the relevant parts refer to the description of the method section.
Those of skill would further appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, computer software, or combinations of both, and that the various illustrative elements and steps are described above generally in terms of functionality in order to clearly illustrate the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
The steps of a method or algorithm described in connection with the embodiments disclosed herein may be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. The software modules may be disposed in Random Access Memory (RAM), memory, read Only Memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.
Finally, it is further noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The above describes in detail a method, a device, equipment and a storage medium for managing a K8S cluster reserved IP, and specific examples are applied to describe the principles and embodiments of the present application, where the description of the above examples is only used to help understand the method and core ideas of the present application; meanwhile, as those skilled in the art will have variations in the specific embodiments and application scope in accordance with the ideas of the present application, the present description should not be construed as limiting the present application in view of the above.

Claims (9)

1. A method for managing reserved IP of a K8S cluster, applied to a controller, where the controller is deployed on the K8S cluster, the method comprising:
after the creation of the subnet and the subnet reservation IP is completed, monitoring the service condition of the subnet reservation IP;
when the user terminal is monitored to create an application through the subnet reservation IP, searching the subnet reservation IP, and rejecting the used subnet reservation IP so that the user terminal creates the application through the unused subnet reservation IP;
when the user terminal is monitored to modify the subnet reservation IP, judging whether the subnet reservation IP is an unused subnet reservation IP, if the subnet reservation IP is an unused subnet reservation IP, allowing the modification of the subnet reservation IP, and if the subnet reservation IP is an used subnet reservation IP, prohibiting the modification of the subnet reservation IP;
when the user terminal is monitored to delete the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the subnet reserved IP to be deleted, and if so, prohibiting the subnet reserved IP from being deleted.
2. The method for managing K8S cluster reservation IP of claim 1, further comprising:
and if the target application corresponding to the target subnet reservation IP is deleted, determining the target subnet reservation IP as an unused subnet reservation IP.
3. The method for managing the K8S cluster reserved IP according to claim 1, wherein after the monitoring the usage of the subnet reserved IP, further comprises:
and transmitting the service condition of the subnet reserved IP to a display screen.
4. A method of managing K8S cluster reservation IP according to any of claims 1 to 3, wherein the rejecting of the used subnet reservation IP so that the user terminal creates an application through the unused subnet reservation IP further comprises:
when a plurality of user terminals specify the same unused subnet-reserved IP creation application, determining a target user terminal from the plurality of user terminals, and distributing the subnet-reserved IP for the target user terminal.
5. The method for K8S cluster reservation IP management according to claim 4, wherein determining a target user terminal from the plurality of user terminals comprises:
and determining a target user terminal from the plurality of user terminals according to the response time of the plurality of user terminals.
6. The method for K8S cluster reservation IP management according to claim 4, further comprising, after the allocating the subnet reservation IP for the target user terminal:
and carrying out error prompt on the user terminals except the target user terminal in the plurality of user terminals so that the user terminals reserve IP creation application through other subnets.
7. A management apparatus for reserving IP for a K8S cluster, applied to a controller, where the controller is deployed on the K8S cluster, the apparatus includes:
the monitoring module is used for monitoring the service condition of the subnet reserved IP after the creation of the subnet and the subnet reserved IP is completed;
the application creation module is used for searching the subnet reserved IP and rejecting the used subnet reserved IP when the user terminal is monitored to create the application through the subnet reserved IP, so that the K8S cluster creates the application through the unused subnet reserved IP;
a subnet reservation IP modifying module, configured to determine, when it is monitored that the user terminal modifies the subnet reservation IP, whether the subnet reservation IP is an unused subnet reservation IP, allow modification of the subnet reservation IP if the subnet reservation IP is an unused subnet reservation IP, and prohibit modification of the subnet reservation IP if the subnet reservation IP is an used subnet reservation IP;
wherein, the management device of the reserved IP of the K8S cluster is further configured to: when the user terminal is monitored to delete the subnet reserved IP, judging whether the subnet reserved IP is an unused subnet reserved IP, if so, allowing the subnet reserved IP to be deleted, and if so, prohibiting the subnet reserved IP from being deleted.
8. An electronic device, comprising:
a memory for storing a computer program;
processor configured to execute the computer program to implement the method for managing K8S cluster reservation IP according to any of claims 1 to 6.
9. A computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements a method of managing K8S cluster reservation IP as claimed in any one of claims 1 to 6.
CN202210751017.5A 2022-06-29 2022-06-29 Management method, device, equipment and medium for K8S cluster reserved IP Active CN115225612B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210751017.5A CN115225612B (en) 2022-06-29 2022-06-29 Management method, device, equipment and medium for K8S cluster reserved IP

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210751017.5A CN115225612B (en) 2022-06-29 2022-06-29 Management method, device, equipment and medium for K8S cluster reserved IP

Publications (2)

Publication Number Publication Date
CN115225612A CN115225612A (en) 2022-10-21
CN115225612B true CN115225612B (en) 2023-11-14

Family

ID=83610630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210751017.5A Active CN115225612B (en) 2022-06-29 2022-06-29 Management method, device, equipment and medium for K8S cluster reserved IP

Country Status (1)

Country Link
CN (1) CN115225612B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137073A (en) * 2010-01-22 2011-07-27 杭州华三通信技术有限公司 Method and access equipment for preventing imitating internet protocol (IP) address to attack
CN107666525A (en) * 2017-09-08 2018-02-06 北京京东尚科信息技术有限公司 The method and apparatus of cluster container IP distribution
CN111163189A (en) * 2020-01-07 2020-05-15 上海道客网络科技有限公司 IP monitoring and recycling system and method based on network name space management and control
CN111371627A (en) * 2020-03-24 2020-07-03 广西梯度科技有限公司 Method for setting multiple IP (Internet protocol) in Pod in Kubernetes
CN112003964A (en) * 2020-08-27 2020-11-27 北京浪潮数据技术有限公司 Multi-architecture-based IP address allocation method, device and medium
CN114070822A (en) * 2021-11-17 2022-02-18 苏州博纳讯动软件有限公司 Kubernetes Overlay IP address management method
CN114172753A (en) * 2020-09-10 2022-03-11 华为技术有限公司 Address reservation method, network equipment and system
CN114189496A (en) * 2022-02-16 2022-03-15 苏州浪潮智能科技有限公司 IP modification method and device of cluster system and related equipment
US11316822B1 (en) * 2018-09-28 2022-04-26 Juniper Networks, Inc. Allocating external IP addresses from isolated pools
CN114500523A (en) * 2021-11-29 2022-05-13 上海浦东发展银行股份有限公司 Fixed IP application release method based on container cloud platform

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11777790B2 (en) * 2020-04-16 2023-10-03 Ribbon Communications Operating Company, Inc. Communications methods and apparatus for migrating a network interface and/or IP address from one Pod to another Pod in a Kubernetes system
US11336567B2 (en) * 2020-04-20 2022-05-17 Cisco Technology, Inc. Service aware virtual private network for optimized forwarding in cloud native environment
US20210334235A1 (en) * 2020-04-23 2021-10-28 Netapp, Inc. Systems and methods for configuring, creating, and modifying parallel file systems

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102137073A (en) * 2010-01-22 2011-07-27 杭州华三通信技术有限公司 Method and access equipment for preventing imitating internet protocol (IP) address to attack
CN107666525A (en) * 2017-09-08 2018-02-06 北京京东尚科信息技术有限公司 The method and apparatus of cluster container IP distribution
US11316822B1 (en) * 2018-09-28 2022-04-26 Juniper Networks, Inc. Allocating external IP addresses from isolated pools
CN111163189A (en) * 2020-01-07 2020-05-15 上海道客网络科技有限公司 IP monitoring and recycling system and method based on network name space management and control
CN111371627A (en) * 2020-03-24 2020-07-03 广西梯度科技有限公司 Method for setting multiple IP (Internet protocol) in Pod in Kubernetes
CN112003964A (en) * 2020-08-27 2020-11-27 北京浪潮数据技术有限公司 Multi-architecture-based IP address allocation method, device and medium
CN114172753A (en) * 2020-09-10 2022-03-11 华为技术有限公司 Address reservation method, network equipment and system
WO2022052496A1 (en) * 2020-09-10 2022-03-17 华为技术有限公司 Address reservation method, network device, and system
CN114070822A (en) * 2021-11-17 2022-02-18 苏州博纳讯动软件有限公司 Kubernetes Overlay IP address management method
CN114500523A (en) * 2021-11-29 2022-05-13 上海浦东发展银行股份有限公司 Fixed IP application release method based on container cloud platform
CN114189496A (en) * 2022-02-16 2022-03-15 苏州浪潮智能科技有限公司 IP modification method and device of cluster system and related equipment

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
"kube-VON的设计思路和实现原理";刘梦馨;《51CTO博客,https://blog.51cto.com/u_15127630/2777660》;第4页 *
Toward Highly Scalable Load Balancing in Kubernetes Clusters;Nguyen Nguyen; 等;《IEEE Communications Magazine 》;第58卷(第7期);全文 *
冯文超 ; .容器云平台网络资源配置管理系统的设计.工业仪表与自动化装置.2018,(01),全文. *
容器云平台网络资源配置管理系统的设计;冯文超;;工业仪表与自动化装置(01);全文 *

Also Published As

Publication number Publication date
CN115225612A (en) 2022-10-21

Similar Documents

Publication Publication Date Title
US8200789B2 (en) Method, system and program product for automated topology formation in dynamic distributed environments
US11405931B2 (en) Methods, systems, and computer readable media for providing for network slice management using feedback mechanism
US6438110B1 (en) Reservation of connections in a communications network
US20230007662A1 (en) Dynamic slice priority handling
CN109995641B (en) Information processing method, computing node and storage medium
US20050076336A1 (en) Method and apparatus for scheduling resources on a switched underlay network
CN106790092B (en) Remote procedure call server control system and method
CN114070822B (en) Kubernetes Overlay IP address management method
EP4167539A1 (en) Resource management method and system, proxy server, and storage medium
CN107809495B (en) Address management method and device
WO2016095524A1 (en) Resource allocation method and apparatus
CN112187864A (en) Load balancing method and device, storage medium and electronic equipment
CN114661419A (en) Service quality control system and method
CN113382077A (en) Micro-service scheduling method and device, computer equipment and storage medium
CN116800825A (en) Calling method, device, equipment and medium based on micro-service splitting
US7903678B2 (en) Internet protocol address management system and method
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
CN115225612B (en) Management method, device, equipment and medium for K8S cluster reserved IP
CN109039694A (en) A kind of the global network resource allocation methods and device of service-oriented
CN111061723A (en) Workflow implementation method and device
CA2331977C (en) A caching mechanism to optimize a bidding process used to select resources and services
CN115915404A (en) Network slice deployment system and method based on NFV-MANO
RU2522995C2 (en) Method and apparatus for creating peer-to-peer group in peer-to-peer application and method of using peer-to-peer group
Jmila et al. A self-stabilizing framework for dynamic bandwidth allocation in virtual networks
US20020021666A1 (en) Method of managing a telecommunication network and a network management unit for implementing the method

Legal Events

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