Proxy service adding method, device, electronic device and storage medium
By obtaining the health status of the proxy service in the Kubernetes cluster and binding it to the local service, the problem of increased LocalDNS affecting the continuity of Pod applications is solved, and transparent service performance improvement is achieved.
Patent Information
- Application Number
- CN202211309963.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-25
- Publication Date
- 2025-09-19
- Estimated Expiration
- 2042-10-25
AI Technical Summary
When adding a LocalDNS resolution service to a Kubernetes cluster, existing technologies will affect the continuity of existing Pod applications and cause business interruptions.
LocalDNS is transparently added on the basis of CoreDNS. By obtaining the status of the proxy service and adding it to the sub-node in a healthy state, and binding it with the local service, service request processing is realized.
Without restarting the application, LocalDNS is transparently added, improving the service performance and availability of the Kubernetes cluster and avoiding business interruptions.
Smart Images

Figure CN115665240B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method, device, electronic device and storage medium for adding an agent service. Background Art
[0002] In a Kubernetes cluster, domain name resolution services are typically provided by components such as CoreDNS. This component not only provides domain name resolution services for Pods and Services within the cluster, but also forwards domain name requests from within the cluster to external domain name resolution servers (upstream DNS servers) outside the cluster, thereby achieving domain name resolution. However, using only CoreDNS can lead to the following two problems: 1) If the Kubernetes control plane node where CoreDNS is located fails, domain name resolution services will be unavailable. In a Kubernetes cluster, service names are a strong dependency for calls between services. This means that a CoreDNS exception can cause the entire Kubernetes cluster to be unavailable.
[0003] To improve the availability of the Kubernetes cluster's domain name resolution service and avoid the DNS resolution UnknownHost problem, you can add two types of plug-ins, LocalDNS and CoreDNS, to the cluster to solve the problem.
[0004] Existing technologies support configuring LocalDNS and CoreDNS together during initial configuration. Alternatively, adding LocalDNS to an existing CoreDNS configuration and then restarting existing Kubernetes pods to refresh and take effect in the / etc / resolve.conf file requires restarting the application pods, which undoubtedly affects the continuity of existing pods and is unacceptable in production environments. Therefore, how to add localDNS resolution without affecting the business continuity of existing applications in the Kubernetes cluster is an urgent problem. Summary of the Invention
[0005] The present invention provides a proxy service adding method, device, electronic device and storage medium to solve the problem in the prior art that adding localDNS affects the continuity of existing Pod applications. It realizes transparent addition of localDNS on the basis of existing CoreDNS, thereby achieving continuity without affecting existing Pod applications.
[0006] In a first aspect, an embodiment of the present invention provides a method for adding a proxy service, characterized in that it is applied to a cluster service platform, the cluster service platform including a master node and at least one sub-node; a local service is deployed in the master node; the method includes:
[0007] Obtaining the proxy service to be added and determining the service status of the proxy service;
[0008] When the proxy service is in a healthy state, adding the proxy service to the branch node;
[0009] A preset interface in the sub-node is added, and the proxy service of the sub-node is bound to the local service based on the preset interface, so that the proxy service can process the service request received by the sub-node.
[0010] Optionally, determining the service status of the proxy service includes:
[0011] Determine the local service deployed by the master node, and generate service resources corresponding to the local service;
[0012] A health check is performed on the proxy service to be added based on the service resources to determine the service status of the proxy service.
[0013] Optionally, adding the proxy service to the sub-node includes:
[0014] A preset daemon process set is obtained, and the proxy service is added to the sub-node based on the daemon process set.
[0015] Optionally, the adding of the preset interface in the sub-node includes:
[0016] The virtual network card added to the sub-node is obtained, and a preset interface in the sub-node is added based on the virtual network card.
[0017] Optionally, the binding the proxy service of the sub-node with the local service based on the preset interface includes:
[0018] Based on the preset interface, the proxy service address of the proxy service in the sub-node is associated with the local service address of the local service to achieve binding of the proxy service and the local service.
[0019] Optionally, the method further includes:
[0020] receiving a domain name resolution service request, and determining, based on the proxy service, whether the sub-node caches a resolution result corresponding to the domain name resolution service request;
[0021] If the sub-node has not cached the domain name resolution service request, sending the domain name resolution service request to the local service based on the proxy service, and determining whether the cluster service platform has cached the resolution result corresponding to the domain name resolution service request;
[0022] If the cluster service platform has no cache, the domain name resolution service request is sent to an upstream service outside the cluster service platform based on the proxy service to determine a resolution result corresponding to the domain name resolution service request.
[0023] Optionally, the proxy service sends the domain name resolution service request to the local service via the TCP transmission protocol, and the proxy service sends the domain name resolution service request to the upstream service via the UDP transmission protocol.
[0024] In a second aspect, an embodiment of the present invention further provides a proxy service adding device, the device comprising:
[0025] A service status determination module, configured to obtain the proxy service to be added and determine the service status of the proxy service;
[0026] An agent service adding module, configured to add the agent service to a subnode when the agent service is in a healthy state;
[0027] The proxy service binding module is used to add a preset interface in the sub-node and bind the proxy service of the sub-node with the local service based on the preset interface to enable the proxy service to process the service request received by the sub-node.
[0028] In a third aspect, an embodiment of the present invention further provides an electronic device, including:
[0029] at least one processor; and
[0030] a memory communicatively connected to the at least one processor; wherein,
[0031] The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor so that the at least one processor can execute the proxy service adding method according to any embodiment of the present invention.
[0032] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the proxy service adding method of any embodiment of the present invention when executed.
[0033] The technical solution of the embodiment of the present invention obtains the proxy service to be added and determines the service status of the proxy service; when the proxy service is in a healthy state, the proxy service is added to the sub-node; a preset interface is added in the sub-node, and the proxy service of the sub-node is bound to the local service based on the preset interface, so that the proxy service can process the service requests received by the sub-node. The above technical solution binds the added proxy service to the local service based on the service address, thereby processing the service request of the local service based on the proxy service without restarting the application, solving the problem of the existing technology that adding a proxy service affects the continuity of the cluster, and realizing transparently increasing the proxy continuity on the basis of the local service to improve the service performance of the cluster.
[0034] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0036] Figure 1 This is a flowchart of a method for adding a proxy service according to the first embodiment of the present invention;
[0037] Figure 2 This is a schematic diagram of the structure of a proxy service adding device provided in accordance with the third embodiment of the present invention;
[0038] Figure 3 The figure is a structural diagram of an electronic device for implementing the proxy service adding method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0039] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0040] It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and the accompanying drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or precedence. It should be understood that the terms used in this manner are interchangeable where appropriate, such that the embodiments of the present invention described herein can be practiced in an order other than that illustrated or described herein.
[0041] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0042] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0043] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0044] As an optional but non-limiting implementation, in response to receiving a user's active request, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. Furthermore, the pop-up window may also contain a selection control for the user to select "agree" or "disagree" to provide personal information to the electronic device.
[0045] It is understandable that the above notification and user authorization process are merely illustrative and do not limit the implementation of the present disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0046] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0047] Example 1
[0048] Figure 1 A flowchart of a proxy service adding method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of adding a proxy service to a service in a cluster. The method can be executed by a proxy service adding device. The proxy service adding device can be implemented in the form of hardware and / or software. The proxy service adding device can be configured in a cloud server. Figure 1As shown, the method includes:
[0049] S110: Acquire the proxy service to be added and determine the service status of the proxy service.
[0050] In the embodiments of the present invention, the cluster service platform can be understood as a Kubernetes cluster. This cluster includes multiple nodes. Specifically, only one of these nodes serves as the cluster master, executing cluster control commands. The other nodes serve as slave nodes. Upon receiving a service request from a slave node, they forward the request to the master node for processing.
[0051] In this embodiment, the local service deployed in the master node can be understood as the default CoreDNS in Kubernetes. Specifically, CoreDNS can provide domain name resolution services for the Kubernetes cluster. In actual application, CoreDNS not only provides domain name resolution services for Pods and Services within the cluster, but also forwards domain name requests within the cluster to domain name resolution servers outside the cluster (upstream dns servers), thereby achieving domain name resolution. However, using only CoreDNS will face the problem of the entire Kubernetes cluster being unable to provide services when CoreDNS is abnormal. Therefore, the technical solution of this embodiment adds a proxy service to each node of the cluster. Among them, the proxy service can be understood as LocalDNS deployed in each Node of the Kubernetes cluster to improve the DNS performance of the cluster.
[0052] In this embodiment, when a proxy service to be added is obtained, the service status of the proxy service needs to be determined in advance to ensure that it can provide corresponding services in the cluster service platform after being added. Optionally, the method for determining the service status of the proxy service in this embodiment may include: determining the local service deployed by the master node and generating service resources corresponding to the local service; and performing a health check on the proxy service to be added based on the service resources to determine the service status of the proxy service.
[0053] Specifically, the CoreDNS deployed in the Master node within the Kubernetes cluster is identified, and a new Service is created for the CoreDNS. A new Service IP is assigned to the Service. This new Service IP is inconsistent with the Service Cluster IP of other existing Services in the CoreDNS, so as to distinguish existing Services in CoerDNS from new Services. Furthermore, the corresponding Service is determined based on the new Service IP, and a health check is performed on the obtained LocalDNS based on the Service to determine the service status of the LocalDNS.
[0054] S120: When the proxy service is in a healthy state, add the proxy service to the sub-node.
[0055] In this embodiment of the present invention, the service status of the proxy service includes normal status and abnormal status. If the LocalDNS is determined to be in a healthy state, it can be directly added to the Kubernetes cluster. Conversely, if the LocalDNS is in an abnormal state, it needs to be restarted first. After it is in a healthy state, it can be added to the Kubernetes cluster, thereby ensuring that the LocalDNS added to the Kubernetes cluster can directly provide the corresponding services.
[0056] Optionally, when the proxy service is determined to be in a healthy state, it is added to a sub-node of the cluster service platform. Optionally, the method of adding the proxy service to the sub-node may include: obtaining a preset daemon process set, and adding the proxy service to the sub-node based on the daemon process set.
[0057] The daemon set can be understood as a preset DaemonSet. Specifically, LocalDNS is deployed in the Kubernetes cluster using DaemonSet.
[0058] It should be noted that, based on the number of each sub-node, multiple proxy services to be added can be obtained, and when the health status of each proxy service is determined, each proxy service can be added to each sub-node to increase the service performance of the cluster service platform.
[0059] S130: Add a preset interface in the sub-node, and bind the proxy service of the sub-node to the local service based on the preset interface.
[0060] In an embodiment of the present invention, in order for the proxy service in each subnode to process service requests within the node, each proxy service must be pre-bound to a local service in the master node. Optionally, the method for binding services in this embodiment may include associating a proxy service address of the proxy service in the subnode with a local service address of the local service based on a preset interface to achieve binding of the proxy service and the local service.
[0061] Specifically, taking the binding of the proxy service of any sub-node in this embodiment to the local service as an example, the preset interface in the current sub-node, such as interface 53, is started. Based on the started interface 53, the service IP of the localDNS in the current decomposition point is set to the same IP as the old CoreDNS Service, so that the domain name resolution request received at the current sub-node is changed from the original CoreDNS processing to LocalDNS processing, thereby realizing the addition of localDNS resolution without restarting, so that this change is transparent to existing applications in the production environment.
[0062] Optionally, in this embodiment, before binding the proxy service of the current subnode with the local service, it is necessary to pre-add a preset interface to the current subnode. Optionally, the method for adding the preset interface in this embodiment may include: obtaining a virtual network card added to the subnode, and adding the preset interface to the subnode based on the virtual network card.
[0063] Specifically, for the current node, execute the ip link add command in the node to add a virtual network card. After the virtual network card is added, create a network interface based on the added virtual network card. Optionally, name the created interface "interface 53" to facilitate service binding based on the interface.
[0064] Based on the above-mentioned implementation mode, the technical solution of the present invention also includes receiving a domain name resolution service request, and determining whether the sub-node caches the resolution result corresponding to the domain name resolution service request based on the proxy service; if the sub-node does not cache, the domain name resolution service request is sent to the local service based on the proxy service, and it is determined whether the cluster service platform caches the resolution result corresponding to the domain name resolution service request; if the cluster service platform does not cache, the domain name resolution service request is sent to an upstream service outside the cluster service platform based on the proxy service to determine the resolution result corresponding to the domain name resolution service request.
[0065] Among them, the domain name resolution service can be based on the task request received by any sub-node. In actual applications, when a sub-node receives a domain name resolution request, it will first perform a resolution judgment through the LocalDNS of the current sub-node. If there is a cache in the current sub-node, the domain name resolution result will be returned immediately. If the current sub-node does not find the cache, it will be forwarded according to the domain name ownership. If the domain name belongs to the Kubernetes cluster, the domain name request will be forwarded to CoreDNS, and CoreDNS will perform domain name resolution; if the domain name belongs to outside the Kubernetes cluster, CoreDNS will be skipped and the domain name request will be forwarded directly to the upstream DNS Server outside Kubernetes, thereby realizing the domain name resolution method of collaboration between LocalDNS and CoreDNS.
[0066] Optionally, in the technical solution implemented in this embodiment, when forwarding the domain name resolution request, the proxy service sends the domain name resolution service request to the local service through the TCP transmission protocol, and the proxy service sends the domain name resolution service request to the upstream service through the UDP transmission protocol.
[0067] Specifically, in LocalDNS, you can use ConfigMaps to set up cache and upstream services (forwarding) for domain names within the Kubernetes cluster and for domain names outside the cluster. Specifically, for domain name requests within the Kubernetes cluster, you can set the forwarding direction to the new CoreDNS ServiceIP and enforce TCP connections between LocalDNS and CoreDNS. This effectively avoids packet loss and significantly improves the availability of the Kubernetes cluster's domain name service. For domain name requests outside the Kubernetes cluster, you can set the forwarding direction to an external DNS server.
[0068] The technical solution of the embodiment of the present invention obtains the proxy service to be added and determines the service status of the proxy service; when the proxy service is in a healthy state, the proxy service is added to the sub-node; a preset interface is added in the sub-node, and the proxy service of the sub-node is bound to the local service based on the preset interface, so that the proxy service can process the service requests received by the sub-node. The above technical solution binds the added proxy service to the local service based on the service address, thereby processing the service request of the local service based on the proxy service without restarting the application, solving the problem of the existing technology that adding a proxy service affects the continuity of the cluster, and realizing transparently increasing the proxy continuity on the basis of the local service to improve the service performance of the cluster.
[0069] Example 2
[0070] Figure 2 This is a schematic diagram of the structure of a proxy service adding device provided by the second embodiment of the present invention. Figure 2 As shown, the device includes: a service status determination module 210, a proxy service adding module 220 and a proxy service binding module 230; wherein,
[0071] The service status determination module 210 is used to obtain the proxy service to be added and determine the service status of the proxy service;
[0072] The proxy service adding module 220 is used to add the proxy service to the subnode when the proxy service is in a healthy state;
[0073] The proxy service binding module 230 is used to add a preset interface in the subnode and bind the proxy service of the subnode with the local service based on the preset interface, so that the proxy service can process the service request received by the subnode.
[0074] Based on the embodiment of the present invention, optionally, the service status determination module 210 includes:
[0075] A service resource generation unit, configured to determine a local service deployed by the master node and generate service resources corresponding to the local service;
[0076] The service status determining unit is configured to perform a health check on the proxy service to be added based on the service resources to determine the service status of the proxy service.
[0077] Based on the embodiment of the present invention, optionally, the proxy service adding module 220 includes:
[0078] The proxy service adding unit is used to obtain a preset daemon process set and add the proxy service to the sub-node based on the daemon process set.
[0079] Based on the embodiment of the present invention, optionally, the proxy service binding module 230 includes:
[0080] The preset interface adding unit is used to obtain the virtual network card added to the sub-node, and add the preset interface in the sub-node based on the virtual network card.
[0081] Based on the embodiment of the present invention, optionally, the proxy service binding module 230 includes:
[0082] The proxy service binding unit is configured to associate the proxy service address of the proxy service in the sub-node with the local service address of the local service based on the preset interface, so as to bind the proxy service with the local service.
[0083] Based on the embodiment of the present invention, optionally, the device further includes:
[0084] a first resolution result determination unit, configured to receive a domain name resolution service request and determine, based on the proxy service, whether the sub-node caches a resolution result corresponding to the domain name resolution service request;
[0085] a second resolution result determination unit, configured to, if the sub-node has not cached the domain name resolution service request, send the domain name resolution service request to the local service based on the proxy service, and determine whether the cluster service platform has cached the resolution result corresponding to the domain name resolution service request;
[0086] The third resolution result judgment unit is configured to send the domain name resolution service request to an upstream service outside the cluster service platform based on the proxy service if the cluster service platform has not cached the domain name resolution service request, so as to determine the resolution result corresponding to the domain name resolution service request.
[0087] Based on the embodiment of the present invention, optionally, the proxy service sends the domain name resolution service request to the local service through the TCP transmission protocol, and the proxy service request sends the domain name resolution service request to the upstream service through the UDP transmission protocol.
[0088] The proxy service adding device provided in the embodiment of the present invention can execute the proxy service adding method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.
[0089] Example 3
[0090] Figure 3 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or claimed herein.
[0091] like Figure 3As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., which is communicatively connected to the at least one processor 11. The memory stores a computer program that can be executed by the at least one processor. The processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 into the random access memory (RAM) 13. Various programs and data required for the operation of the electronic device 10 can also be stored in the RAM 13. The processor 11, ROM 12, and RAM 13 are connected to each other via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0092] Multiple components in the electronic device 10 are connected to the I / O interface 15, including an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a magnetic disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.
[0093] The processor 11 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various specialized artificial intelligence (AI) computing chips, various processors that run machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the agent service addition method.
[0094] In some embodiments, the proxy service adding method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the proxy service adding method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the proxy service adding method in any other suitable manner (e.g., via firmware).
[0095] Various embodiments of the systems and techniques described herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0096] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0097] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0098] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0099] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0100] A computing system may include clients and servers. The clients and servers are typically remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within the cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS services.
[0101] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.
[0102] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A method for adding a proxy service, characterized in that: Applied to a cluster service platform, the cluster service platform includes a master node and at least one sub-node; The local service is deployed in the master node; the method includes: Obtaining the proxy service to be added and determining the service status of the proxy service; When the proxy service is in a healthy state, adding the proxy service to the branch node; Adding a preset interface in the subnode, and binding the proxy service of the subnode with the local service based on the preset interface, so that the proxy service can process the service request received by the subnode; The binding of the proxy service of the sub-node with the local service based on the preset interface includes: Based on the preset interface, the proxy service address of the proxy service in the sub-node is associated with the local service address of the local service to achieve binding of the proxy service and the local service.
2. The method according to claim 1, characterized in that Determining the service status of the proxy service includes: Determine the local service deployed by the master node, and generate service resources corresponding to the local service; A health check is performed on the proxy service to be added based on the service resources to determine the service status of the proxy service.
3. The method according to claim 1, characterized in that Adding the proxy service to the sub-node includes: A preset daemon process set is obtained, and the proxy service is added to the sub-node based on the daemon process set.
4. The method according to claim 1, wherein The adding of the preset interface in the sub-node includes: The virtual network card added to the sub-node is obtained, and a preset interface in the sub-node is added based on the virtual network card.
5. The method according to claim 1, wherein The method further comprises: receiving a domain name resolution service request, and determining, based on the proxy service, whether the sub-node caches a resolution result corresponding to the domain name resolution service request; If the sub-node has not cached the domain name resolution service request, sending the domain name resolution service request to the local service based on the proxy service, and determining whether the cluster service platform has cached the resolution result corresponding to the domain name resolution service request; If the cluster service platform has no cache, the domain name resolution service request is sent to an upstream service outside the cluster service platform based on the proxy service to determine a resolution result corresponding to the domain name resolution service request.
6. The method according to claim 5, characterized in that The proxy service sends the domain name resolution service request to the local service via the TCP transmission protocol, and the proxy service sends the domain name resolution service request to the upstream service via the UDP transmission protocol.
7. A proxy service adding device, characterized in that: include: A service status determination module, configured to obtain the proxy service to be added and determine the service status of the proxy service; An agent service adding module, configured to add the agent service to a subnode when the agent service is in a healthy state; A proxy service binding module, configured to add a preset interface in the sub-node and bind the proxy service of the sub-node to the local service based on the preset interface, so that the proxy service can process the service request received by the sub-node; The proxy service binding module includes: The proxy service binding unit is configured to associate the proxy service address of the proxy service in the sub-node with the local service address of the local service based on the preset interface, so as to bind the proxy service with the local service.
8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the proxy service adding method according to any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the proxy service adding method according to any one of claims 1 to 6 when executed.
Citation Information
Patent Citations
Information processing method and device, electronic equipment and storage medium
CN113765988A
Service calling method and device, computer equipment, storage medium and program product
CN114745443A