CN115225612A - 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
CN115225612A
CN115225612A CN202210751017.5A CN202210751017A CN115225612A CN 115225612 A CN115225612 A CN 115225612A CN 202210751017 A CN202210751017 A CN 202210751017A CN 115225612 A CN115225612 A CN 115225612A
Authority
CN
China
Prior art keywords
subnet
reserved
reservation
application
unused
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.)
Granted
Application number
CN202210751017.5A
Other languages
Chinese (zh)
Other versions
CN115225612B (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

Images

Abstract

The application discloses a management method, a device, equipment and a medium for reserved IP of a K8S cluster, which relate to the technical field of computers and comprise the following steps: monitoring the use condition of the reserved IP; when monitoring that the user terminal establishes the application through the reserved IP, retrieving the reserved IP and removing the used reserved IP so that the user terminal establishes the application through the unused reserved IP; when the user terminal is monitored to modify the reserved IP, whether the reserved IP is the unused reserved IP is judged, if yes, modification is allowed, and if not, modification is forbidden. Therefore, the application can be normally used by monitoring the use condition of the reserved IP through the controller, removing the used reserved IP and further creating the application through the unused reserved IP, and in addition, the unused reserved IP can be modified, so that the problem that the application is unavailable due to the fact that the used reserved IP is modified is avoided.

Description

Management method, device, equipment and medium for K8S cluster reserved IP
Technical Field
The present invention 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 reserved IP.
Background
Kubernetes is an open-source container-based cluster management platform, and is a mechanism providing application deployment, planning, updating and maintenance, which is referred to as K8S for short. Since 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.
At present, the commonly used network plug-ins of the K8S cluster include a flex (network planning service), a call, a leave, a kube-ovn, and the like, and the network plug-ins can meet the network requirements of the K8S cluster, provide certain required specific network functions for a K8S cluster administrator, and have certain flexibility in network implementation. After the K8S cluster is deployed and installed with a kube-ovn network plug-in, the created subnet supports the function of expose _ IPs, namely, the function of reserving IP (Internet Protocol, protocol for interconnection between networks). That is, when creating a subnet, the K8S cluster sets a reserved IP in a subnet CIDR (class Inter-Domain Routing), where the reserved IP may fill a single IP or an IP range; the reserved IP is not automatically allocated but can be used by the fixed IP allocation.
A user can use the reserved IP of the subnet when creating an application on the K8S cluster which is provided with the kube-ovn network plug-in, but the previous implementation logic cannot clearly determine which reserved IP is used and which reserved IP is not used, and if the created application uses the used reserved IP, the application will fail to be created; in addition, when the user modifies the reserved IP of the subnet, if the used reserved IP is modified, the normal application becomes unavailable, and the service on the application is also interrupted.
Therefore, ensuring that an application created by a reserved IP can be normally used and avoiding the modification of the used reserved IP to make the application unavailable is a problem to be solved in the art.
Disclosure of Invention
In view of this, an object of the present invention is to provide a method, an apparatus, a device, and a medium for managing a reserved IP in a K8S cluster, which ensure that an application created by the reserved IP can be used normally, and avoid a problem that the application is unavailable due to modification of the used reserved IP, and a specific solution thereof is as follows:
in a first aspect, the present application discloses a method for managing reserved IPs of a K8S cluster, where the method is applied to a controller, where the controller is deployed in the K8S cluster, and the method includes:
after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP;
when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so that the user terminal establishes the application through the unused subnet reservation IP;
when the modification of the subnet reserved IP by the user terminal is monitored, judging whether the subnet reserved IP is an unused subnet reserved IP or not, if the subnet reserved IP is the unused subnet reserved IP, allowing the modification of the subnet reserved IP, and if the subnet reserved IP is the used subnet reserved IP, forbidding the modification of the subnet reserved IP.
Optionally, the method for managing reserved IP in the K8S cluster further includes:
and if the target application corresponding to the target subnet reserved IP is deleted, determining the target subnet reserved IP as an unused subnet reserved IP.
Optionally, the method for managing reserved IP in the K8S cluster further includes:
when the fact that the user terminal deletes the subnet reserved IP is monitored, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, deletion of the subnet reserved IP is allowed, and if the subnet reserved IP is the used subnet reserved IP, deletion of the subnet reserved IP is forbidden.
Optionally, after monitoring the usage of the subnet reserved IP, the method further includes:
and transmitting the use condition of the subnet reserved IP to a display screen.
Optionally, the removing the used subnet reservation IP so that the user terminal creates an application through an unused subnet reservation IP further includes:
when a plurality of user terminals designate the same unused subnet reservation IP to create an application, a target user terminal is determined from the plurality of user terminals, and the subnet reservation IP is allocated to the target user terminal.
Optionally, the determining a target user equipment from the plurality of user equipments 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 allocating the subnet reservation IP to the target user terminal, the method further includes:
and carrying out error prompt on user terminals except the target user terminal in the plurality of user terminals so that the user terminals can establish application through other subnet reserved IPs.
In a second aspect, the present application discloses a management device for reserved IP in a K8S cluster, which is applied to a controller, where the controller is deployed in the K8S cluster, and the device includes:
the monitoring module is used for monitoring the use 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 retrieving the subnet reserved IP and removing the used subnet reserved IP when monitoring that the user terminal creates 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, when it is monitored that the user terminal modifies the subnet reservation IP, determine 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.
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 disclosed in the foregoing.
In a fourth aspect, the present application discloses a computer readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the aforementioned disclosed management method for K8S cluster reservation IP.
Therefore, the present application provides a management method for reserved IPs of a K8S cluster, including: after completing the creation of the subnet and the subnet reserved IP, monitoring the use condition of the subnet reserved IP; when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so that the user terminal establishes the application through the unused subnet reservation IP; when the user terminal is monitored to modify the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, the subnet reserved IP is allowed to be modified, and if the subnet reserved IP is the used subnet reserved IP, the subnet reserved IP is forbidden to be modified. Therefore, the method and the device monitor the use condition of the subnet reserved IP through the controller, remove the used subnet reserved IP and further establish the application through the unused subnet reserved IP, so that the application established through the subnet reserved IP can be normally used.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the provided drawings without creative efforts.
Fig. 1 is a schematic architecture diagram of a management method for reserved IP of a K8S cluster disclosed in the present application;
fig. 2 is a flowchart of a management method for reserved IP of a K8S cluster disclosed in the present application;
fig. 3 is a flowchart of a specific management method for reserved IPs of a K8S cluster according to the present disclosure;
fig. 4 is a schematic structural diagram of a multi-user application created by subnet reservation IP according to the present disclosure;
fig. 5 is a flowchart of a specific management method for reserved IPs of a K8S cluster disclosed in the present application;
fig. 6 is a schematic structural diagram of a management device for reserved IP of a K8S cluster disclosed in the present application;
fig. 7 is a block diagram of an electronic device disclosed in the present application.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The system architecture comprises a K8S cluster and a user terminal, wherein in the K8S cluster, application is established through a reserved IP of a subnet, a controller is added, and the controller monitors the use condition of the reserved IP, which is shown in figure 1.
A user can use the reserved IP of the subnet when creating an application on the K8S cluster which is provided with the kube-ovn network plug-in, but the previous implementation logic cannot determine which reserved IP is used, and if the created application uses the used reserved IP, the application will fail to be created; in addition, when the user modifies the reserved IP of the subnet, if the used reserved IP is modified, the normal application may become unavailable.
Therefore, the embodiment of the application provides a management scheme for a K8S cluster reserved IP, which can ensure that an application created by the reserved IP can be normally used, and avoid the problem that the application is unavailable due to modification of the used reserved IP.
The embodiment of the application discloses a management method for reserved IP (Internet protocol) of a K8S cluster, which is applied to a controller, wherein the controller is deployed in the K8S cluster, and as shown in a figure 2, the method comprises the following steps:
step S11: and after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP.
It should be noted that, with the development of services, the requirement on the network is higher and higher, some applications need to communicate with other environment networks, and at this time, a certain Pod of the application needs to fix an IP and cannot arbitrarily change the IP, and if the Pod is deleted, the system automatically changes the IP, which may cause the application to be disconnected from other environment networks and affect the normal use of the service on the application, so that when the Pod of the application needs to be restarted or deleted in order to ensure the normal communication of the application, the IP of the Pod of the application is still the original IP. In order to realize that the IP of the Pod of the application is kept unchanged as a fixed IP, when a subnet needs to be created, a reserved IP is filled, then a certain reserved IP of the subnet is selected when the application is created, and after the application is successfully created, the IP of the Pod cannot be changed when the Pod is operated.
In this embodiment, the subnet is a network of the container cluster, and can provide a group of IP related management functions for the container cluster. After the K8S cluster is deployed and installed with the kube-ovn network plug-in, the created subnet supports the reserved IP function.
It should be noted that the controller in this application monitors the usage of the subnet reserved IP in a WebHook manner, where the WebHook is a web customized callback function, and when a program generates an alarm behavior, it automatically calls back a specified URL (Uniform Resource Locator).
In this embodiment, after monitoring the use condition of the subnet reserved IP, the monitored use condition 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 by the display screen.
Step S12: and when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so as to facilitate the user terminal to establish the application through the unused subnet reservation IP.
In this embodiment, if it is monitored that the user terminal creates the application through the subnet reservation IP, the subnet reservation IP is retrieved, and the used subnet reservation IP is removed to reserve the unused subnet reservation IP, so that the user terminal creates the application through the unused subnet reservation IP, and thus, it is ensured that the application created through the subnet reservation IP can be normally used.
It is understood that the subnet reservation IP that has been used is removed by the controller, so the subnet reservation IP that has been used is not available for creating the application, but if the target application corresponding to the target subnet reservation IP is deleted, the target subnet reservation IP becomes the unused subnet reservation IP again, at which time the application can be created again through the target subnet reservation IP.
Step S13: when the modification of the subnet reserved IP by the user terminal is monitored, judging whether the subnet reserved IP is an unused subnet reserved IP or not, if the subnet reserved IP is the unused subnet reserved IP, allowing the modification of the subnet reserved IP, and if the subnet reserved IP is the used subnet reserved IP, forbidding the modification of the subnet reserved IP.
In this embodiment, when it is monitored that the user terminal modifies the subnet reservation IP, the controller determines whether the subnet reservation IP is an unused subnet reservation IP, if the subnet reservation IP is an unused subnet reservation IP, the subnet reservation IP is allowed to be modified, and if the subnet reservation IP is an used subnet reservation IP, the subnet reservation IP is prohibited from being modified. Therefore, the method and the device avoid the problem that the application is unavailable due to the fact that the used subnet reservation IP is modified.
Correspondingly, when the fact that the user terminal deletes the subnet reserved IP is monitored, the controller judges whether the subnet reserved IP is an unused subnet reserved IP or not, if the subnet reserved IP is the unused subnet reserved IP, deletion of the subnet reserved IP is allowed, and if the subnet reserved IP is the used subnet reserved IP, deletion of the subnet reserved IP is forbidden. Therefore, the method and the device avoid the problem that the application is unavailable due to deletion of the used subnet reservation IP.
In addition, in order to ensure that the number of reserved IP of the subnet is enough to be used, the user terminal blindly reserves too many reserved IP of the subnet, which results in insufficient number of conventionally available IP, causes waste of network resources, and is not favorable for reasonable use and distribution of resources. After the controller is added, the user terminal can reasonably plan the subnet reserved IP according to the monitoring condition of the controller, and the redundant waste of network resources is greatly reduced.
Therefore, the present application provides a management method for reserved IPs of a K8S cluster, including: after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP; when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so that the user terminal establishes the application through the unused subnet reservation IP; when the user terminal is monitored to modify the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, the subnet reserved IP is allowed to be modified, and if the subnet reserved IP is the used subnet reserved IP, the subnet reserved IP is forbidden to be modified. Therefore, the method and the device monitor the use condition of the subnet reserved IP through the controller, remove the used subnet reserved IP, and further establish the application through the unused subnet reserved IP, so that the application established through the subnet reserved IP can be normally used.
The embodiment of the application discloses a specific management method for a K8S cluster reserved IP, and compared with the previous embodiment, the embodiment further explains and optimizes the technical scheme. As shown in fig. 3, the method specifically includes:
step S21: and after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP.
For a more specific working process of step S21, reference is made to the foregoing disclosed embodiment, and details are not described herein.
Step S22: and when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so as to facilitate the user terminal to establish the application through the unused subnet reservation IP.
For a more specific working process of step S22, reference is made to the embodiments disclosed above, and details are not described herein.
Step S23: when a plurality of user terminals designate the same unused subnet reservation IP to establish application, a target user terminal is determined from the plurality of user terminals, and the subnet reservation IP is distributed to the target user terminal.
In a specific embodiment, when a plurality of user terminals designate the same unused subnet reservation IP to create an application, a target user terminal is determined from the plurality of user terminals according to response times of the plurality of user terminals, the subnet reservation IP is allocated to the target user terminal, and then an error prompt is performed on user terminals other than the target user terminal in the plurality of user terminals, so that the user terminals create an application through other subnet reservation IPs. In another specific implementation manner, when multiple threads specify the same unused subnet reservation IP to create an application, a target thread is determined from the multiple threads, the subnet reservation IP is allocated to the target thread, and then an error prompt is performed on threads other than the target thread in the multiple threads, so that the threads create an application through other subnet reservation IPs. In another specific implementation, when a multi-path specifies the same unused subnet reservation IP to create an application, a target path is determined from the multi-path, the subnet reservation IP is allocated to the target path, and then a thread other than the target path in the paths is subjected to error prompt, so that the path creates an application through other subnet reservation IPs. Referring to fig. 4, when a user a, a user B, and a bottom layer simultaneously designate the same unused subnet reservation IP to create an application, an application is successfully created according to response times of the user a, the user B, and the bottom layer, then an error prompt is given to other users except the user who successfully creates the application to prompt other users that the subnet reservation IP is used, and the other subnet reservation IPs are replaced to create the application again, so that the other users create the application through the other subnet reservation IPs. Therefore, the application can avoid the phenomenon that the application can not work normally due to the fact that one subnet reserved IP is occupied by multiple applications.
Step S24: when the user terminal is monitored to modify the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, the subnet reserved IP is allowed to be modified, and if the subnet reserved IP is the used subnet reserved IP, the subnet reserved IP is forbidden to be modified.
For a more specific working process of step S24, reference is made to the foregoing disclosed embodiment, and details are not described herein.
Therefore, the present application provides a management method for reserved IPs of a K8S cluster, including: after the creation of the subnet and the subnet reserved IP is finished, monitoring the use condition of the subnet reserved IP, when it is monitored that a user terminal creates application through the subnet reserved IP, retrieving the subnet reserved IP and removing the used subnet reserved IP so that the user terminal creates application through the unused subnet reserved IP; when a plurality of user terminals designate the same unused subnet reservation IP to establish application, determining a target user terminal from the plurality of user terminals, and distributing the subnet reservation IP to the target user terminal; when the modification of the subnet reserved IP by the user terminal is monitored, whether the subnet reserved IP is an unused subnet reserved IP is judged, 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 forbidden. Further, when a plurality of user terminals designate the same unused subnet reservation IP to create an application, the method and the device can determine a target user terminal from the plurality of user terminals and distribute 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 a plurality of applications can be avoided.
Referring to fig. 5, the management method based on the K8S cluster reserved IP specifically includes the following contents:
after the creation of the subnet and the subnet reserved IP is completed, the controller starts to monitor the use condition of the subnet reserved IP, the idle subnet reserved IP allows modification and deletion operations, and the used subnet reserved IP does not allow modification and deletion. When the subnet is modified, a subnet reserved IP can be newly added, then the K8S cluster uses the subnet reserved IP to establish application, and the controller monitors the reserved IP of the subnet, so that the reserved IP used by the establishment application is free, and the application can be normally established. The specific implementation process is as follows:
(1) After the creation of the K8S cluster subnet and the subnet reserved IP is completed, the controller starts to monitor the use condition of the subnet reserved IP;
(2) The K8S cluster uses subnet reserved IP to establish application, when the subnet reserved IP is selected, the controller searches the subnet reserved IP, the unused subnet reserved IP can be used for establishing application, and the used subnet reserved IP can be filtered;
(3) When the user modifies the subnet reservation IP, the controller judges that the used subnet reservation IP can not be modified and the unused subnet reservation IP can be modified;
(4) When the application created by using the subnet reserved IP is deleted, the controller automatically monitors and identifies the reserved IP as unused, modification and deletion operations can be carried out, and when the application is created again by using the reserved IP, the application is successfully created;
(5) The controller transmits the monitored use condition of the subnet reservation IP to the large screen, the large screen displays the specific use condition of the subnet reservation IP, and the user reasonably plans the subnet reservation IP according to the large screen display information.
Therefore, the method and the device have the advantages that the controller mechanism is added, the dynamic use condition of the subnet reserved IP is monitored in real time, the management of the full life cycle of the subnet reserved IP is completed, and the method and the device have the following beneficial effects: the large-screen display directly displays the use condition of the reserved IP of the subnet, so that a user can conveniently and reasonably plan the reserved IP according to actual requirements, the reasonable use and distribution of network resources are facilitated, the waste of the network resources is reduced, and the utilization rate of the network resources is improved; the controller retrieves the subnet reserved IP and filters the used subnet reserved IP, so that the application created by using the subnet reserved IP can be normally used, the situation that the created application cannot be normally used due to the fact that the subnet reserved IP is occupied is avoided, time and labor cost are saved, and user perception and system usability are improved; the used subnet reserved IP can not be modified and deleted, even if a person unfamiliar with the service can also avoid the phenomenon that the used reserved IP is deleted to cause unavailable application, simplify the operation of the system and improve the product quality; the phenomenon that when multiple users, multiple threads or multiple ways build the application, one reserved IP is occupied by multiple applications to cause that the service of the application cannot work normally is prevented.
Correspondingly, an embodiment of the present application further discloses a management apparatus for K8S cluster reserved IP, as shown in fig. 6, the apparatus includes:
the monitoring module 11 is configured to monitor a use condition of the subnet reserved IP after the creation of the subnet and the subnet reserved IP is completed;
an application creation module 12, configured to, when it is monitored that a user terminal creates an application through the subnet reservation IP, retrieve the subnet reservation IP, and remove a used subnet reservation IP, so that the K8S cluster creates an application through an unused subnet reservation IP;
a subnet reservation IP modification module 13, configured to, when it is monitored that the user terminal modifies the subnet reservation IP, determine 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.
Therefore, the present application provides a management method for reserved IPs of a K8S cluster, including: after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP; when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so that the user terminal establishes the application through the unused subnet reservation IP; when the user terminal is monitored to modify the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, the subnet reserved IP is allowed to be modified, and if the subnet reserved IP is the used subnet reserved IP, the subnet reserved IP is forbidden to be modified. Therefore, the method and the device monitor the use condition of the subnet reserved IP through the controller, remove the used subnet reserved IP, and further establish the application through the unused subnet reserved IP, so that the application established through the subnet reserved IP can be normally used.
In some specific embodiments, after the K8S cluster reserves the IP management device, the method further may further include:
and the subnet reservation IP newly-added unit is used for determining the target subnet reservation IP as the unused subnet reservation IP if the target application corresponding to the target subnet reservation IP is deleted.
In some specific embodiments, after the K8S cluster reserves the IP management device, the method further may further include:
a subnet reservation IP deleting unit, configured to, when it is monitored that the subnet reservation IP is deleted by the user terminal, determine whether the subnet reservation IP is an unused subnet reservation IP, allow deletion of the subnet reservation IP if the subnet reservation IP is an unused subnet reservation IP, and prohibit deletion of the subnet reservation IP if the subnet reservation IP is an used subnet reservation IP.
In some specific embodiments, after the listening module 11, the method further may further include:
and transmitting the use condition of the subnet reserved IP to a display screen.
In some specific embodiments, after the application creating module 12, the method further may further include:
a multi-user application creating unit, configured to determine a target user terminal from the multiple user terminals and allocate the subnet reservation IP to the target user terminal when multiple user terminals specify the same unused subnet reservation IP to create an application.
In some specific embodiments, after the application creating module 12, the following steps may be specifically included:
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 creating module 12, the method further may further include:
and carrying out error prompt on user terminals except the target user terminal in the plurality of user terminals so that the user terminals can establish application through other subnet reserved IPs.
Furthermore, the embodiment of the application also provides electronic equipment. FIG. 7 is a block diagram illustrating an electronic device 20 according to an exemplary embodiment, and the contents of the diagram should not be construed as limiting 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 disclosure. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a display 23, an input output interface 24, a communication interface 25, a power supply 26, and a communication bus 27. Wherein the memory 22 is adapted to store a computer program, which is loaded and executed by the processor 21, to implement the steps of:
after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP;
when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so that the user terminal establishes the application through the unused subnet reservation IP;
when the modification of the subnet reserved IP by the user terminal is monitored, judging whether the subnet reserved IP is an unused subnet reserved IP or not, if the subnet reserved IP is the unused subnet reserved IP, allowing the modification of the subnet reserved IP, and if the subnet reserved IP is the used subnet reserved IP, forbidding the modification of the subnet reserved IP.
In some embodiments, the processor, by executing the computer program stored in the memory, may further include the steps of:
and if the target application corresponding to the target subnet reserved IP is deleted, determining the target subnet reserved IP as an unused subnet reserved IP.
In some embodiments, the processor, by executing the computer program stored in the memory, may further include:
when it is monitored that the user terminal deletes the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, deletion of the subnet reserved IP is allowed, and if the subnet reserved IP is an used subnet reserved IP, deletion of the subnet reserved IP is prohibited.
In some embodiments, the processor, by executing the computer program stored in the memory, may further include the steps of:
and transmitting the use condition of the subnet reserved IP to a display screen.
In some embodiments, the processor, by executing the computer program stored in the memory, may further include:
when a plurality of user terminals designate the same unused subnet reservation IP to create an application, a target user terminal is determined from the plurality of user terminals, and the subnet reservation IP is allocated to 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, by executing the computer program stored in the memory, may further include the steps of:
and performing error prompt on user terminals except the target user terminal in the plurality of user terminals so that the user terminals can establish application through other subnet reserved IPs.
In this embodiment, the power supply 26 is used for providing 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 followed by the communication interface is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited herein; the input/output interface 24 is configured to obtain external input data or output data to the outside, and a specific interface type thereof may be selected according to specific application requirements, which is not specifically limited herein.
In addition, the storage 22 is used as a carrier for storing resources, and may be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon may include the computer program 221, and the storage manner may be a transient storage manner or a permanent storage manner. The computer program 221 may further include a computer program that can be used to complete other specific tasks, in addition to the computer program that can be used to complete the management method for K8S cluster reserved IP executed 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; wherein the computer program, when executed by a processor, implements the aforementioned disclosed management method for K8S cluster reservation IP.
For the specific steps of the method, reference may be made to corresponding contents disclosed in the foregoing embodiments, and details are not repeated here.
The embodiments in the present application are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts among the embodiments are referred to each other, that is, for the apparatus disclosed in the embodiments, since the apparatus corresponds to the method disclosed in the embodiments, the description is simple, and for the relevant parts, the method is referred to the method part.
Those of skill would further appreciate that the various illustrative components 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 components and steps of the various examples have been described above generally in terms of their functionality in order to clearly illustrate this 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 implementation. 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. A software module may reside 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 should also be noted that, herein, relational terms such as first and second, and the like may be 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. Also, 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 phrases "comprising one of 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The method, the apparatus, the device, and the storage medium for managing the K8S cluster reserved IP provided by the present application are introduced in detail, and a specific example is applied in the present application to explain the principle and the implementation of the present application, and the description of the above embodiment is only used to help understand the method and the core idea of the present application; meanwhile, for a person skilled in the art, according to the idea of the present application, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present application.

Claims (10)

1. A management method for reserved IP of a K8S cluster is applied to a controller, wherein the controller is deployed in the K8S cluster, and the method comprises the following steps:
after the creation of the subnet and the subnet reserved IP is completed, monitoring the use condition of the subnet reserved IP;
when monitoring that the user terminal establishes the application through the subnet reservation IP, retrieving the subnet reservation IP and removing the used subnet reservation IP so that the user terminal establishes the application through the unused subnet reservation IP;
when the user terminal is monitored to modify the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, the subnet reserved IP is allowed to be modified, and if the subnet reserved IP is the used subnet reserved IP, the subnet reserved IP is forbidden to be modified.
2. The method for managing reserved IPs in a K8S cluster according to claim 1, further comprising:
and if the target application corresponding to the target subnet reserved IP is deleted, determining the target subnet reserved IP as an unused subnet reserved IP.
3. The method for managing the reserved IPs of the K8S cluster as claimed in claim 1, further comprising:
when it is monitored that the user terminal deletes the subnet reserved IP, whether the subnet reserved IP is an unused subnet reserved IP is judged, if the subnet reserved IP is the unused subnet reserved IP, deletion of the subnet reserved IP is allowed, and if the subnet reserved IP is an used subnet reserved IP, deletion of the subnet reserved IP is prohibited.
4. The method for managing a reserved IP in a K8S cluster according to claim 1, wherein after monitoring the usage of the reserved IP in the subnet, the method further comprises:
and transmitting the use condition of the subnet reserved IP to a display screen.
5. The method for managing a reserved IP in a K8S cluster according to any one of claims 1 to 4, wherein the removing of the used subnet reserved IP so that the user terminal creates an application through an unused subnet reserved IP further comprises:
when a plurality of user terminals designate the same unused subnet reservation IP to establish application, a target user terminal is determined from the plurality of user terminals, and the subnet reservation IP is distributed to the target user terminal.
6. The method as claimed in claim 5, wherein the determining the target ue from the plurality of ues comprises:
and determining a target user terminal from the plurality of user terminals according to the response time of the plurality of user terminals.
7. The method for managing the reserved IP in the K8S cluster according to claim 5, wherein after the allocating the subnet reserved IP to the target ue, the method further comprises:
and carrying out error prompt on user terminals except the target user terminal in the plurality of user terminals so that the user terminals can establish application through other subnet reserved IPs.
8. The management device for reserved IP of a K8S cluster is applied to a controller, wherein the controller is deployed in the K8S cluster, and the device comprises:
the monitoring module is used for monitoring the use 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 retrieving the subnet reserved IP and removing the used subnet reserved IP when monitoring that the user terminal creates 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, when it is monitored that the user terminal modifies the subnet reservation IP, determine 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.
9. An electronic device, comprising:
a memory for storing a computer program;
a processor for executing the computer program to implement the method for managing K8S cluster reserved IPs according to any one of claims 1 to 7.
10. A computer-readable storage medium for storing a computer program; wherein the computer program when executed by a processor implements the method of managing K8S cluster reservation IP of any of claims 1 to 7.
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 true CN115225612A (en) 2022-10-21
CN115225612B 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 (13)

* 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
US20210328913A1 (en) * 2020-04-20 2021-10-21 Cisco Technology, Inc. Service aware virtual private network for optimized forwarding in cloud native environment
US20210328858A1 (en) * 2020-04-16 2021-10-21 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
US20210334235A1 (en) * 2020-04-23 2021-10-28 Netapp, Inc. Systems and methods for configuring, creating, and modifying parallel file systems
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

Patent Citations (14)

* 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
US20210328858A1 (en) * 2020-04-16 2021-10-21 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
US20210328913A1 (en) * 2020-04-20 2021-10-21 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
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 (3)

* Cited by examiner, † Cited by third party
Title
NGUYEN NGUYEN; 等: "Toward Highly Scalable Load Balancing in Kubernetes Clusters", 《IEEE COMMUNICATIONS MAGAZINE 》, vol. 58, no. 7, XP011802034, DOI: 10.1109/MCOM.001.1900660 *
冯文超;: "容器云平台网络资源配置管理系统的设计", 工业仪表与自动化装置, no. 01 *
刘梦馨: ""kube-VON的设计思路和实现原理"", 《51CTO博客,HTTPS://BLOG.51CTO.COM/U_15127630/2777660》, pages 4 *

Also Published As

Publication number Publication date
CN115225612B (en) 2023-11-14

Similar Documents

Publication Publication Date Title
CN108206852B (en) Session-based service instance management method and device under micro-service framework
EP3455728B1 (en) Orchestrator for a virtual network platform as a service (vnpaas)
US20230007662A1 (en) Dynamic slice priority handling
CN109995641B (en) Information processing method, computing node and storage medium
CN106790092B (en) Remote procedure call server control system and method
CN111858054B (en) Resource scheduling system and method based on edge computing in heterogeneous environment
CN113778623B (en) Resource processing method and device, electronic equipment and storage medium
CN110138577B (en) Cluster creation method, first server and readable storage medium
CN114070822B (en) Kubernetes Overlay IP address management method
CN109600769B (en) Communication method and device
CN111274033B (en) Resource deployment method, device, server and storage medium
CN111880936A (en) Resource scheduling method and device, container cluster, computer equipment and storage medium
CN109120444B (en) Cloud resource management method, processor and storage medium
Naas et al. IoT data replication and consistency management in fog computing
CN113382077B (en) Micro-service scheduling method, micro-service scheduling device, computer equipment and storage medium
WO2016095524A1 (en) Resource allocation method and apparatus
CN111797173B (en) Alliance chain sharing system, method and device, electronic equipment and storage medium
CN111770130B (en) Method for efficient collaborative multiplexing of software and hardware resources in block chain distributed networking
CN112187864A (en) Load balancing method and device, storage medium and electronic equipment
CN109413117B (en) Distributed data calculation method, device, server and computer storage medium
KR102553478B1 (en) Arrangement method of resources necessary for network function, storage medium and electronic device
CN115225612B (en) Management method, device, equipment and medium for K8S cluster reserved IP
CN116800825A (en) Calling method, device, equipment and medium based on micro-service splitting
CN106357704A (en) Method and device for invoking service on basis of development environments
CN105634765A (en) Controller replacement method and controller replacement device

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