CN116566984A - Routing information creation method and device of k8s container cluster and electronic equipment - Google Patents

Routing information creation method and device of k8s container cluster and electronic equipment Download PDF

Info

Publication number
CN116566984A
CN116566984A CN202310825996.9A CN202310825996A CN116566984A CN 116566984 A CN116566984 A CN 116566984A CN 202310825996 A CN202310825996 A CN 202310825996A CN 116566984 A CN116566984 A CN 116566984A
Authority
CN
China
Prior art keywords
envoy
service servers
agent
service
information
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
CN202310825996.9A
Other languages
Chinese (zh)
Other versions
CN116566984B (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.)
Huakong Tsingjiao Information Technology Beijing Co Ltd
Original Assignee
Huakong Tsingjiao Information Technology Beijing 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 Huakong Tsingjiao Information Technology Beijing Co Ltd filed Critical Huakong Tsingjiao Information Technology Beijing Co Ltd
Priority to CN202310825996.9A priority Critical patent/CN116566984B/en
Publication of CN116566984A publication Critical patent/CN116566984A/en
Application granted granted Critical
Publication of CN116566984B publication Critical patent/CN116566984B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/10015Access to distributed or replicated servers, e.g. using brokers
    • 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/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

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

Abstract

The application discloses a method, a device and an electronic device for creating routing information of a k8s container cluster, relates to the technical field of container clusters, and is used for deploying an Envoy agent on the k8s container cluster, wherein a middle platform and a plurality of service servers are deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds configuration information of the registered plurality of service servers, and the method comprises the following steps: sending a discovery request to a middle station; and receiving the route information of the plurality of service servers returned by the middle station, wherein the route information is created by the middle station based on the configuration information of the plurality of service servers, and the configuration information comprises the area of the container node where the service server is positioned. By adopting the scheme, the effective route information is created, so that the subsequent Envoy agent can forward the service request from the client to one of the service servers based on the route information, and the service request can be stably, quickly and effectively routed to the proper service server.

Description

Routing information creation method and device of k8s container cluster and electronic equipment
Technical Field
The present disclosure relates to the field of container clusters, and in particular, to a method and an apparatus for creating routing information of a k8s container cluster, and an electronic device.
Background
Kubernetes (k 8s for short) is an open-source container cluster management system. On the basis of the Docker technology (container virtualization technology), k8s provides a series of complete functions such as deployment operation, resource scheduling, service discovery, dynamic expansion and contraction for containerized services (also called applications), and the convenience of large-scale container cluster management can be improved.
In practical applications of the k8s container cluster, a plurality of service servers for a certain application domain are often deployed on the k8s container cluster, and are used for processing service requests from clients, for example, the service servers may be ES (search engine) servers, and are used for processing search requests from clients.
Since a plurality of service servers are deployed, when a service request from a client is received by a server, the service request needs to be routed to one of the service servers, so that the service server processes the service request.
Therefore, how to create effective routing information so as to stably, quickly and effectively route the service request to the appropriate service server is a problem to be solved in the art.
Disclosure of Invention
The embodiment of the application provides a method, a device and electronic equipment for creating routing information of a k8s container cluster, which are used for solving the problem of how to create effective routing information so as to stably, rapidly and effectively route a service request to a proper service server in the prior art.
The embodiment of the application provides a routing information creation method of a k8s container cluster, which is applied to an Envoy agent deployed on the k8s container cluster, wherein a middle platform and a plurality of service servers are also deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds configuration information of the registered plurality of service servers, and the method comprises the following steps:
sending a discovery request to the middle station;
and receiving the route information of the plurality of service servers returned by the middle station, wherein the route information is created by the middle station based on the configuration information of the plurality of service servers, and the configuration information comprises the area of the container node where the service server is located.
Further, the method further comprises the following steps:
when a service request sent by a client is received, selecting a service server for processing the service request from the plurality of service servers according to the routing information and a pre-configured routing rule;
and forwarding the service request to the selected service server according to the routing information.
Further, the intermediate station holds the address of the Envoy agent registered;
before the sending of the discovery request to the intermediate station, the method further comprises:
receiving middle station communication information sent by the middle station according to the address of the Envoy agent;
transmitting a xds address request to the intermediate station based on the intermediate station communication information;
receiving xds address of the middle station returned by the middle station;
the sending the discovery request to the middle station includes:
according to the received xds address, adopting xds protocol to send a discovery request to the middle station;
the receiving the route information of the plurality of service servers returned by the middle station comprises the following steps:
and receiving the route information of the plurality of service servers returned by the intermediate station by adopting a xds protocol.
The embodiment of the application provides a routing information creation method of a k8s container cluster, which is applied to a middle platform deployed on the k8s container cluster, wherein an Envoy agent and a plurality of service servers are also deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds the configuration information of the registered plurality of service servers, and the method comprises the following steps:
receiving a discovery request sent by the Envoy agent;
creating routing information of the plurality of service servers based on the configuration information of the plurality of service servers, wherein the configuration information comprises an area where a container node where the service server is located belongs;
and returning the route information of the service servers to the Envoy agent.
Further, before the creating the routing information of the plurality of service servers based on the configuration information of the plurality of service servers, the method further includes:
transmitting a configuration information acquisition request to the plurality of service servers by adopting a xds protocol;
and receiving the configuration information returned by the plurality of service servers by adopting a xds protocol.
Further, the intermediate station holds the address of the Envoy agent registered;
before the receiving the discovery request sent by the Envoy agent, the method further comprises:
sending middle station communication information to the Envoy agent according to the address of the Envoy agent;
receiving a xds address request sent by the Envoy agent based on the middle-stage communication information;
returning xds address of the staging platform to the Envoy agent;
the receiving the discovery request sent by the Envoy agent includes:
receiving a discovery request sent by the Envoy agent according to the received xds address by adopting xds protocol;
said returning said routing information of said plurality of service servers to said Envoy agent comprises:
and returning the routing information of the service servers to the Envoy proxy by adopting xds protocol.
The embodiment of the application also provides a routing information creation device of a k8s container cluster, which is applied to an Envoy agent deployed on the k8s container cluster, wherein a middle platform and a plurality of service servers are also deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds the configuration information of the registered plurality of service servers, and the device comprises:
the first message sending module is used for sending a discovery request to the middle station;
the first message receiving module is used for receiving the route information of the plurality of service servers returned by the middle station, wherein the route information is created by the middle station based on the configuration information of the plurality of service servers, and the configuration information comprises an area where a container node where the service server is located belongs.
Further, the method further comprises the following steps:
the server selection module is used for selecting a service server for processing the service request from the plurality of service servers according to the routing information and the pre-configured routing rule after receiving the service request sent by the client;
and the message sending module is further used for forwarding the service request to the selected service server according to the routing information.
Further, the intermediate station holds the address of the Envoy agent registered;
the first message receiving module is further configured to receive, before the first message sending module sends a discovery request to the intermediate station, intermediate station communication information sent by the intermediate station according to the address of the Envoy proxy;
the first message sending module is further configured to send a xds address request to the intermediate station based on the intermediate station communication information;
the first message receiving module is further configured to receive a xds address of the intermediate station returned by the intermediate station;
the first message sending module is specifically configured to send a discovery request to the intermediate station by adopting xds protocol according to the received xds address;
the first message receiving module is specifically configured to receive route information of the plurality of service servers returned by the intermediate station by adopting a xds protocol.
The embodiment of the application also provides a routing information creation device of a k8s container cluster, which is applied to a middle platform deployed on the k8s container cluster, wherein an Envoy agent and a plurality of service servers are deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds the configuration information of the registered plurality of service servers, and the device comprises:
the second message receiving module is used for receiving a discovery request sent by the Envoy agent;
a routing information creation module, configured to create routing information of the plurality of service servers based on the configuration information of the plurality of service servers, where the configuration information includes an area to which a container node where the service server is located belongs;
and the second message sending module is used for returning the route information of the service servers to the Envoy proxy.
Further, the second message sending module is further configured to send a configuration information acquisition request to the plurality of service servers by adopting a xds protocol;
and the second message receiving module is also used for receiving the configuration information returned by the plurality of service servers by adopting a xds protocol.
Further, the intermediate station holds the address of the Envoy agent registered;
the second message sending module is further configured to send, according to the address of the Envoy agent, the middle-station communication information to the Envoy agent before the second message receiving module receives the discovery request sent by the Envoy agent;
the second message receiving module is further configured to receive a xds address request sent by the Envoy agent based on the middle-stage communication information;
the second message sending module is further configured to return a xds address of the intermediate station to the Envoy agent;
the second message receiving module is specifically configured to receive a discovery request sent by the Envoy agent according to the received xds address by adopting xds protocol;
the second message sending module is specifically configured to return the routing information of the plurality of service servers to the Envoy proxy by adopting a xds protocol.
Embodiments of the present application also provide an electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the method for creating the routing information of the k8s container cluster applied to the Envoy agent is realized, or the method for creating the routing information of the k8s container cluster applied to the intermediate station is realized.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the method for creating the routing information of any k8s container cluster applied to the Envoy agent is realized, or the method for creating the routing information of any k8s container cluster applied to the middle platform is realized.
The embodiments of the present application also provide a computer program product containing instructions, which when executed on a computer, cause the computer to perform any of the above-described route information creation methods applied to k8s container clusters of an Envoy agent, or perform any of the above-described route information creation methods applied to k8s container clusters of a middlebox.
The beneficial effects of the application include:
in the method provided by the embodiment of the application, the middle station, the Envoy proxy and the plurality of service servers are deployed on the k8s container cluster, the Envoy proxy and the plurality of service servers are registered on the middle station, the middle station holds the configuration information of the registered plurality of service servers, the configuration information comprises the area of the container node where the service server is located, in the process of creating the routing information, the Envoy proxy sends a discovery request to the middle station, the middle station creates the routing information based on the configuration information of the plurality of service servers, and after receiving the discovery request, the routing information of the plurality of service servers is returned to the Envoy proxy, so that the creation of effective routing information is realized, and the subsequent Envoy proxy can forward the service request from the client to one of the service servers based on the routing information, thereby realizing stable, rapid and effective routing of the service request to the proper service server.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application. The objectives and other advantages of the application will be realized and attained by the structure particularly pointed out in the written description and claims thereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the application and are incorporated in and constitute a part of this specification, illustrate the application and together with the description serve to explain the embodiment of the application, and do not limit the application. In the drawings:
fig. 1 is a flowchart of a method for creating routing information of a k8s container cluster applied to an Enovy agent according to an embodiment of the present application;
fig. 2 is a flowchart of a method for creating routing information of a k8s container cluster applied to a middle station according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a system architecture including a central station, an Envoy agent, and a plurality of service servers according to an embodiment of the present application;
FIG. 4 is a flowchart of a method for creating routing information of a k8s container cluster according to an embodiment of the present application;
fig. 5 is one of schematic structural diagrams of a routing information creating apparatus applied to a k8s container cluster of an Enovy proxy according to an embodiment of the present application;
fig. 6 is a second schematic structural diagram of a routing information creating apparatus applied to a k8s container cluster of an Enovy proxy according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a routing information creating device applied to a k8s container cluster of a middle station according to an embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
In order to provide an implementation scheme capable of creating effective routing information so as to stably, quickly and effectively route a service request to a suitable service server, the embodiments of the present application provide a method, an apparatus and an electronic device for creating routing information of a k8s container cluster, and hereinafter, preferred embodiments of the present application will be described with reference to the accompanying drawings of the specification, where it should be understood that the preferred embodiments described herein are merely for illustrating and explaining the present application, and are not intended to limit the present application. And embodiments and features of embodiments in this application may be combined with each other without conflict.
The embodiment of the application provides a routing information creation method of a k8s container cluster, which is applied to an Envoy agent deployed on the k8s container cluster, wherein a middle platform and a plurality of service servers are also deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds configuration information of the registered plurality of service servers, as shown in fig. 1, and the method comprises the following steps:
step 11, sending a discovery request to a middle station;
and 12, receiving the route information of the plurality of service servers returned by the middle station, wherein the route information is created by the middle station based on the configuration information of the plurality of service servers, and the configuration information comprises the area of the container node where the service server is located.
Correspondingly, the embodiment of the application also provides a method for creating routing information of the k8s container cluster, which is applied to a middle station deployed on the k8s container cluster, wherein an Envoy proxy and a plurality of service servers are deployed on the k8s container cluster, the Envoy proxy and the plurality of service servers are registered on the middle station, and the middle station holds configuration information of the registered plurality of service servers, as shown in fig. 2, and the method comprises the following steps:
step 21, receiving a discovery request sent by an Envoy agent;
step 22, creating routing information of a plurality of service servers based on configuration information of the plurality of service servers, wherein the configuration information comprises an area where a container node where the service server is located;
step 23, returning the route information of a plurality of service servers to the Envoy proxy.
In the method provided by the embodiment of the application, the central station, the Envoy proxy and the plurality of service servers are deployed on the k8s container cluster, the Envoy proxy and the plurality of service servers are registered on the central station, the central station holds configuration information of the registered plurality of service servers, the configuration information comprises an area where a container node where the service server is located belongs, in the process of creating the routing information, the Envoy proxy sends a discovery request to the central station, the central station creates the routing information based on the configuration information of the plurality of service servers, and after receiving the discovery request, returns the routing information of the plurality of service servers to the Envoy proxy, so that the creation of effective routing information is realized, and further, the subsequent Envoy proxy can forward the service request from the client to one of the service servers based on the routing information, thereby realizing stable, rapid and effective routing of the service request to the proper service server.
The method and apparatus provided herein are described in detail with particular embodiments in conjunction with the accompanying drawings.
In this embodiment, a central station, an Envoy agent, and a plurality of service servers are deployed on a k8s container cluster, where the system structure of the system may be shown in fig. 3, where the service servers are deployed on Pod (container nodes) of the k8s container cluster, and different service servers may be deployed on different Pod, or may be deployed on the same Pod, that is, one service server may be deployed on one Pod, or may be deployed on a plurality of service servers. In practical applications, the business server may be a server for providing various business services, for example, an ES (search engine) server.
Envoy agents act as agents for multiple business servers, which can be deployed over k8s container clusters through YAML. As shown in fig. 3, a system may include multiple Envoy agents, e.g., one Envoy agent deployed per Region (Region), each Envoy agent responsible for the agents of multiple service servers within the Region.
The middle station can be used as a management end of the whole system, the Envoy agent and the service server are registered to the middle station after being started, the service server can be registered to the middle station through a starting script, and in the registration process, the middle station can be informed of the area (Region) of the container node where the service server is located so as to be used when the middle station subsequently creates the route information, and meanwhile, the address and the port of the service server are registered to the middle station. The address of the Envoy agent may be registered with the intermediate station via a configuration file for subsequent intermediate stations to send messages to the Envoy agent.
Based on the system structure shown in fig. 3 in the embodiment of the present application, the embodiment of the present application provides a method for creating routing information of a k8s container cluster, as shown in fig. 4, including:
and step 41, the middle station adopts xds protocol to send configuration information acquisition requests to a plurality of service servers.
In this step, the intermediate station sends a configuration information acquisition request for reading the configuration information of the service server, for example, the configuration information may be the configuration information stored in the configmap in advance.
The intermediate station may initiate xds a service, send a message using the xds protocol via xds a service, for example, in this step, may direct the address and port provided when the service server registers to xds a service, and send a configuration information acquisition request to the service server using the address and port of each service server by xds a service using the xds protocol.
Step 42, the middle station receives configuration information returned by the plurality of service servers by adopting xds protocol.
The configuration information returned by the plurality of service servers may include: protocols supported by the service server, resource restriction information, namespaces (namespaces), and the like.
In this embodiment of the present application, when a service server registers in a home node, the home node may also belong to the configuration information of the service server, where a container node where the service server is located belongs to (Region).
And 43, the middle station creates routing information of the plurality of service servers based on configuration information of the plurality of service servers, wherein the configuration information comprises an area of a container node where the service server is located.
Step 44, the intermediate station sends the intermediate station communication information to the Envoy agent according to the address of the Envoy agent.
In this step, the intermediate station body may send the intermediate station communication information to the upstream module of the Envoy proxy.
Step 45, after receiving the intermediate station communication information of the intermediate station, the Envoy agent transmits a xds address request to the intermediate station based on the intermediate station communication information.
Step 46, after receiving the xds address request, the intermediate station returns xds address of the intermediate station to the Envoy agent.
Step 47, the Envoy agent receives the xds address of the intermediate station, and then transmits a discovery request (discovery request) to the intermediate station according to the xds address by using xds protocol.
There is no strict order between steps 41-43 and steps 44-47.
And 48, after receiving the discovery request, the intermediate station returns the routing information of the service servers to the Envoy proxy by adopting a xds protocol.
The routing information of the plurality of service servers comprises information for configuration, such as resource information, addresses and the like of the service servers.
In this embodiment of the present application, after receiving the routing information of the plurality of service servers, the Envoy proxy may select, from the plurality of service servers, a service server for processing the service request according to the routing information and a pre-configured routing rule, after receiving a service request sent by the client (for example, the Envoy listenner module listens to the service request from the client); and forwarding the service request to the selected service server according to the routing information, thereby realizing stable, rapid and effective routing of the service request to the proper service server.
In this embodiment of the present application, the Envoy proxy is used as a proxy of the service server, where the routing rule may be configured in a configuration file, an API, etc., and the routing rule may be dynamically generated, and the routing rule may include a plurality of matching conditions and actions, such as a request header, a request parameter, a path, a weight, a load balancing policy, and so on.
Therefore, when the service server deployed on the k8s container cluster changes, for example, there is a newly added service server, or the registered service server logs off, by adopting the method provided by the embodiment of the application, the update of the routing information can be quickly realized, and the quick dynamic configuration update of the routing rule can also be realized.
In the embodiment of the application, in order to improve the stability and performance of the k8s container cluster, the same number of worker threads can be created according to the number of CPU cores of the physical machine where the Envoy agent is located, and all worker threads are simultaneously configured with a monitor (listenner) to monitor, so that the k8s container cluster consumes less resources and is more stable.
During operation of the Envoy Agent, the control plane components Pilot Agent and Sidecar-injection may be used to manage the operation state of the Envoy Agent. The Pilot Agent is responsible for managing the operation state of the Envoy Agent, and if the operation state of the Envoy Agent has a problem, the Envoy Agent is restarted; if the restart is still unable to solve the problem, an attempt may be made to schedule the Envoy agent to other environments. The Sidecar-injection may be responsible for the automatic injection of the Envoy agent.
Based on the same inventive concept, according to the method for creating routing information of the k8s container cluster applied to the Envoy agent provided in the foregoing embodiment of the present application, correspondingly, another embodiment of the present application further provides a device for creating routing information of the k8s container cluster, which is applied to the Envoy agent deployed on the k8s container cluster, where a middle platform and a plurality of service servers are further deployed on the k8s container cluster, where the Envoy agent and the plurality of service servers are registered on the middle platform, and the middle platform holds configuration information of the registered plurality of service servers, and a schematic structural diagram thereof is shown in fig. 5, and specifically includes:
a first message sending module 51, configured to send a discovery request to the intermediate station;
the first message receiving module 52 is configured to receive routing information of the plurality of service servers returned by the intermediate station, where the routing information is created by the intermediate station based on the configuration information of the plurality of service servers, and the configuration information includes an area where a container node where the service server is located belongs.
Further, as shown in fig. 6, the method further includes:
a server selection module 53, configured to, after receiving a service request sent by a client, select a service server for processing the service request from the plurality of service servers according to the routing information and a pre-configured routing rule;
the first message sending module 51 is further configured to forward the service request to the selected service server according to the routing information.
Further, the intermediate station holds the address of the Envoy agent registered;
the first message receiving module 52 is further configured to receive, before the first message sending module 51 sends a discovery request to the intermediate station, intermediate station communication information sent by the intermediate station according to the address of the Envoy proxy;
the first message sending module 51 is further configured to send a xds address request to the intermediate station based on the intermediate station communication information;
the first message receiving module 52 is further configured to receive a xds address of the intermediate station returned by the intermediate station;
the first message sending module 51 is specifically configured to send, according to the received xds address, a discovery request to the intermediate station by adopting xds protocol;
the first message receiving module 52 is specifically configured to receive route information of the plurality of service servers returned by the intermediate station using a xds protocol.
Based on the same inventive concept, according to the method for creating routing information of the k8s container cluster applied to the intermediate station provided in the foregoing embodiment of the present application, correspondingly, another embodiment of the present application further provides a device for creating routing information of the k8s container cluster, applied to the intermediate station deployed on the k8s container cluster, where an Envoy agent is further deployed on the k8s container cluster, and a plurality of service servers, where the Envoy agent and the plurality of service servers are registered on the intermediate station, and the intermediate station holds configuration information of the registered plurality of service servers, and a structural schematic diagram thereof is shown in fig. 7, and specifically includes:
a second message receiving module 71, configured to receive a discovery request sent by the Envoy agent;
a routing information creation module 72, configured to create routing information of the plurality of service servers based on the configuration information of the plurality of service servers, where the configuration information includes an area to which a container node where the service server is located belongs;
a second messaging module 73 for returning said routing information of said plurality of service servers to said Envoy agent.
Further, the second message sending module 73 is further configured to send a configuration information obtaining request to the plurality of service servers by adopting a xds protocol;
the second message receiving module 71 is further configured to receive the configuration information returned by the service servers using the xds protocol.
Further, the intermediate station holds the address of the Envoy agent registered;
the second message sending module 73 is further configured to send, before the second message receiving module 71 receives the discovery request sent by the Envoy agent, a middle station communication information to the Envoy agent according to the address of the Envoy agent;
the second message receiving module 71 is further configured to receive a xds address request sent by the Envoy agent based on the middle station communication information;
the second message sending module 73 is further configured to return the xds address of the intermediate station to the Envoy agent;
the second message receiving module 71 is specifically configured to receive a discovery request sent by the Envoy agent according to the received xds address by adopting xds protocol;
the second message sending module 73 is specifically configured to return the routing information of the plurality of service servers to the Envoy proxy using a xds protocol.
The functions of the above modules may correspond to the corresponding processing steps in the flow shown in fig. 1 to 4, and are not described herein.
The route information creation device of the k8s container cluster provided by the embodiment of the application can be realized by a computer program. It should be understood by those skilled in the art that the above-mentioned module division manner is only one of many module division manners, and if the module division is divided into other modules or not, it is within the scope of protection of the present application as long as the routing information creation apparatus of the k8s container cluster has the above-mentioned functions.
The present embodiments also provide an electronic device, as shown in fig. 8, including a processor 81 and a machine-readable storage medium 82, the machine-readable storage medium 82 storing machine-executable instructions executable by the processor 81, the processor 81 being caused by the machine-executable instructions to: the method for creating the routing information of the k8s container cluster applied to the Envoy agent is realized, or the method for creating the routing information of the k8s container cluster applied to the intermediate station is realized.
The embodiment of the application also provides a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and when the computer program is executed by a processor, the method for creating the routing information of any k8s container cluster applied to the Envoy agent is realized, or the method for creating the routing information of any k8s container cluster applied to the middle platform is realized.
The embodiments of the present application also provide a computer program product containing instructions, which when executed on a computer, cause the computer to perform any of the above-described route information creation methods applied to k8s container clusters of an Envoy agent, or perform any of the above-described route information creation methods applied to k8s container clusters of a middlebox.
The machine-readable storage medium in the electronic device may include random access Memory (Random Access Memory, RAM) or may include Non-Volatile Memory (NVM), such as at least one magnetic disk Memory. Optionally, the memory may also be at least one memory device located remotely from the aforementioned processor.
The processor may be a general-purpose processor, including a central processing unit (Central Processing Unit, CPU), a network processor (Network Processor, NP), etc.; but also digital signal processors (Digital Signal Processing, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
In this specification, each embodiment is described in a related manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for an apparatus, an electronic device, a computer readable storage medium, a computer program product embodiment, since it is substantially similar to a method embodiment, the description is relatively simple, and reference is made to the section description of a method embodiment for relevant points.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. 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.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (10)

1. A method for creating routing information of a k8s container cluster, applied to an Envoy agent deployed on the k8s container cluster, where a middle station and a plurality of service servers are also deployed on the k8s container cluster, where the Envoy agent and the plurality of service servers are registered on the middle station, and the middle station holds configuration information of the registered plurality of service servers, the method comprising:
sending a discovery request to the middle station;
and receiving the route information of the plurality of service servers returned by the middle station, wherein the route information is created by the middle station based on the configuration information of the plurality of service servers, and the configuration information comprises the area of the container node where the service server is located.
2. The method as recited in claim 1, further comprising:
when a service request sent by a client is received, selecting a service server for processing the service request from the plurality of service servers according to the routing information and a pre-configured routing rule;
and forwarding the service request to the selected service server according to the routing information.
3. The method of claim 1, wherein the staging platform holds an address of the Envoy agent registered;
before the sending of the discovery request to the intermediate station, the method further comprises:
receiving middle station communication information sent by the middle station according to the address of the Envoy agent;
transmitting a xds address request to the intermediate station based on the intermediate station communication information;
receiving xds address of the middle station returned by the middle station;
the sending the discovery request to the middle station includes:
according to the received xds address, adopting xds protocol to send a discovery request to the middle station;
the receiving the route information of the plurality of service servers returned by the middle station comprises the following steps:
and receiving the route information of the plurality of service servers returned by the intermediate station by adopting a xds protocol.
4. A method for creating routing information of a k8s container cluster, which is applied to a central station deployed on the k8s container cluster, wherein an Envoy agent and a plurality of service servers are also deployed on the k8s container cluster, the Envoy agent and the plurality of service servers are registered on the central station, and the central station holds configuration information of the registered plurality of service servers, the method comprising:
receiving a discovery request sent by the Envoy agent;
creating routing information of the plurality of service servers based on the configuration information of the plurality of service servers, wherein the configuration information comprises an area where a container node where the service server is located belongs;
and returning the route information of the service servers to the Envoy agent.
5. The method of claim 4, further comprising, prior to said creating routing information for said plurality of service servers based on said configuration information for said plurality of service servers:
transmitting a configuration information acquisition request to the plurality of service servers by adopting a xds protocol;
and receiving the configuration information returned by the plurality of service servers by adopting a xds protocol.
6. The method of claim 4, wherein the staging platform holds the address of the Envoy agent registered;
before the receiving the discovery request sent by the Envoy agent, the method further comprises:
sending middle station communication information to the Envoy agent according to the address of the Envoy agent;
receiving a xds address request sent by the Envoy agent based on the middle-stage communication information;
returning xds address of the staging platform to the Envoy agent;
the receiving the discovery request sent by the Envoy agent includes:
receiving a discovery request sent by the Envoy agent according to the received xds address by adopting xds protocol;
said returning said routing information of said plurality of service servers to said Envoy agent comprises:
and returning the routing information of the service servers to the Envoy proxy by adopting xds protocol.
7. A routing information creation apparatus of a k8s container cluster, applied to an Envoy agent disposed on the k8s container cluster, the k8s container cluster further having disposed thereon a middle station, and a plurality of service servers, the Envoy agent and the plurality of service servers each being registered on the middle station, the middle station having configuration information of the plurality of registered service servers, the apparatus comprising:
the first message sending module is used for sending a discovery request to the middle station;
the first message receiving module is used for receiving the route information of the plurality of service servers returned by the middle station, wherein the route information is created by the middle station based on the configuration information of the plurality of service servers, and the configuration information comprises an area where a container node where the service server is located belongs.
8. A routing information creation apparatus of a k8s container cluster, applied to a middle station disposed on the k8s container cluster, the k8s container cluster further having disposed thereon an Envoy agent, and a plurality of service servers, the Envoy agent and the plurality of service servers each being registered on the middle station, the middle station having configuration information of the plurality of registered service servers, the apparatus comprising:
the second message receiving module is used for receiving a discovery request sent by the Envoy agent;
a routing information creation module, configured to create routing information of the plurality of service servers based on the configuration information of the plurality of service servers, where the configuration information includes an area to which a container node where the service server is located belongs;
and the second message sending module is used for returning the route information of the service servers to the Envoy proxy.
9. An electronic device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: a method according to any one of claims 1-3, or a method according to any one of claims 4-6.
10. A computer readable storage medium, characterized in that the computer readable storage medium has stored therein a computer program which, when executed by a processor, implements the method of any of claims 1-3 or implements the method of any of claims 4-6.
CN202310825996.9A 2023-07-06 2023-07-06 Routing information creation method and device of k8s container cluster and electronic equipment Active CN116566984B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310825996.9A CN116566984B (en) 2023-07-06 2023-07-06 Routing information creation method and device of k8s container cluster and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310825996.9A CN116566984B (en) 2023-07-06 2023-07-06 Routing information creation method and device of k8s container cluster and electronic equipment

Publications (2)

Publication Number Publication Date
CN116566984A true CN116566984A (en) 2023-08-08
CN116566984B CN116566984B (en) 2023-09-12

Family

ID=87502162

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310825996.9A Active CN116566984B (en) 2023-07-06 2023-07-06 Routing information creation method and device of k8s container cluster and electronic equipment

Country Status (1)

Country Link
CN (1) CN116566984B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117155934A (en) * 2023-10-31 2023-12-01 北京比格大数据有限公司 Cross-cluster communication method and device, equipment and storage medium
CN117472638A (en) * 2023-12-27 2024-01-30 南京翼辉信息技术有限公司 Real-time container fault auxiliary positioning method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743261A (en) * 2019-01-07 2019-05-10 中国人民解放军国防科技大学 SDN-based container network resource scheduling method
CN110401696A (en) * 2019-06-18 2019-11-01 华为技术有限公司 A kind of method, communication agent, host and the storage medium of decentralization processing
US20210072966A1 (en) * 2019-09-05 2021-03-11 International Business Machines Corporation Method and system for service rolling-updating in a container orchestrator system
CN115495140A (en) * 2022-09-15 2022-12-20 鼎富智能科技有限公司 Service creation method and system based on k8s
CN116155903A (en) * 2023-01-04 2023-05-23 马上消费金融股份有限公司 Load balancing method, platform, electronic device and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109743261A (en) * 2019-01-07 2019-05-10 中国人民解放军国防科技大学 SDN-based container network resource scheduling method
CN110401696A (en) * 2019-06-18 2019-11-01 华为技术有限公司 A kind of method, communication agent, host and the storage medium of decentralization processing
US20210072966A1 (en) * 2019-09-05 2021-03-11 International Business Machines Corporation Method and system for service rolling-updating in a container orchestrator system
CN115495140A (en) * 2022-09-15 2022-12-20 鼎富智能科技有限公司 Service creation method and system based on k8s
CN116155903A (en) * 2023-01-04 2023-05-23 马上消费金融股份有限公司 Load balancing method, platform, electronic device and computer readable storage medium

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117155934A (en) * 2023-10-31 2023-12-01 北京比格大数据有限公司 Cross-cluster communication method and device, equipment and storage medium
CN117155934B (en) * 2023-10-31 2023-12-29 北京比格大数据有限公司 Cross-cluster communication method and device, equipment and storage medium
CN117472638A (en) * 2023-12-27 2024-01-30 南京翼辉信息技术有限公司 Real-time container fault auxiliary positioning method
CN117472638B (en) * 2023-12-27 2024-03-15 南京翼辉信息技术有限公司 Real-time container fault auxiliary positioning method

Also Published As

Publication number Publication date
CN116566984B (en) 2023-09-12

Similar Documents

Publication Publication Date Title
CN116566984B (en) Routing information creation method and device of k8s container cluster and electronic equipment
CN113746887A (en) Cross-cluster data request processing method, device and storage medium
US8738770B2 (en) Sending synchronous responses to requests from frontend applications
CN104601702B (en) Cluster remote procedure calling (PRC) method and system
US9390156B2 (en) Distributed directory environment using clustered LDAP servers
CN112187958A (en) Method and device for registering, discovering and forwarding microservice
CN109618003B (en) Server planning method, server and storage medium
CN111314241B (en) Task scheduling method and scheduling system
US9342291B1 (en) Distributed update service
US12021922B2 (en) Methods of operating service control nodes
CN112559461A (en) File transmission method and device, storage medium and electronic equipment
CN110138753B (en) Distributed message service system, method, apparatus, and computer-readable storage medium
US20200036661A1 (en) Increasing capacity in a topic-subscription messaging system
CN102724165A (en) Control method and device for terminal communication, and management server
US10701167B1 (en) Adaptive quorum for a message broker service
CN109688011B (en) Agent selection method and device based on OpenStack
CN111756800A (en) Method and system for processing burst flow
CN109375946B (en) Method and system for managing component package of node package manager
US20230146880A1 (en) Management system and management method
US20230102122A1 (en) Methods, systems, and computer readable media for identifying alternate delivery endpoints for mobile originated data and monitoring reports in a communications network
CN115225645A (en) Service updating method, device, system and storage medium
CN112702441B (en) Container-based access data processing method, device, system and storage medium
CN114827017A (en) Kafka cluster communication method and device, electronic equipment and storage medium
CN111309467B (en) Task distribution method and device, electronic equipment and storage medium
CN114024971A (en) Service data processing method, Kubernetes cluster and 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