CN113347043A - Gateway management method, device, gateway management platform and storage medium - Google Patents

Gateway management method, device, gateway management platform and storage medium Download PDF

Info

Publication number
CN113347043A
CN113347043A CN202110709713.5A CN202110709713A CN113347043A CN 113347043 A CN113347043 A CN 113347043A CN 202110709713 A CN202110709713 A CN 202110709713A CN 113347043 A CN113347043 A CN 113347043A
Authority
CN
China
Prior art keywords
gateway
service
apollo
container
interface
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
CN202110709713.5A
Other languages
Chinese (zh)
Other versions
CN113347043B (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.)
Wuhan Yuexuebang Network Technology Co ltd
Original Assignee
Wuhan Yuexuebang Network 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 Wuhan Yuexuebang Network Technology Co ltd filed Critical Wuhan Yuexuebang Network Technology Co ltd
Priority to CN202110709713.5A priority Critical patent/CN113347043B/en
Publication of CN113347043A publication Critical patent/CN113347043A/en
Application granted granted Critical
Publication of CN113347043B publication Critical patent/CN113347043B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • H04L67/025Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
    • 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/0803Configuration setting
    • H04L41/0823Configuration setting characterised by the purposes of a change of settings, e.g. optimising configuration for enhancing reliability
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • 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
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/60Scheduling or organising the servicing of application requests, e.g. requests for application data transmissions using the analysis and optimisation of the required network resources
    • H04L67/63Routing a service request depending on the request content or context

Landscapes

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

Abstract

The application provides a gateway management method, a gateway management device, a gateway management platform and a storage medium, wherein the method comprises the following steps: after the configuration information is acquired, calling an interface of an Apollo configuration center, creating an Apollo service for the gateway, then calling a K8s interface, and creating at least one K8s container based on the Apollo service, wherein it can be understood that the configuration file of each K8s container includes the interface of the Apollo service; the method comprises the steps of calling an interface of the Apollo service, starting at least one K8s container, enabling each K8s container in at least one K8s container to generate an application instance, and achieving creation of a gateway.

Description

Gateway management method, device, gateway management platform and storage medium
Technical Field
The present application relates to the field of gateway technologies, and in particular, to a method and an apparatus for managing a gateway, a gateway management platform, and a storage medium.
Background
In the related art, gateways are all deployed on an Elastic and scalable cloud computing Service (ECS) machine of the arii cloud, if a new gateway needs to be deployed, a new arii cloud ECS machine is first applied, then a start script of a gateway application instance is configured in the applied ECS machine, then a jenkins project is created for the gateway, and finally an Interconnection Protocol (IP) address between networks of the ECS machine where the gateway is located is configured in the jenkins project.
Disclosure of Invention
In view of the above, an object of the embodiments of the present application is to provide a method and an apparatus for managing a gateway, a gateway management platform, and a storage medium, so as to solve the above problem.
In a first aspect, an embodiment of the present application provides a method for managing a gateway, where the method includes: acquiring a gateway establishing request; the gateway establishing request comprises configuration information of the gateway; calling an interface of an Apollo configuration center, and establishing Apollo service for the gateway based on the configuration information; calling a K8s interface and creating at least one K8s container based on the Apollo service; calling an interface of the Apollo service, and starting the at least one K8s container, so that each K8s container in the at least one K8s container generates one application instance.
In the implementation process, after the configuration information is acquired, an interface of an Apollo configuration center is called, an Apollo service is created for the gateway based on the configuration information, then a K8s interface is called, and at least one K8s container is created based on the Apollo service, and it can be understood that the configuration file of each K8s container includes the interface of the Apollo service; the method comprises the steps of calling an interface of the Apollo service, starting at least one K8s container, enabling each K8s container in the at least one K8s container to generate an application instance, and achieving creation of a gateway.
In a possible design based on the first aspect, the method further includes: acquiring a gateway modification request; the gateway modification request comprises modification configuration information of the gateway; modifying configuration information for the gateway based on the Apollo service's interface and the modified configuration information.
In the implementation process, the configuration information of the gateway is modified based on the modification configuration information in the modification request of the interface of the Apollo service and the gateway, so that the modification of the gateway is realized.
In a possible design based on the first aspect, the method further includes: acquiring a gateway query request; the gateway query request comprises keyword information; and displaying the configuration information of the gateway corresponding to the keyword information.
In the implementation process, the configuration information of the corresponding gateway is inquired and displayed according to the keyword information in the gateway inquiry request, so that a user can intuitively know the configuration information of the gateway, and subsequent operation is facilitated.
Based on the first aspect, in one possible design, the obtaining a gateway creation request includes; when receiving a trigger operation of a user, displaying an information configuration interface; and receiving the configuration information input into the information configuration interface by the user.
In the implementation process, when the triggering operation of the user is received, the information configuration interface is generated, so that the user (for example, a programmer) can transmit configuration information on the information configuration interface, the user operation is facilitated, and then, the configuration information input on the configuration interface by the user is obtained for creating the gateway, so that the user does not need to contact an administrator offline to create the gateway.
In a possible design based on the first aspect, the method further includes: acquiring an initial IP address of the at least one k8s container; calling the K8s interface and creating a K8s service for the gateway based on the initial IP address of the at least one K8s container.
In the implementation process, by calling the K8s interface and based on the initial IP address of at least one K8s container, a K8s service is created for the gateway, so that the K8s service can correctly forward the traffic needing to be forwarded to the gateway according to the initial IP address of at least one K8s container.
Based on the first aspect, in a possible design, the configuration information further includes a name of the gateway; the method further comprises the following steps: calling the K8s interface to create a namespace for the gateway; establishing a one-to-one correspondence relationship between the name of the gateway and the name space; associating the namespaces with the K8s service and the Apollo service, respectively.
In the implementation process, a K8s interface is called to create a namespace for the gateway, establish a one-to-one correspondence relationship between the name of the gateway and the namespace, and associate the namespace with the K8s service and the Apollo service respectively, so as to ensure that the namespace corresponding to the gateway can be accurately determined subsequently according to the name of the gateway, and then the K8s service and the Apollo service corresponding to the namespace can be accurately determined according to the corresponding namespace, thereby ensuring the correct operation of the gateway.
In a possible design based on the first aspect, the method further includes: acquiring a route configuration request of the gateway; the configuration request includes a routing rule; calling an interface of the Apollo configuration center to configure the routing rule to the Apollo service; controlling the at least one K8s container to obtain the routing rule from the Apollo service.
In the implementation process, an interface of an Apollo configuration center is called, the routing rule of the gateway is configured into an Apollo service, and then the routing rule is acquired from the Apollo service through the control K8s container, so as to successfully configure the routing rule for the gateway.
In a second aspect, an embodiment of the present application provides an apparatus for managing a gateway, where the apparatus includes: a creation request unit, configured to acquire a gateway creation request; the gateway establishing request comprises configuration information of the gateway; the Apollo service creating unit is used for calling an interface of an Apollo configuration center and creating Apollo service for the gateway based on the configuration information; a container creating unit, configured to call a K8s interface, and create at least one K8s container based on the Apollo service; a container starting unit, configured to invoke the interface of the Apollo service, and start the at least one K8s container, so that each K8s container in the at least one K8s container generates an application instance.
Based on the second aspect, in one possible design, the apparatus further includes: a modification request unit, configured to obtain a gateway modification request; the gateway modification request comprises modification configuration information of the gateway; and the modifying unit is used for modifying the configuration information of the gateway based on the interface of the Apollo service and the modified configuration information.
Based on the second aspect, in one possible design, the apparatus further includes: the query unit is used for acquiring a gateway query request; the gateway query request comprises keyword information; and the display unit is used for displaying the configuration information of the gateway corresponding to the keyword information.
In a possible design based on the second aspect, the creating request unit includes: the interface display unit is used for displaying the information configuration interface when receiving the triggering operation of a user; and the information receiving unit is used for receiving the configuration information input into the information configuration interface by the user.
Based on the second aspect, in one possible design, the apparatus further includes: an IP address obtaining unit, configured to obtain an initial IP address of the at least one k8s container; a K8s service creation unit for invoking the K8s interface and creating a K8s service for the gateway based on the initial IP address of the at least one K8s container.
In a possible design according to the second aspect, the configuration information includes a name of the gateway; the device further comprises: the namespace creating unit is used for calling the K8s interface and creating a namespace for the gateway; the relationship establishing unit is used for establishing the one-to-one corresponding relationship between the name of the gateway and the name space; an associating unit, configured to associate the namespace with the K8s service and the Apollo service, respectively.
Based on the second aspect, in one possible design, the apparatus further includes: a route configuration request unit, configured to obtain a route configuration request of the gateway; the route configuration request comprises a route rule; a configuration unit, configured to invoke an interface of the Apollo configuration center, and configure the routing rule to the Apollo service; a control unit, configured to control the at least one K8s container to obtain the routing rule from the Apollo service.
In a third aspect, an embodiment of the present application provides a gateway management platform, including a processor and a memory connected to the processor, where a computer program is stored in the memory, and when the computer program is executed by the processor, the electronic device is caused to execute the method of the first aspect.
In a fourth aspect, an embodiment of the present application provides a storage medium, where a computer program is stored, and when the computer program is started on a computer, the computer is caused to execute the method of the first aspect.
Additional features and advantages of the present application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the embodiments of the present application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.
Fig. 1 is a schematic structural diagram of a gateway management platform provided in an embodiment of the present application.
Fig. 2 is a schematic flowchart of a management method of a gateway according to an embodiment of the present application.
Fig. 3 is a schematic diagram of an information configuration interface according to an embodiment of the present application.
Fig. 4 is a schematic diagram of a routing configuration interface according to an embodiment of the present application.
Fig. 5 is a schematic containerization diagram of a gateway according to an embodiment of the present application.
Fig. 6 is a schematic structural diagram of a management device of a gateway according to an embodiment of the present application.
Icon: 101-a processor; 102-a memory; 103-a communication interface; 600-management means of the gateway; 610-create request unit; 620-Apollo service creation unit; 630-a container creation unit; 640-container activation unit.
Detailed Description
The technical solution in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, it need not be further defined and explained in subsequent figures. Meanwhile, in the description of the present application, the terms "first", "second", and the like are used only for distinguishing the description, and are not to be construed as indicating or implying relative importance.
Kubernetes is K8s for short, and is an open-source Linux container automation operation and maintenance platform which eliminates many manual operations involved in the deployment and the scaling of containerized applications.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a gateway management platform according to an embodiment of the present application, where the gateway management platform may be composed of one, two, or more servers (servers are also referred to as nodes), and the gateway management platform is K8 s.
The gateway management platform comprises: a memory 102, a processor 101, a communication interface 103, and a communication bus for enabling connection communication of these components.
The Memory 102 is used for storing various data such as a computer program instruction corresponding to the gateway management method and apparatus provided in the embodiment of the present application, where the Memory 102 may be, but is not limited to, a random access Memory (ram), a Read Only Memory (ROM), a Programmable Read Only Memory (PROM), an Erasable Read Only Memory (EPROM), an electrically Erasable Read Only Memory (EEPROM), and the like.
The processor 101 is configured to read and run computer program instructions corresponding to the gateway management method and apparatus stored in the memory, so as to obtain a gateway creation request; the gateway establishing request comprises configuration information of the gateway; calling an interface of an Apollo configuration center, and establishing Apollo service for the gateway based on the configuration information; calling a K8s interface and creating at least one K8s container based on the Apollo service; and calling an interface of the Apollo service, starting the at least one K8s container, and obtaining at least one application instance.
The processor 101 may be an integrated circuit chip having signal processing capability. The Processor 101 may be a general-purpose Processor, including a central processing unit, a Network Processor (NP), and the like; but may also be a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Referring to fig. 2, fig. 2 is a flowchart of a method for managing a gateway according to an embodiment of the present application, where the method is applied to a gateway management platform shown in fig. 1, and the flow shown in fig. 2 will be described in detail below, where the method includes the steps of: S21-S24.
S21: acquiring a gateway establishing request; the gateway creation request includes configuration information of the gateway.
S22: and calling an interface of an Apollo configuration center, and establishing Apollo service for the gateway based on the configuration information.
S23: calling a K8s interface and creating at least one K8s container based on the Apollo service.
S24: calling an interface of the Apollo service, and starting the at least one K8s container, so that each K8s container in the at least one K8s container generates one application instance.
Compared with the related art, the method has the advantages that the starting script does not need to be configured for the application example, the operation steps are fewer, and new equipment does not need to be applied for the gateway, so the cost is reduced.
The above method is described in detail below.
S21: acquiring a gateway establishing request; the gateway creation request includes configuration information of the gateway.
Wherein the configuration information may include: the domain name of the gateway, the name of the gateway, status information and other description information, etc.
In an actual implementation, S21 may be implemented in such a way that the gateway creation request is obtained in real time or at irregular time (e.g., every set time duration, upon receiving an instruction, randomly, etc.).
As an embodiment, K8S described herein may be configured as a visualization platform, where S21 includes steps A1-A2.
A1: and when receiving the triggering operation of the user, displaying an information configuration interface.
In an actual implementation process, a1 may be implemented in such a manner that, when a trigger operation that a user selects a configuration icon through a mouse or a touch is received, a configuration interface is generated and displayed; the configuration icon is on a visual interface provided by the gateway management platform; in the embodiment, the configuration interface includes a configuration information table, a gateway adding button, a gateway search box, and the like, as shown in fig. 3.
After the configuration interface is presented, step A2 is performed.
A2: and receiving the configuration information input into the information configuration interface by the user.
In actual implementation, a2 may be implemented in such a way as to receive the configuration information input by the user into the configuration information table or the configuration information input box in real time.
As an embodiment, a2 may be implemented in such a way that, when a trigger operation of selecting an additional icon or completing an icon on the configuration interface by mouse or touch is received, configuration information input by a user into the configuration information table or the configuration information input box is received.
In a possible implementation manner, a user may select a gateway configuration on the visualization platform of K8s, and then pop up the configuration interface shown in fig. 3, after clicking a new gateway button, the user may add a new line in the configuration information table, and after inputting the name, domain name, service line, and running status of the gateway, the user may click a completion button (or icon) in the configuration interface, so as to implement entry of gateway configuration information.
After the configuration information is acquired, S22 is executed.
S22: and calling an interface of an Apollo configuration center, and establishing Apollo service for the gateway based on the configuration information.
In an actual implementation, S22 may be implemented by calling an interface of an Apollo configuration center, and creating an Apollo service for the gateway in the gateway management platform based on the configuration information, where it is understood that, when creating an Apollo service for the gateway, a unique interface (i.e., address) is configured for the Apollo service of the gateway, where different Apollo services have different interfaces; the configuration file of the Apollo service includes: the configuration information and an interface of the Apollo service. The specific implementation of creating the Apollo service is well known in the art, and therefore, will not be described herein.
After creating the Apollo service for the gateway, S23 is performed.
S23: calling a K8s interface and creating at least one K8s container based on the Apollo service.
In an actual implementation process, the S23 may be implemented by calling a K8S interface to sort load sizes of nodes in the gateway management platform, and based on the Apollo service, obtaining an interface of the Apollo service and the aforementioned configuration information from a configuration file of the Apollo service, and selecting at least one node with a smaller load in the gateway management platform, or randomly selecting at least one node in the gateway management platform, and then creating a K8S container on each node in the selected at least one node according to the configuration information of the gateway and the interface of the Apollo service; the number of K8s containers of the gateway is determined by RD (Research and Development engineer) and QA (Quality Assurance) according to service traffic access volume.
It should be noted that, when creating the K8s container for the gateway, a unique Internet Protocol (IP) address, that is, an address (i.e., an IP address) of the K8s container, is configured for each K8s container of the gateway, and the IP addresses of the K8s containers are different; the configuration file of each K8s container includes: the aforementioned configuration information, the interface of the Apollo service, and the IP address of the corresponding K8s container.
The specific implementation of creating the K8s container is well known in the art, and therefore, will not be described herein.
After creating the Apollo service and K8S container for the gateway, S24 is performed.
S24: calling an interface of the Apollo service, and starting the at least one K8s container, so that each K8s container in the at least one K8s container generates one application instance.
In an actual implementation process, the S24 may be implemented by calling an interface of the Apollo service, and starting the at least one K8S container, so that each K8S container generates an application instance based on configuration information in its own configuration file; wherein a K8s container generates an application instance.
As an embodiment, before S22, the method further includes: and analyzing the gateway establishing request and storing the configuration information.
Specifically, after the gateway creation request is acquired, the gateway creation request is analyzed according to the data format of the gateway creation request to obtain configuration information, and the configuration information is stored.
The storage location may be a storage space preset in K8s, or may be a cloud storage space or other storage space in communication connection, which is not described herein again.
As an embodiment, the method further comprises the steps of: B1-B2.
B1: acquiring a gateway modification request; the gateway modification request comprises modification configuration information of the gateway.
In actual implementation, B1 may be implemented as follows, and the gateway modification request is obtained in real time or not.
As an embodiment, B1 may be implemented in such a way that, when a trigger operation of a user is received, the information configuration interface is presented; the information configuration interface comprises: configuration information of the gateway; receiving the modification configuration information input into the gateway in the information configuration interface by the user.
B2: modifying configuration information for the gateway based on the Apollo service's interface and the modified configuration information.
In an actual real-time process, B2 may be implemented in such a manner that the gateway modification request is parsed to obtain modified configuration information, and the configuration information in the configuration files of the Apollo service and the at least one K8s container is modified based on the interface of the Apollo service and the modified configuration information, so that the configuration information in the modified configuration files of the Apollo service and the at least one K8s container are both the modified configuration information.
As an embodiment, after B1, the method further comprises: and modifying the pre-stored configuration information of the gateway based on the modified configuration information.
As an embodiment, the method further comprises steps C1-C2.
C1: acquiring a gateway query request; the gateway query request comprises keyword information.
The keyword information may be a name of a gateway, a domain name, a service line name, or the like.
In practical implementation, C1 may be implemented as follows, and the query request of the gateway is obtained in real time or not.
As an embodiment, C1 may be implemented in such a manner that, when a trigger operation of a user is received, the information configuration interface is presented; and receiving keyword information input into the information configuration interface by the user.
C2: and displaying the configuration information of the gateway corresponding to the keyword information.
In an actual implementation process, C2 may be implemented in such a manner that the query request is parsed to obtain keyword information, and then configuration information of a gateway corresponding to the keyword information is queried and presented.
As an embodiment, the method further comprises steps D1-D2.
D1: obtaining an initial IP address of the at least one K8s container.
In practical implementation, B2 may be implemented in such a way that the configuration file of at least one K8s container of the gateway is parsed to obtain the initial IP address of the at least one K8s container. Wherein the initial IP address of the K8s container is the IP address assigned to the K8s container when the K8s container was created.
After acquiring the initial IP addresses of the respective k8s containers of the gateway, step D2 is performed.
D2: calling the K8s interface and creating a K8s service for the gateway based on the initial IP address of the at least one K8s container.
In an actual implementation process, D1 may be implemented by calling the K8s interface, and creating a K8s service for the gateway in a gateway management platform based on the initial IP address of the at least one K8s container, where it is understood that, when creating the K8s service for the gateway, an IP address, that is, an IP address of the K8s service, is allocated to the K8s service, and then, the IP address of the K8s service and the initial IP address of the at least one K8s container are written in a configuration file of the K8s service of the gateway.
The specific implementation of creating the K8s service is well known in the art, and therefore, will not be described herein.
After the K8s container is started, the IP address of the K8s container may change constantly, for example, when the container runs wrong (Java code changes, errors), goes down, etc. Thus, as an embodiment, after step D2, the method further includes steps D3-D4.
D3: obtaining a current IP address of the at least one k8s container.
In practical implementation, the D2 may be implemented in such a way that the configuration file of the at least one K8s container of the gateway is parsed in real time or non-real time when the at least one K8s container is restarted, so as to obtain the current IP address of the at least one K8s container.
After acquiring the current IP address of each K8s container of the gateway, step D3 is performed.
D3: updating the pre-stored IP address of the at least one K8s container in the K8s service with the current IP address of the at least one K8s container.
In an actual implementation process, D3 may be implemented as follows, obtaining a predetermined IP address of the K8s service, or obtaining an IP address of the K8s service from a configuration file of the K8s service, and sending a current IP address of each K8s container of the gateway to the K8s service, so that the K8s service replaces IP addresses of all K8s containers corresponding to the gateway, which are stored in the K8s service in advance, with the current IP address of each K8s container of the gateway.
As an embodiment, for each K8s container of the at least one K8s container, upon determining that the current IP address of the K8s container is different from the IP address of the K8s container acquired last time, sending the current IP address of each K8s container of the gateway to the K8s service.
In the implementation process, the current IP address of each K8s container of the gateway is sent to the K8s service, so that after the IP address of the K8s container of the gateway changes, the traffic required to be forwarded to the gateway can be accurately forwarded to the gateway.
If the configuration information includes the name of the gateway, as an embodiment, the method further includes steps E1-E3.
E1: and calling the K8s interface to create a namespace for the gateway.
In an actual implementation process, the E1 may be implemented in a manner that calls the K8s interface to create a namespace for the gateway in the gateway management platform, where a specific implementation manner of creating the namespace is well known in the art, and therefore, details are not described here.
After a namespace has been created for the gateway, step E2 is performed.
E2: and establishing a one-to-one correspondence relationship between the gateway name and the name space.
In an actual implementation process, E2 may be implemented as follows, in which a name of the gateway is extracted from configuration information, and then a one-to-one correspondence between the name of the gateway and the namespace is established.
E3: associating the namespaces with the K8s service and the Apollo service, respectively.
In an actual implementation process, E3 may be implemented in such a manner that a configuration file of the K8s service is parsed to obtain an IP address of the K8s service, and then a corresponding relationship between the namespace and the IP address of the K8s service and the interface of the Apollo service is established according to the IP address of the K8s service and the interface of the Apollo service.
As an embodiment, the method further comprises steps F1-F3.
F1: acquiring a route configuration request of the gateway; the route configuration request comprises route configuration information of the gateway; the routing configuration information includes routing rules.
Wherein the routing rule comprises: a routing filter.
The routing rule further comprises: an identification of a route, a service name, a uniform resource locator of a service, a routing assertion, a creation priority of a routing rule of the gateway, and the like.
The routing configuration information may further include: a name of the gateway, a domain name of the gateway, or a creation priority of a routing rule of the gateway.
In practical implementation, F1 may be implemented in such a way as to obtain the route configuration request of the gateway in real time or non-timely.
As an embodiment, step F1 includes the steps of: F11-F12.
F11: and when receiving the triggering operation of the user, displaying a routing information configuration interface.
In an actual implementation process, a1 may be implemented in such a manner that, when a trigger operation that a user selects a routing configuration icon through a mouse or a touch is received, a routing configuration interface is generated and displayed, as shown in fig. 4; the routing configuration icon is on a visual interface provided by the gateway management platform.
After the configuration interface is presented, step A2 is performed.
F12: receiving the routing configuration information input into the routing configuration interface by the user.
In practical implementation, F12 may be implemented in such a way as to receive, in real time, the route configuration information input into the route configuration interface by the user.
As an embodiment, F12 may be implemented in such a way that, when receiving a trigger operation of selecting a create icon on the routing configuration interface by mouse or touch, it receives routing configuration information input into the routing configuration interface by the user.
After the route configuration information is acquired, step F2 is performed.
F2: and configuring the routing rule into the Apollo service by calling an interface of the Apollo configuration center.
In an actual implementation process, D2 may be implemented in such a manner that the routing rule is extracted from the routing configuration information, and the routing rule is configured into the configuration file of the Apollo service according to a predetermined interface of the Apollo service by calling an interface of the Apollo configuration center.
As an implementation manner, when the routing configuration information further includes a name of the gateway, F2 may be implemented as follows, where the name of the gateway and the routing rule are extracted from the routing configuration information, then a namespace corresponding to the name of the gateway is determined according to the name of the gateway, then a corresponding interface of an Apollo service is determined according to the corresponding namespace, and thus the routing rule is configured into a configuration file of the Apollo service according to the corresponding interface of the Apollo service by calling the interface of the Apollo configuration center.
As an implementation manner, when the routing configuration information further includes a domain name of the gateway, F2 may be implemented as follows, where the domain name of the gateway and the routing rule are extracted from the routing configuration information, the domain name of the gateway is analyzed to obtain a name of the gateway, a namespace corresponding to the name of the gateway is determined according to the name of the gateway, and a corresponding interface of an Apollo service is determined according to the corresponding namespace, so that the routing rule is configured in a configuration file of the Apollo service according to the corresponding interface of the Apollo service by calling the interface of the Apollo configuration center.
As an implementation manner, when the routing configuration information further includes a creation priority of the routing rule, F2 may be implemented in a manner that extracts the routing rule and the creation priority of the routing rule from the routing configuration information, calls an interface of the Apollo configuration center, and configures the routing rule into a configuration file of the Apollo service according to an interface of the Apollo service and the creation priority.
After configuring the routing rule into the Apollo service, step D3 is performed.
D3: controlling the at least one K8s container to obtain the routing rule from the Apollo service.
Controlling the at least one K8s container to obtain the routing rule from the configuration file of the Apollo service in real time or on an untimed basis based on the interface of the Apollo service in the configuration file of the Apollo service.
As an embodiment, the method further comprises: receiving a disabling instruction of the gateway; and calling an interface of the Apollo service in response to the disabling instruction, and disabling the K8s container.
Wherein receiving a disabling instruction of the gateway includes: acquiring an editing instruction of a user for selecting an editing icon corresponding to the gateway on an information configuration interface; responding to the editing instruction, and setting the running state option of the gateway to be in a changeable state; and receiving the disabling instruction when receiving that a user selects a disabling option in the running state options of the gateway.
Wherein, the disabling instruction includes a name of the gateway or a domain name of the gateway.
As an embodiment, the disabling instruction includes: the name of the gateway, in response to the disabling instruction, disabling the application instance using the K8s container, including:
extracting the name of the gateway from the forbidding instruction, determining a corresponding name space according to the name of the gateway, then determining a corresponding interface of Apollo service according to the corresponding name space, calling the interface of the Apollo service, and forbidding each K8s container of the gateway.
As an embodiment, the disabling instruction further includes: the domain name of the gateway, in response to the disabling instruction, calls an interface of the Apollo service, and disables the K8s container, including:
extracting the domain name of the gateway from the forbidden instruction, analyzing the domain name of the gateway to obtain the name of the gateway, determining a corresponding name space according to the name of the gateway, and determining an interface of the Apollo service according to the corresponding name space, so as to call the interface of the Apollo service and forbid each K8s container of the gateway.
As an embodiment, the method further comprises: when the K8s service receives network traffic sent by Nignx, the network traffic is sent to the application instance of the gateway through the K8s service.
Specifically, the specific implementation manner of the application instance that the K8s service sends the network traffic to the gateway is as follows: the K8s service sends the network traffic to the application instance of the gateway according to the IP address of the K8s container in the configuration file of the K8s service.
If the configuration file of the K8s service includes IP addresses of at least two K8s containers, as an embodiment, the method further includes: when the K8s service receives network traffic sent by Nignx, the network traffic is sent to an application instance running in any one K8s container of at least two K8s containers through the K8s service.
Specifically, the specific implementation manner of the K8s service sending the network traffic to any one of the at least two application instances is: the K8s service randomly determines the IP address of a K8s container from the configuration file of the K8s service, and then sends the network traffic to the application instance running in the K8s container according to the IP address of the K8s container.
Referring to fig. 5, fig. 5 is a schematic view of a containerization gateway provided in this embodiment, as can be seen from fig. 3, a gateway management platform creates a K8s service for a gateway named xianzhi-gateway and a gateway named uqun-gateway on the platform, and each K8s service is in communication connection with Nignx, where two application instances corresponding to the gateway named xianzhi-gateway are respectively run in different K8s containers; the gateway named as uqun-gateway corresponds to two application instances, the two application instances respectively run in different K8s containers, and one container runs one application instance; after the network traffic is received by Nignx, the network traffic is analyzed by Nignx to obtain an IP address of a K8s service, and then the network traffic is forwarded to a corresponding K8s service according to the IP address of the K8s service, and the K8s service sends the network traffic to an application instance running in a K8s container according to the IP address of the K8s container in a configuration file of the K8s service.
Referring to fig. 6, fig. 6 is a block diagram of a management device 600 of a gateway according to an embodiment of the present application. The block diagram of fig. 6 will be explained, and the apparatus shown comprises:
a creation request unit 610, configured to obtain a gateway creation request; the gateway creation request includes configuration information of the gateway.
An Apollo service creation unit 620, configured to invoke an interface of an Apollo configuration center, and create an Apollo service for the gateway based on the configuration information.
A container creating unit 630, configured to invoke the K8s interface, and create at least one K8s container based on the Apollo service.
A container starting unit 640, configured to invoke the interface of the Apollo service, and start the at least one K8s container, so that each K8s container in the at least one K8s container generates an application instance.
As an embodiment, the apparatus further comprises: a modification request unit, configured to obtain a gateway modification request; the gateway modification request comprises modification configuration information of the gateway; and the modifying unit is used for modifying the configuration information of the gateway based on the interface of the Apollo service and the modified configuration information.
As an embodiment, the apparatus further comprises: the query unit is used for acquiring a gateway query request; the gateway query request comprises keyword information; and the display unit is used for displaying the configuration information of the gateway corresponding to the keyword information.
As an embodiment, the creation request unit 610 includes: the interface display unit is used for displaying the information configuration interface when receiving the triggering operation of a user; and the information receiving unit is used for receiving the configuration information input into the information configuration interface by the user.
As an embodiment, the apparatus further comprises: an IP address obtaining unit, configured to obtain an initial IP address of the at least one k8s container; a K8s service creation unit for invoking the K8s interface and creating a K8s service for the gateway based on the initial IP address of the at least one K8s container.
As an embodiment, the configuration information includes a name of the gateway; the device further comprises: the namespace creating unit is used for calling the K8s interface and creating a namespace for the gateway; the relationship establishing unit is used for establishing the one-to-one corresponding relationship between the name of the gateway and the name space; an associating unit, configured to associate the namespace with the K8s service and the Apollo service, respectively.
As an embodiment, the apparatus further comprises: a route configuration request unit, configured to obtain a route configuration request of the gateway; the route configuration request comprises a route rule; a configuration unit, configured to invoke an interface of the Apollo configuration center, and configure the routing rule to the Apollo service; a control unit, configured to control the at least one K8s container to obtain the routing rule from the Apollo service.
Please refer to the contents described in the embodiments shown in fig. 2 to 5 for the process of implementing each function by each functional unit in this embodiment, which is not described herein again.
In addition, an embodiment of the present application further provides a storage medium, in which a computer program is stored, and when the computer program is started on a computer, the computer is caused to execute the method provided in any embodiment of the present application.
To sum up, according to the management method, the management device, the gateway management platform, and the storage medium for the gateway provided in the embodiments of the present application, after acquiring the configuration information, the method calls an interface of an Apollo configuration center, creates an Apollo service for the gateway based on the configuration information, then calls a K8s interface, and creates at least one K8s container based on the Apollo service, and it can be understood that a configuration file of each K8s container includes an interface of the Apollo service; the method comprises the steps of calling an interface of the Apollo service, starting at least one K8s container, enabling each K8s container in the at least one K8s container to generate an application instance, and achieving creation of a gateway.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The apparatus embodiments described above are merely illustrative, and for example, the flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based devices that perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.

Claims (10)

1. A method for managing a gateway, the method comprising:
acquiring a gateway establishing request; the gateway establishing request comprises configuration information of the gateway;
calling an interface of an Apollo configuration center, and establishing Apollo service for the gateway based on the configuration information;
calling a K8s interface and creating at least one K8s container based on the Apollo service;
calling an interface of the Apollo service, and starting the at least one K8s container, so that each K8s container in the at least one K8s container generates one application instance.
2. The method of claim 1, further comprising:
acquiring a gateway modification request; the gateway modification request comprises modification configuration information of the gateway;
modifying configuration information for the gateway based on the Apollo service's interface and the modified configuration information.
3. The method of claim 1, further comprising:
acquiring a gateway query request; the gateway query request comprises keyword information;
and displaying the configuration information of the gateway corresponding to the keyword information.
4. The method of claim 1, wherein obtaining the gateway creation request comprises:
when receiving a trigger operation of a user, displaying an information configuration interface;
and receiving the configuration information input into the information configuration interface by the user.
5. The method of claim 1, further comprising:
acquiring an initial address of the at least one k8s container;
calling the K8s interface and creating a K8s service for the gateway based on the initial address of the at least one K8s container.
6. The method of claim 5, wherein the configuration information includes a name of the gateway; the method further comprises the following steps:
calling the K8s interface to create a namespace for the gateway;
establishing a one-to-one correspondence relationship between the name of the gateway and the name space;
associating the namespaces with the K8s service and the Apollo service, respectively.
7. The method according to any one of claims 1-6, further comprising:
acquiring a route configuration request of the gateway; the route configuration request comprises route configuration information of the gateway; the routing configuration information comprises routing rules;
calling an interface of the Apollo configuration center to configure the routing rule to the Apollo service;
controlling the at least one K8s container to obtain the routing rule from the Apollo service.
8. An apparatus for managing a gateway, the apparatus comprising:
a creation request unit, configured to acquire a gateway creation request; the gateway establishing request comprises configuration information of the gateway;
the Apollo service creating unit is used for calling an interface of an Apollo configuration center and creating Apollo service for the gateway based on the configuration information;
a container creating unit, configured to call a K8s interface, and create at least one K8s container based on the Apollo service;
a container starting unit, configured to invoke the interface of the Apollo service, and start the at least one K8s container, so that each K8s container in the at least one K8s container generates an application instance.
9. A gateway management platform comprising a memory and a processor, the memory having stored therein computer program instructions which, when read and initiated by the processor, perform the method of any one of claims 1-7.
10. A storage medium having stored thereon computer program instructions which, when read and activated by a computer, perform the method according to any one of claims 1 to 7.
CN202110709713.5A 2021-06-25 2021-06-25 Gateway management method, device, gateway management platform and storage medium Active CN113347043B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110709713.5A CN113347043B (en) 2021-06-25 2021-06-25 Gateway management method, device, gateway management platform and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110709713.5A CN113347043B (en) 2021-06-25 2021-06-25 Gateway management method, device, gateway management platform and storage medium

Publications (2)

Publication Number Publication Date
CN113347043A true CN113347043A (en) 2021-09-03
CN113347043B CN113347043B (en) 2022-11-22

Family

ID=77478735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110709713.5A Active CN113347043B (en) 2021-06-25 2021-06-25 Gateway management method, device, gateway management platform and storage medium

Country Status (1)

Country Link
CN (1) CN113347043B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422350A (en) * 2021-12-02 2022-04-29 阿里巴巴(中国)有限公司 Public cloud container instance creating method

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107947961A (en) * 2017-10-17 2018-04-20 上海数讯信息技术有限公司 Kubernetes Network Management System and method based on SDN
CN108255497A (en) * 2018-01-12 2018-07-06 新华三大数据技术有限公司 The dispositions method and device of a kind of application
CN108694117A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 The method and apparatus of management test environment based on container technique
CN108737215A (en) * 2018-05-29 2018-11-02 郑州云海信息技术有限公司 A kind of method and apparatus of cloud data center Kubernetes clusters container health examination
CN109032760A (en) * 2018-08-01 2018-12-18 北京百度网讯科技有限公司 Method and apparatus for application deployment
CN109062655A (en) * 2018-06-05 2018-12-21 腾讯科技(深圳)有限公司 A kind of containerization cloud platform and server
CN109995871A (en) * 2019-04-09 2019-07-09 苏州浪潮智能科技有限公司 A kind of Pod dispatching method and device
CN110995511A (en) * 2019-12-24 2020-04-10 邱瀚 Cloud computing operation and maintenance management method and device based on micro-service architecture and terminal equipment
CN111651523A (en) * 2020-05-29 2020-09-11 烽火通信科技股份有限公司 MySQL data synchronization method and system of Kubernetes container platform
CN111835862A (en) * 2020-07-22 2020-10-27 浪潮云信息技术股份公司 Method for realizing reference flow type deployment object storage back-end service
CN112286705A (en) * 2020-11-24 2021-01-29 四川长虹电器股份有限公司 Kubernetes-based container web service interface aggregation system
CN112702441A (en) * 2021-01-05 2021-04-23 南京领行科技股份有限公司 Container-based access data processing method, device and system and storage medium

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108694117A (en) * 2017-04-11 2018-10-23 北京京东尚科信息技术有限公司 The method and apparatus of management test environment based on container technique
CN107947961A (en) * 2017-10-17 2018-04-20 上海数讯信息技术有限公司 Kubernetes Network Management System and method based on SDN
CN108255497A (en) * 2018-01-12 2018-07-06 新华三大数据技术有限公司 The dispositions method and device of a kind of application
CN108737215A (en) * 2018-05-29 2018-11-02 郑州云海信息技术有限公司 A kind of method and apparatus of cloud data center Kubernetes clusters container health examination
CN109062655A (en) * 2018-06-05 2018-12-21 腾讯科技(深圳)有限公司 A kind of containerization cloud platform and server
CN109032760A (en) * 2018-08-01 2018-12-18 北京百度网讯科技有限公司 Method and apparatus for application deployment
CN109995871A (en) * 2019-04-09 2019-07-09 苏州浪潮智能科技有限公司 A kind of Pod dispatching method and device
CN110995511A (en) * 2019-12-24 2020-04-10 邱瀚 Cloud computing operation and maintenance management method and device based on micro-service architecture and terminal equipment
CN111651523A (en) * 2020-05-29 2020-09-11 烽火通信科技股份有限公司 MySQL data synchronization method and system of Kubernetes container platform
CN111835862A (en) * 2020-07-22 2020-10-27 浪潮云信息技术股份公司 Method for realizing reference flow type deployment object storage back-end service
CN112286705A (en) * 2020-11-24 2021-01-29 四川长虹电器股份有限公司 Kubernetes-based container web service interface aggregation system
CN112702441A (en) * 2021-01-05 2021-04-23 南京领行科技股份有限公司 Container-based access data processing method, device and system and storage medium

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
DONGGANG CAO等: "Cluster as a Service: A Resource Sharing Approach for Private Cloud", 《TSINGHUA SCIENCE AND TECHNOLOGY》 *
WEIXIN_44388301: "Spring Cloud 微服务与K8S的协作之道", 《HTTPS://BLOG.CSDN.NET/WEIXIN_44388301/ARTICLE/DETAILS/99575907》 *
富士康质检员张全蛋: "微服务在 k8s 中部署网关 Gateway 服务", 《HTTPS://BLOG.CSDN.NET/QQ_34556414/ARTICLE/DETAILS/117769688》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114422350A (en) * 2021-12-02 2022-04-29 阿里巴巴(中国)有限公司 Public cloud container instance creating method
CN114422350B (en) * 2021-12-02 2024-02-06 阿里巴巴(中国)有限公司 Public cloud container instance creation method

Also Published As

Publication number Publication date
CN113347043B (en) 2022-11-22

Similar Documents

Publication Publication Date Title
CN107896162B (en) Deployment method and device of monitoring system, computer equipment and storage medium
CN109189758B (en) Operation and maintenance flow design method, device and equipment, operation method, device and host
CN109614101B (en) Page generation method, system, device, computer equipment and storage medium
CN110147241A (en) Program configures update method, electronic device, computer equipment and storage medium
CN113141405B (en) Service access method, middleware system, electronic device, and storage medium
CN105893073A (en) Update method and system used for application program, and business server and pushing server used for updating application program
CN113366815A (en) Network resource request method, device, electronic equipment and storage medium
CN110826978A (en) Unified backlog processing method and device based on enterprise browser
CN113347043B (en) Gateway management method, device, gateway management platform and storage medium
CN114785685A (en) Software differential upgrading method and device, electronic equipment and readable storage medium
CN109145034A (en) Resource rendering method, device and terminal
CN111008254B (en) Object creation method, device, computer equipment and storage medium
CN105530323B (en) File upgrading method, related equipment and system
CN108804711B (en) Data processing method and device and computer readable storage medium
CN103034545B (en) Communication means between communications framework based on ACE and method and functional module
CN111338758A (en) Resource management method and device and electronic equipment
CN106528222A (en) Terminal device, and application downloading method and apparatus
CN114253441B (en) Method and device for enabling target function, storage medium and electronic device
CN113992622B (en) Multi-template aggregation message notification sending system and method based on unified model
CN108924270B (en) Method for updating terminal contact information, server and storage medium
CN117112654B (en) City data display method, device, computer equipment and storage medium
CN110278271B (en) Network request control method and device and terminal equipment
CN117742219A (en) Cross-domain control method, device, equipment and medium for digital quantity port
EP3555842A1 (en) Aggregation platform, requirement owner, and methods thereof
CN114048081A (en) VPN device testing method and device, electronic device and storage medium

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