CN116366618A - Network plug-in method and device for fixing IP of container - Google Patents

Network plug-in method and device for fixing IP of container Download PDF

Info

Publication number
CN116366618A
CN116366618A CN202310359391.5A CN202310359391A CN116366618A CN 116366618 A CN116366618 A CN 116366618A CN 202310359391 A CN202310359391 A CN 202310359391A CN 116366618 A CN116366618 A CN 116366618A
Authority
CN
China
Prior art keywords
container
network
address
node
plug
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.)
Pending
Application number
CN202310359391.5A
Other languages
Chinese (zh)
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202310359391.5A priority Critical patent/CN116366618A/en
Publication of CN116366618A publication Critical patent/CN116366618A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/34Network arrangements or protocols for supporting network services or applications involving the movement of software or configuration parameters 
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0893Assignment of logical groups to network elements
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the application provides a network plug-in method and device for fixing an IP (Internet protocol) of a container, which can be used in the financial field, and the method comprises the following steps: the user creates a network through the node proxy command of the API server component, and designates VLAN, mask, gateway and IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires a corresponding IP address from the IP pool through a container network configuration component, and executes container deployment operation; according to the method and the device, IP address automatic allocation management can be realized, no repetition of the IP address is ensured, and IP fixation of the stateful container is visible.

Description

Network plug-in method and device for fixing IP of container
Technical Field
The application relates to the field of data processing and also can be used in the financial field, in particular to a network plug-in method and device for fixing a container IP.
Background
Under the background of digital transformation, with the popularization and application of the business, the whole number of Mysql servers presents blowout development, and the single body of the Mysql database is generally smaller in scale and lower in resource utilization rate. The contradiction between the rapidly growing number of servers and the lower resource usage is significant. Therefore, mysql (stateful application) containers need to be actively pushed into the cloud, however, the containers are naturally suitable for stateless applications, and how to make stateful applications fix ip and ip visible to the outside is a difficulty.
Disclosure of Invention
Aiming at the problems in the prior art, the application provides a network plug-in method and a device for fixing the IP of a container, which can realize automatic allocation and management of IP addresses, ensure no repetition of the IP addresses and realize that the IP of a stateful container is fixed and visible to the outside.
In order to solve at least one of the above problems, the present application provides the following technical solutions:
in a first aspect, the present application provides a method for fixing a network plug-in of a container IP, including:
the user creates a network through the node proxy command of the API server component, and designates VLAN, mask, gateway and IP pool;
after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy;
and the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation.
Further, the method further comprises the following steps:
the IP addresses bound in the network declaration are configured into the namespace of the container by the container network configuration component.
Further, the method further comprises the following steps:
and binding the network port into the corresponding naming space of the container through the container network configuration component.
Further, the performing container deployment operations includes:
specifying a container name, a container mirror, and a container label through a container edit command of the API server component;
the container label comprises a name of a network statement and is used for binding the allocated IP address with a container, generating a specified IP and externally reachable container.
In a second aspect, the present application provides a network plug-in device for securing a container IP, comprising:
the network creation module is used for creating a network through a node proxy command of the API server component and designating VLAN, mask, gateway and IP pool;
the container scheduling module is used for scheduling the container to a designated working node through a scheduler component according to a preset scheduling strategy after the API server component receives the creation request sent by the user;
and the container deployment module is used for receiving the scheduling information by the node agent of the working node, acquiring a corresponding IP address from the IP pool through the container network configuration component, and executing container deployment operation.
Further, the method further comprises the following steps:
and the IP address configuration unit is used for configuring the IP address bound in the network statement into the naming space of the container through the container network configuration component.
Further, the method further comprises the following steps:
and the network port binding unit is used for binding the network port into the naming space corresponding to the container through the container network configuration component.
Further, the container deployment module includes:
a container editing unit for designating a container name, a container image, and a container tag through a container editing command of the API server component; the container label comprises a name of a network statement and is used for binding the allocated IP address with a container, generating a specified IP and externally reachable container.
In a third aspect, the present application provides an electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the network plug-in method of fixed container IP when the program is executed by the processor.
In a fourth aspect, the present application provides a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the network plug-in method of fixed container IP.
In a fifth aspect, the present application provides a computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the network plug-in method of fixed container IP.
According to the technical scheme, the application provides a network plug-in method and device for fixing a container IP, wherein a network is created through a node proxy command of an API server component, and VLAN, mask, gateway and IP pool are designated; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
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 in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flow chart of a network plug-in method of a fixed container IP in an embodiment of the present application;
FIG. 2 is one of the block diagrams of a network plug-in device securing a container IP in an embodiment of the present application;
FIG. 3 is a second block diagram of a network plug-in device securing a container IP in an embodiment of the present application;
FIG. 4 is a third block diagram of a network plug-in device securing a container IP in an embodiment of the present application;
FIG. 5 is a diagram illustrating a network architecture according to an embodiment of the present application;
FIG. 6 is a diagram illustrating a call flow in an embodiment of the present application;
fig. 7 is a schematic structural diagram of an electronic device in an embodiment of the present application.
Detailed Description
For the purposes of making the objects, technical solutions and advantages of the embodiments of the present application more clear, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are some embodiments of the present application, but not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, are intended to be within the scope of the present application.
The data acquisition, storage, use, processing and the like in the technical scheme meet the relevant regulations of national laws and regulations.
In view of the problems existing in the prior art, the present application provides a method and apparatus for network plug-in of fixed container IP, creating a network through a node proxy command of an API server component, and designating a VLAN, a mask, a gateway, and an IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
In the existing K8S key components:
(1) The Master node has four major components: apiserver, etcd, scheduler, controller manager. The Node has two components: kubelet, kube-proxy.
(2) Relationship between the plug-ins: only the apiserver is connected to etcd, and all the remaining components are connected to apiserver. Apiserver, which reads and writes the requirements of the user to etcd. (providing a unique portal for resource operations and providing mechanisms for authentication, authorization, access control, api registration and discovery, etc.).
(3) The components function:
etcd: the state of the entire cluster is saved in the form of key-value pairs.
Scheduler: responsible for resource scheduling, i.e. listening to a newly created pod but not assigned to a node, selects a node for the pod.
Controller manager: is responsible for maintaining the state of the cluster, such as fault detection, automatic expansion, rolling updates, etc.
Kubelet is responsible for maintaining the lifecycle of the container, as well as for the management of volume and network.
Kube-proxy: is responsible for providing service discovery and load balancing inside a cluster for services.
It will be appreciated that the current native dockers and kubernetes cannot communicate from container to container and must be implemented by means of a third party plug-in. Therefore, on the key components of k8s, the method is realized by custom controller (network controller) and network plug in (a network plug in, namely a group of interfaces, is provided in the code of kubelet) to realize network configuration, release, acquisition and the like of the sloping field.
In order to realize automatic allocation management of IP addresses, ensure no duplication of IP addresses, and realize that IP fixing of a stateful container is visible to the outside, the application provides an embodiment of a network plug-in method for fixing a container IP, referring to fig. 1, the network plug-in method for fixing a container IP specifically includes the following contents:
step S101: the user creates a network through the node proxy commands of the API server component and specifies a VLAN, mask, gateway, and IP pool.
Optionally, in the present application, 1, the user creates a network through a kubectl command of apis erver, specifies VLAN, mask, GW and IP pool.
Step S102: and after receiving the creation request sent by the user, the API server component dispatches the container to the designated working node through a dispatcher component according to a preset dispatching strategy.
Optionally, in the present application, the 2, API Server receives the user application and dispatches to the Node through the Scheduler.
Step S103: and the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation.
Optionally, in the present application, the 3 Node Kubelet receives the scheduling information, and obtains the IP address from the IP pool by using a network plug.
Optionally, the user deployment container specifically includes: the POD name, image and label are specified through the kubectl command of the APIserver, wherein the label field comprises networkclaim name created in the last step and is used for binding the IP address allocated in the last step with the POD, and a container which is specified with IP and can be externally accessed can be generated.
As can be seen from the above description, the network plug-in method of the fixed container IP provided in the embodiments of the present application can create a network through the node proxy command of the API server component, and specify a VLAN, a mask, a gateway, and an IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
In an embodiment of the network plug-in method of the fixed container IP of the present application, the following may be further specifically included:
the IP addresses bound in the network declaration are configured into the namespace of the container by the container network configuration component.
Optionally, in the present application, the Network plug configures the ip address bound in the Network clip into the nacespace of the container.
In an embodiment of the network plug-in method of the fixed container IP of the present application, the following may be further specifically included:
and binding the network port into the corresponding naming space of the container through the container network configuration component.
Alternatively, in this application, the cbondn port may be bound to the corresponding nacespace of the container.
In an embodiment of the network plug-in method of the fixed container IP of the present application, the following may be further specifically included:
specifying a container name, a container mirror, and a container label through a container edit command of the API server component;
the container label comprises a name of a network statement and is used for binding the allocated IP address with a container, generating a specified IP and externally reachable container.
Alternatively, in the application, the POD name, image, and labels may be specified by a kubectl command of an apis server, where labels field includes networkclaim name created in the last step, and is used to bind the IP address allocated in the last step to the POD, so that a container that specifies IP and is externally reachable may be generated.
In order to enable automatic allocation management of IP addresses, ensure that IP addresses are not duplicated, and enable IP fixing of a stateful container to be visible, the present application provides an embodiment of a network plug-in device of a fixed container IP for implementing all or part of the content of a network plug-in method of the fixed container IP, referring to fig. 2, where the network plug-in device of the fixed container IP specifically includes the following contents:
the network creation module 10 is used for creating a network through a node proxy command of the API server component by a user, and designating VLAN, mask, gateway and IP pool.
And the container scheduling module 20 is used for scheduling the container to the designated working node according to a preset scheduling policy through a scheduler component after the API server component receives the creation request sent by the user.
The container deployment module 30 is configured to receive the scheduling information from the node agent of the working node, obtain, through a container network configuration component, a corresponding IP address from the IP pool, and perform a container deployment operation.
As can be seen from the above description, the network plug-in device for fixed container IP provided in the embodiments of the present application can create a network through a node proxy command of an API server component, and specify a VLAN, a mask, a gateway, and an IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
In an embodiment of the network plug-in device for fixing the container IP of the present application, referring to fig. 3, the following is specifically included:
an IP address configuration unit 41, configured to configure, by the container network configuration component, the IP address bound in the network claim into the namespace of the container.
A portal binding unit 42 for binding a portal to a namespace corresponding to a container through the container network configuration component.
In one embodiment of the fixed container IP network plug-in device of the present application, referring to fig. 4, the container deployment module 30 includes:
a container editing unit 31 for designating a container name, a container image, and a container tag by a container editing command of the API server component; the container label comprises a name of a network statement and is used for binding the allocated IP address with a container, generating a specified IP and externally reachable container.
In order to further explain the scheme, the application also provides a specific application example of the network plug-in device for realizing the network plug-in method of the fixed container IP by using the network plug-in device of the fixed container IP, which specifically comprises the following contents:
referring to fig. 5, the physical network cards are virtualized into vf ports, and are respectively cbond, and the gateway starts on the switch. Based on the virtualization multiplying power of SR-IOV, the maximum of the ten-megacard is 1:63, and the gigabit card is 1:7.
Meanwhile, the present application further provides a specific embodiment of the call flow, and referring to fig. 6,Network Controller, it is responsible for: and monitoring object events such as K8S ports, network and the like. IPAM function is provided and is responsible for container network IP resource pool management. Network plug is responsible for: the Node is responsible for pod access network and IP configuration.
The calling flow comprises the following steps:
1. a user creates a network through a kubectl command of an apis server, and designates a VLAN, a mask, a GW and an IP pool;
2. and the API Server receives the user application and dispatches the user application to the Node through the Scheduler.
3. The Node Kubelet receives the scheduling information and obtains the IP address from the IP pool through network plug in.
The Network plug configures the ip address bound in the Network clip into the nacespace of the container, and binds the cbondn port into the corresponding nacespace of the container.
For example, the networkclass file format is as follows:
{
"Namespace": "Namespace name",
"name": "network claim name", "network": "network name",
"bandwidth":0
}
at the same time, the user deploys the container: the POD name, image and label are specified through the kubectl command of the APIserver, wherein the label field comprises networkclaim name created in the last step and is used for binding the IP address allocated in the last step with the POD, and a container which is specified with IP and can be externally accessed can be generated.
With the above matters, the present application can at least achieve the following technical effects:
the IP address automatic allocation management is realized, the IP address is ensured to be free from repetition, and the IP fixation of the stateful container is externally visible.
The SR-IOV network card drive virtualized straight-through network is realized, and the virtual straight-through network is provided with a lossless network which is close to a physical network card.
In order to realize automatic allocation management of an IP address, ensure no duplication of the IP address, and realize that IP fixing of a stateful container is visible to the outside, the application provides an embodiment of an electronic device for realizing all or part of contents in a network plug-in method of the fixed container IP, where the electronic device specifically includes the following contents:
a processor (processor), a memory (memory), a communication interface (Communications Interface), and a bus; the processor, the memory and the communication interface complete communication with each other through the bus; the communication interface is used for realizing information transmission between the network plug-in device of the fixed container IP and related equipment such as a core service system, a user terminal, a related database and the like; the logic controller may be a desktop computer, a tablet computer, a mobile terminal, etc., and the embodiment is not limited thereto. In this embodiment, the logic controller may be implemented with reference to the embodiment of the network plug-in method of the fixed container IP in the embodiment and the embodiment of the network plug-in device of the fixed container IP, and the contents thereof are incorporated herein, and the repetition is omitted.
It is understood that the user terminal may include a smart phone, a tablet electronic device, a network set top box, a portable computer, a desktop computer, a Personal Digital Assistant (PDA), a vehicle-mounted device, a smart wearable device, etc. Wherein, intelligent wearing equipment can include intelligent glasses, intelligent wrist-watch, intelligent bracelet etc..
In practical applications, part of the network plug-in method for fixing the container IP may be performed on the electronic device side as described above, or all operations may be performed in the client device. Specifically, the selection may be made according to the processing capability of the client device, and restrictions of the use scenario of the user. The present application is not limited in this regard. If all operations are performed in the client device, the client device may further include a processor.
The client device may have a communication module (i.e. a communication unit) and may be connected to a remote server in a communication manner, so as to implement data transmission with the server. The server may include a server on the side of the task scheduling center, and in other implementations may include a server of an intermediate platform, such as a server of a third party server platform having a communication link with the task scheduling center server. The server may include a single computer device, a server cluster formed by a plurality of servers, or a server structure of a distributed device.
Fig. 7 is a schematic block diagram of a system configuration of an electronic device 9600 of an embodiment of the present application. As shown in fig. 7, the electronic device 9600 may include a central processor 9100 and a memory 9140; the memory 9140 is coupled to the central processor 9100. Notably, this fig. 7 is exemplary; other types of structures may also be used in addition to or in place of the structures to implement telecommunications functions or other functions.
In one embodiment, the network plug-in method functionality of the fixed container IP may be integrated into the central processor 9100. The central processor 9100 may be configured to perform the following control:
step S101: the user creates a network through the node proxy commands of the API server component and specifies a VLAN, mask, gateway, and IP pool.
Step S102: and after receiving the creation request sent by the user, the API server component dispatches the container to the designated working node through a dispatcher component according to a preset dispatching strategy.
Step S103: and the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation.
As can be seen from the above description, the electronic device provided in the embodiments of the present application creates a network through the node proxy command of the API server component, and designates a VLAN, a mask, a gateway, and an IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
In another embodiment, the network plug-in device of the fixed container IP may be configured separately from the central processor 9100, for example, the network plug-in device of the fixed container IP may be configured as a chip connected to the central processor 9100, and the network plug-in method function of the fixed container IP is implemented under the control of the central processor.
As shown in fig. 7, the electronic device 9600 may further include: a communication module 9110, an input unit 9120, an audio processor 9130, a display 9160, and a power supply 9170. It is noted that the electronic device 9600 need not include all of the components shown in fig. 7; in addition, the electronic device 9600 may further include components not shown in fig. 7, and reference may be made to the related art.
As shown in fig. 7, the central processor 9100, sometimes referred to as a controller or operational control, may include a microprocessor or other processor device and/or logic device, which central processor 9100 receives inputs and controls the operation of the various components of the electronic device 9600.
The memory 9140 may be, for example, one or more of a buffer, a flash memory, a hard drive, a removable media, a volatile memory, a non-volatile memory, or other suitable device. The information about failure may be stored, and a program for executing the information may be stored. And the central processor 9100 can execute the program stored in the memory 9140 to realize information storage or processing, and the like.
The input unit 9120 provides input to the central processor 9100. The input unit 9120 is, for example, a key or a touch input device. The power supply 9170 is used to provide power to the electronic device 9600. The display 9160 is used for displaying display objects such as images and characters. The display may be, for example, but not limited to, an LCD display.
The memory 9140 may be a solid state memory such as Read Only Memory (ROM), random Access Memory (RAM), SIM card, etc. But also a memory which holds information even when powered down, can be selectively erased and provided with further data, an example of which is sometimes referred to as EPROM or the like. The memory 9140 may also be some other type of device. The memory 9140 includes a buffer memory 9141 (sometimes referred to as a buffer). The memory 9140 may include an application/function storage portion 9142, the application/function storage portion 9142 storing application programs and function programs or a flow for executing operations of the electronic device 9600 by the central processor 9100.
The memory 9140 may also include a data store 9143, the data store 9143 for storing data, such as contacts, digital data, pictures, sounds, and/or any other data used by an electronic device. The driver storage portion 9144 of the memory 9140 may include various drivers of the electronic device for communication functions and/or for performing other functions of the electronic device (e.g., messaging applications, address book applications, etc.).
The communication module 9110 is a transmitter/receiver 9110 that transmits and receives signals via an antenna 9111. A communication module (transmitter/receiver) 9110 is coupled to the central processor 9100 to provide input signals and receive output signals, as in the case of conventional mobile communication terminals.
Based on different communication technologies, a plurality of communication modules 9110, such as a cellular network module, a bluetooth module, and/or a wireless local area network module, etc., may be provided in the same electronic device. The communication module (transmitter/receiver) 9110 is also coupled to a speaker 9131 and a microphone 9132 via an audio processor 9130 to provide audio output via the speaker 9131 and to receive audio input from the microphone 9132 to implement usual telecommunications functions. The audio processor 9130 can include any suitable buffers, decoders, amplifiers and so forth. In addition, the audio processor 9130 is also coupled to the central processor 9100 so that sound can be recorded locally through the microphone 9132 and sound stored locally can be played through the speaker 9131.
The embodiments of the present application further provide a computer-readable storage medium capable of implementing all the steps in the network plug-in method of the fixed container IP in which the execution subject is a server or a client in the above embodiments, the computer-readable storage medium storing a computer program thereon, the computer program implementing all the steps in the network plug-in method of the fixed container IP in which the execution subject is a server or a client in the above embodiments when executed by a processor, for example, the processor implementing the following steps when executing the computer program:
step S101: the user creates a network through the node proxy commands of the API server component and specifies a VLAN, mask, gateway, and IP pool.
Step S102: and after receiving the creation request sent by the user, the API server component dispatches the container to the designated working node through a dispatcher component according to a preset dispatching strategy.
Step S103: and the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation.
As can be seen from the above description, the computer-readable storage medium provided in the embodiments of the present application creates a network through a node proxy command of an API server component, and designates a VLAN, a mask, a gateway, and an IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
The embodiments of the present application further provide a computer program product capable of implementing all the steps in the network plug-in method of the fixed container IP in which the execution subject is a server or a client in the above embodiments, where the computer program/instructions implement the steps of the network plug-in method of the fixed container IP when executed by a processor, for example, the computer program/instructions implement the steps of:
step S101: the user creates a network through the node proxy commands of the API server component and specifies a VLAN, mask, gateway, and IP pool.
Step S102: and after receiving the creation request sent by the user, the API server component dispatches the container to the designated working node through a dispatcher component according to a preset dispatching strategy.
Step S103: and the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation.
As can be seen from the above description, the computer program product provided by the embodiments of the present application creates a network through the node proxy command of the API server component, and designates a VLAN, a mask, a gateway, and an IP pool; after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy; the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation, thereby realizing automatic allocation management of the IP address, ensuring no repetition of the IP address, and realizing that the IP of the stateful container is fixed and visible.
It will be apparent to those skilled in the art that embodiments of the present invention may be provided as a method, apparatus, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (devices), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The principles and embodiments of the present invention have been described in detail with reference to specific examples, which are provided to facilitate understanding of the method and core ideas of the present invention; 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 invention, the present description should not be construed as limiting the present invention in view of the above.

Claims (11)

1. A network plug-in method for fixing a container IP, the method comprising:
the user creates a network through the node proxy command of the API server component, and designates VLAN, mask, gateway and IP pool;
after receiving the creation request sent by the user, the API server component dispatches the container to a designated working node through a dispatcher component according to a preset dispatching strategy;
and the node agent of the working node receives the scheduling information, acquires the corresponding IP address from the IP pool through the container network configuration component, and executes container deployment operation.
2. The network plug-in method of fixed container IP of claim 1, further comprising:
the IP addresses bound in the network declaration are configured into the namespace of the container by the container network configuration component.
3. The network plug-in method of fixed container IP of claim 1, further comprising:
and binding the network port into the corresponding naming space of the container through the container network configuration component.
4. The fixed container IP network plug-in method of claim 1 wherein said performing container deployment operations comprises:
specifying a container name, a container mirror, and a container label through a container edit command of the API server component;
the container label comprises a name of a network statement and is used for binding the allocated IP address with a container, generating a specified IP and externally reachable container.
5. A network plug-in device for securing a container IP, comprising:
the network creation module is used for creating a network through a node proxy command of the API server component and designating VLAN, mask, gateway and IP pool;
the container scheduling module is used for scheduling the container to a designated working node through a scheduler component according to a preset scheduling strategy after the API server component receives the creation request sent by the user;
and the container deployment module is used for receiving the scheduling information by the node agent of the working node, acquiring a corresponding IP address from the IP pool through the container network configuration component, and executing container deployment operation.
6. The fixed container IP network plug-in device of claim 5, further comprising:
and the IP address configuration unit is used for configuring the IP address bound in the network statement into the naming space of the container through the container network configuration component.
7. The fixed container IP network plug-in device of claim 5, further comprising:
and the network port binding unit is used for binding the network port into the naming space corresponding to the container through the container network configuration component.
8. The fixed container IP network plug-in device of claim 5, wherein the container deployment module comprises:
a container editing unit for designating a container name, a container image, and a container tag through a container editing command of the API server component; the container label comprises a name of a network statement and is used for binding the allocated IP address with a container, generating a specified IP and externally reachable container.
9. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the steps of the network plug-in method of the fixed container IP of any one of claims 1 to 4 when the program is executed by the processor.
10. A computer readable storage medium having stored thereon a computer program, characterized in that the computer program when executed by a processor implements the steps of the network plug-in method of a fixed container IP as claimed in any one of claims 1 to 4.
11. A computer program product comprising computer programs/instructions which, when executed by a processor, implement the steps of the network plug-in method of fixed container IP as claimed in any one of claims 1 to 4.
CN202310359391.5A 2023-04-06 2023-04-06 Network plug-in method and device for fixing IP of container Pending CN116366618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310359391.5A CN116366618A (en) 2023-04-06 2023-04-06 Network plug-in method and device for fixing IP of container

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310359391.5A CN116366618A (en) 2023-04-06 2023-04-06 Network plug-in method and device for fixing IP of container

Publications (1)

Publication Number Publication Date
CN116366618A true CN116366618A (en) 2023-06-30

Family

ID=86904606

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310359391.5A Pending CN116366618A (en) 2023-04-06 2023-04-06 Network plug-in method and device for fixing IP of container

Country Status (1)

Country Link
CN (1) CN116366618A (en)

Similar Documents

Publication Publication Date Title
CN111031058A (en) Websocket-based distributed server cluster interaction method and device
CN111679790B (en) Remote software development storage space allocation method and device
AU2019256257B2 (en) Processor core scheduling method and apparatus, terminal, and storage medium
CN112749022B (en) Camera resource access method, operating system, terminal and virtual camera
CN105204816A (en) Method and device for controlling audios in multisystem
CN110764881A (en) Distributed system background retry method and device
CN111858050B (en) Server cluster hybrid deployment method, cluster management node and related system
CN112953908A (en) Network isolation configuration method, device and system
CN111796838A (en) MPP database automatic deployment method and device
CN112689012A (en) Cross-network proxy communication method and device
CN109495461A (en) Data access request processing method, device and vehicle-mounted central control system
CN111367561B (en) Remote development method and device for software program
CN111930624B (en) Test link message data processing method and device
CN112559158A (en) Micro-service timing task scheduling method and device
CN116366618A (en) Network plug-in method and device for fixing IP of container
CN113452776B (en) PaaS platform service scheduling method and device and PaaS platform
CN114374614B (en) Network topology configuration method and device
CN113268272B (en) Application delivery method, device and system based on private cloud
CN114637531A (en) Method and device for dynamically generating application program interface
CN113392091A (en) Distributed cluster data migration method and device
CN112102058A (en) Management system parameter configuration method and device
CN114090489B (en) IO expansion method and device based on virtio
CN111343172A (en) Network access authority dynamic processing method and device
US20070258480A1 (en) Resource management system and method
CN116700660B (en) Audio playing method and electronic equipment

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