Domain Name Synchronization Method, Service Container, Cluster, Computing Node and Storage Medium

By monitoring the changes in the ConfigMap resource object, the business container updates the local configuration file in real time, solving the problem of excessive access pressure on DNS servers in the K8s cluster, ensuring the timeliness and correctness of domain name resolution, and improving the stability of the service.

CN116074195BActive Publication Date: 2025-08-01HUNDSUN TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202310105721.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-08
Publication Date
2025-08-01
Estimated Expiration
2043-02-08

AI Technical Summary

Technical Problem

In K8s cluster, when the service container is hung up and pulled up again, the local domain name resolution information is invalid, resulting in excessive access pressure on DNS servers and untimely resolution, which affects the normal provision of the service.

Method used

The business container monitors the changes in the ConfigMap resource object and updates the local configuration files in real time. It uses the ConfigMap hot loading mechanism to ensure the consistency between the configuration files and the resource objects, and reduces access to the DNS server.

Benefits of technology

It improves the accuracy of domain name resolution, reduces the pressure on access to DNS servers, and ensures the stability and reliability of the service.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116074195B_ABST
    Figure CN116074195B_ABST
Patent Text Reader

Abstract

The present invention provides a domain name synchronization method, a service container, a cluster, a computing node and a storage medium. The service container monitors whether a ConfigMap resource object changes. The ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address. When the ConfigMap resource object changes, the service container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file. In this solution, the service container monitors the change of the ConfigMap resource object to update its own local configuration file in real time, ensuring the consistency between the local configuration file and the ConfigMap resource object, avoiding errors in local domain name resolution caused by untimely updates, and at the same time reducing the traffic and pressure on the DNS server.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of Internet technology, and in particular to a domain name synchronization method, a service container, a cluster, a computing node, and a storage medium. Background Art

[0002] Currently, more and more application software is being deployed in containers. The benefits of containerization are obvious: simple, lightweight, and efficient deployment, enabling dynamic cluster expansion and maintenance. For example, CICD (Continuous Integration and Continuous Deployment), leveraging the powerful K8s (Kubernetes), enables large-scale container orchestration and scheduling. The containerized units of functional modules are becoming smaller and smaller. Even a single function, such as a Git code checkout or version update, is treated as a separate pod, providing continuous online service.

[0003] However, in a large Kubernetes cluster, the smaller the functional granularity, the more functions, the higher the functional reuse, and the more frequent the scheduling, the more domain name access requests will be involved, which will correspondingly bring huge access pressure to the DNS (Domain Name System) server.

[0004] To alleviate the pressure on DNS servers, business containers can cache domain name resolution information locally for local resolution, eliminating the need to send domain name resolution requests to the DNS server. However, in a cluster, business containers can crash and then restart. The local domain name resolution information of the business container before the crash is invalid for the restarted business container. Therefore, this method does not substantially alleviate the pressure on DNS servers. In a cluster, a large number of domain name resolution requests can easily flood the DNS server, causing its domain name resolution function to malfunction. This can cause various services in the Kubernetes cluster to experience service anomalies and become unable to provide external services.

[0005] Therefore, to substantially alleviate the access pressure on the DNS server, one existing approach is to statically mount a disk or pre-define a hosts configuration file in the business container to implement local domain name resolution within the business container. This leads to the problem that when domain name information on the DNS server is added, modified, or deleted, the business container cannot synchronize the local domain name information with the DNS server's domain name information in a timely manner, and thus cannot guarantee the accuracy of local domain name resolution. Summary of the Invention

[0006] The purpose of the present invention is to provide a domain name synchronization method, a service container, a cluster, a computing node and a storage medium to improve the problems existing in the prior art.

[0007] Embodiments of the present invention can be implemented as follows:

[0008] In a first aspect, the present invention provides a domain name synchronization method, which is applied to a computing node deployed with a service container; the service container is located in a cluster, and the service container mounts a ConfigMap resource object pre-established in the cluster; the method includes:

[0009] The service container monitors whether the ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address;

[0010] When the ConfigMap resource object changes, the service container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file.

[0011] In an optional implementation, the computing node is communicatively connected to a DNS server; the method further includes:

[0012] The service container obtains a domain name to be resolved and performs local domain name resolution on the domain name to be resolved based on the local configuration file;

[0013] When the local domain name resolution is successful, the service container obtains the target IP address corresponding to the domain name to be resolved;

[0014] When the local domain name resolution fails, the service container generates a domain name resolution request based on the domain name to be resolved and sends the domain name resolution request to the DNS server;

[0015] The service container receives the target IP address returned by the DNS server, and the target IP address is obtained by the DNS server successfully performing domain name resolution on the domain name to be resolved.

[0016] In an optional implementation, the cluster further includes a synchronization node communicatively connected to the computing node, and both the computing node and the synchronization node are communicatively connected to the DNS server;

[0017] After the step of the service container sending the domain name resolution request to the DNS server, the method further includes:

[0018] The service container receives a parsing exception message returned by the DNS server;

[0019] Wherein, the parsing exception message is generated when the DNS server encounters an abnormal situation during domain name resolution of the domain name to be resolved; the parsing exception message includes the domain name to be resolved;

[0020] The service container sends the domain name to be resolved to the synchronization node, so that the synchronization node obtains the domain name information query result corresponding to the domain name to be resolved from the DNS server based on the domain name to be resolved, and updates the ConfigMap resource object based on the domain name information query result.

[0021] In a second aspect, the present invention provides a domain name synchronization method, which is applied to a cluster. The cluster includes at least one computing node, and at least one service container is deployed on the computing node. The service container mounts a ConfigMap resource object pre-established in the cluster. The method includes:

[0022] The target service container monitors whether the ConfigMap resource object has changed. The ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between the domain name and the IP address. The target service container is any service container in the cluster.

[0023] When the ConfigMap resource object changes, the target service container obtains all the domain name information in the ConfigMap resource object, and synchronously maps all the domain name information to its own local configuration file.

[0024] In an optional implementation manner, the cluster further includes a synchronization node communicatively connected to each computing node, and each computing node and the synchronization node are communicatively connected to the DNS server.

[0025] Before the step of the ConfigMap resource object changing, the method further includes:

[0026] The target service container obtains a domain name to be resolved, and performs local domain name resolution on the domain name to be resolved based on the local configuration file.

[0027] When the local domain name resolution is successful, the target service container obtains the target IP address corresponding to the domain name to be resolved.

[0028] When the local domain name resolution fails, the target service container generates a domain name resolution request based on the domain name to be resolved, and sends the domain name resolution request to the DNS server.

[0029] The target service container receives a parsing exception message returned by the DNS server. The parsing exception message is generated when the DNS server encounters an exception during domain name resolution of the domain name to be resolved. The parsing exception message includes the domain name to be resolved.

[0030] The target service container sends the domain name to be resolved to the synchronization node;

[0031] The synchronization node generates a domain name information confirmation message based on the domain name to be resolved, and sends the domain name information confirmation message to the DNS server, so that the DNS server obtains a domain name information query result based on the domain name information confirmation message;

[0032] The synchronization node receives the domain name information query result returned by the DNS server;

[0033] The synchronization node updates the ConfigMap resource object based on the domain name information query result.

[0034] In an optional implementation manner, the domain name information query result includes the abnormal domain name type of the domain name to be resolved and the actual domain name information, and the actual domain name information represents the mapping relationship between the domain name to be resolved and the actual IP address; after the step of the target service container synchronously mapping all the domain name information to its own local configuration file, the method further includes:

[0035] The synchronization node sends a Ping request to the actual IP address, so that the actual IP address responds to the Ping request;

[0036] When the number of responses to the Ping request received from the actual IP address meets a preset value, the synchronization node determines that the domain name to be resolved is in an accessible state, and notifies the target service container that the domain name to be resolved is in the accessible state;

[0037] When the number of responses to the Ping request received from the actual IP address does not meet the preset value, the synchronization node determines that the domain name to be resolved is in an inaccessible state;

[0038] The synchronization node notifies the target service container that the domain name to be resolved is in the inaccessible state, and sends a maintenance warning prompt to the operation and maintenance personnel.

[0039] In a third aspect, the present invention provides a service container, which is applied to a computing node of a cluster, and the service container is mounted with a ConfigMap resource object pre-established in the cluster; the service container includes a monitoring module and a hot reload module;

[0040] The monitoring module is used to monitor whether the ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address;

[0041] When the ConfigMap resource object changes, the hot reload module is used to obtain all domain name information in the ConfigMap resource object and synchronously map the all domain name information to its own local configuration file.

[0042] In a fourth aspect, the present invention provides a cluster, the cluster includes at least one computing node, at least one business container is deployed on the computing node, and the business container mounts a ConfigMap resource object pre-established in the cluster;

[0043] The target business container is used to monitor whether the ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address; the target business container is any business container in the cluster;

[0044] When the ConfigMap resource object changes, the target business container is further used to obtain all domain name information in the ConfigMap resource object and synchronously map the all domain name information to its own local configuration file.

[0045] In a fifth aspect, the present invention provides a computing node, including: a memory and a processor, the memory stores machine-readable instructions executable by the processor, and when the computing node runs, the processor executes the machine-readable instructions to implement the domain name synchronization method as described in any one of the foregoing embodiments.

[0046] In a sixth aspect, the present invention provides a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements the domain name synchronization method as described in any one of the foregoing embodiments.

[0047] Compared with the prior art, the embodiments of the present invention provide a domain name synchronization method, a service container, a cluster, a computing node, and a storage medium. The method is applied to a computing node in a cluster where a service container is deployed, and the service container mounts a ConfigMap resource object pre-established in the cluster. The service container monitors whether the ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address; when the ConfigMap resource object changes, the service container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file. Compared with the prior art, in this solution, the service container monitors the change of the ConfigMap resource object to update its own local configuration file in real time, ensuring the consistency between the local configuration file and the ConfigMap resource object and avoiding incorrect local domain name resolution caused by untimely updates. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required to be used in the embodiments. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as limiting the scope. For those of ordinary skill in the art, other related drawings can be obtained based on these drawings without creative efforts.

[0049] Figure 1 FIG. is a schematic diagram of an application scenario provided by an embodiment of the present invention.

[0050] Figure 2 FIG. is a first flowchart of a domain name synchronization method provided by an embodiment of the present invention.

[0051] Figure 3 FIG. is a second flowchart of a domain name synchronization method provided by an embodiment of the present invention.

[0052] Figure 4 FIG. is a signaling interaction diagram provided by an embodiment of the present invention.

[0053] Figure 5 FIG. is a schematic structural diagram of a service container provided by an embodiment of the present invention.

[0054] Figure 6 FIG. is a schematic structural diagram of a computing node provided by an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0055] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are some, but not all, of the embodiments of the present invention. Components of the embodiments of the present invention usually described and illustrated in the accompanying drawings here can be arranged and designed in various different configurations.

[0056] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed invention, but merely represents selected embodiments of the present invention. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts fall within the scope of protection of the present invention.

[0057] It should be noted that similar reference numerals and letters denote similar items in the following drawings. Therefore, once an item is defined in one drawing, it does not need to be further defined and explained in subsequent drawings.

[0058] It should be noted that, without conflict, the features in the embodiments of the present invention can be combined with each other.

[0059] Here, first, keywords or key terms related to the present invention are introduced:

[0060] 1. Kubernetes (abbreviated as K8s) is an open-source system used to manage containerized applications on multiple hosts in a cloud platform.

[0061] 2. Pod: A pod is the basic scheduling unit in a K8s cluster and also the smallest unit that can be created and deployed. A pod can be deployed on a node, and one or more related containers can be hosted within a pod.

[0062] 3. ConfigMap: A resource object in K8s that can use environment variables, command-line arguments, configuration files, etc. as resources for containers. ConfigMap can dynamically configure containers and can be shared in the cluster.

[0063] 4. ETCD: A distributed key-value storage system deployed in K8s, which is used to store key data in a distributed system.

[0064] Combined with the background art section, regarding the domain name synchronization problem related to business containers that are continuously pulled up, a practice adopted in the prior art is that business containers periodically poll the interface of the DNS server and synchronize all domain name information contained in the DNS server to local for use. However, there are also the following problems:

[0065] First, it is difficult to determine the interval time between the first and second polls. If the interval time is set to be relatively small, the polls of a large number of business containers are likely to cause pressure on the DNS service; if the interval time is set to be relatively large, when there are new additions, modifications, deletions, etc. to the domain name information, it may lead to untimely synchronization of the domain name information.

[0066] Second, it is impossible to minimize the use of the DNS server domain name information because the business containers perform a full synchronization of the DNS server's domain name information, which is also likely to result in the leakage of domain names or IP addresses, leading to malicious attacks on the leaked domain names or IP addresses.

[0067] Third, regardless of the interval time set, in the case of not restarting the container, when there are new additions, modifications, or deletions to the domain name information in the DNS server, it is impossible to achieve real-time synchronization and take effect in the business container.

[0068] Based on the discovery of the above technical problems, the inventor has proposed the following technical solutions through creative labor to solve or improve the above problems. It should be noted that the defects existing in the above prior art solutions are all the results obtained by the inventor through practice and careful research. Therefore, the process of discovering the above problems and the solutions proposed by the embodiments of the present application below for the above problems should be the contributions made by the inventor to the present application during the invention creation process, and should not be understood as the technical content known to those skilled in the art.

[0069] In view of this, an embodiment of the present invention provides a domain name synchronization method. The business container can monitor the changes of the ConfigMap resource object to update its own local configuration file in real time, ensuring the consistency between the local configuration file and the ConfigMap resource object, and avoiding incorrect local domain name resolution caused by untimely updates. The following is a detailed description through embodiments and in conjunction with the accompanying drawings.

[0070] The K8s cluster may include a Master node and several computing nodes. The Master node is used to schedule and manage the cluster and accept operation requests sent from users outside the cluster to the cluster.

[0071] The ETCD database of the entire cluster can run in the Master node or be jointly supported by at least one computing node. The ETCD database is mainly responsible for the storage service of the K8s cluster, where the key configurations and user configurations of the K8s cluster are stored. In the K8s cluster, only the kube-apiserver component of the Master node has direct read and write permissions, and other components of the cluster must call the interface of the kube-apiserver component to read and write data.

[0072] The following takes a K8s cluster including three computing nodes as an example to introduce the application scenario of the embodiments of the present invention. Please refer to Figure 1 , Figure 1 which is a schematic diagram of an application scenario provided by the embodiments of the present invention.

[0073] Combined with Figure 1 , in the K8s cluster, the three computing nodes are respectively computing node 1, computing node 2, and a synchronization node, and all three computing nodes can communicate with an external DNS server.

[0074] Suppose business container 1 and business container 2 are deployed in podA of computing node 1, and business container 3 is deployed in podB of computing node 2. It can be understood that the functions of business containers 1 to 3 or the services that can be provided to users can be the same or different.

[0075] In the ETCD database, a resource of the resource type ConfigMap (referred to as a ConfigMap resource object for short) has been pre-created, its name is: hosts-config, the key name is: hosts, and the value is: the mapping relationship between domain names and IP addresses. Therefore, the ConfigMap resource object is used to store domain name information.

[0076] Among them, the content in the ConfigMap resource object can be mounted as a file or directory inside business containers 1 / 2 / 3 through the Volume mounting method in advance, so as to map the content in the ConfigMap resource object to the local configuration files of business containers 1 / 2 / 3 for use.

[0077] A domain name synchronization service is deployed in podC of the synchronization node. This domain name synchronization service can be responsible for processing the resolved abnormal domain names fed back by the DNS server to the business containers, requesting the domain name information query results of the resolved abnormal domain names from the DNS server, and accordingly adjusting the relevant content in the ConfigMap resource object, monitoring and warning whether the processed abnormal domain names are reachable, and "message synchronization" with the business containers to notify the reachability of the domain names.

[0078] It should be noted that the above Figure 1 is only for illustration. The K8s cluster may also include more or fewer components than those Figure 1 shown, or have a configuration different from that Figure 1 shown; and the number of computing nodes in the specific K8s cluster, the number of pods deployed in each computing node, and the number of business containers deployed in each pod shall be subject to the actual application situation and are not limited herein.

[0079] Based on the K8s cluster introduced above, from the perspective of a computing node, the domain name synchronization method of the embodiments of the present invention will be introduced below.

[0080] Please refer to Figure 2 , Figure 2 FIG. 1 is one of the schematic flowcharts of a domain name synchronization method provided by an embodiment of the present invention. The execution subject of this method is a computing node in the cluster where business containers are deployed, and the business containers are mounted with a ConfigMap resource object pre-established in the cluster. This method includes the following steps S100 and S200:

[0081] S100. The business container monitors whether the ConfigMap resource object has changed.

[0082] In this embodiment, the cluster is the K8s cluster introduced above. The ConfigMap resource object is used to store at least one piece of domain name information, and this domain name information can represent the mapping relationship between a domain name and an IP address. Optionally, the business container can use relevant tools such as a file monitor to implement the monitoring of the ConfigMap resource object.

[0083] S200. When the ConfigMap resource object has changed, the business container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file.

[0084] It can be understood that the content in the ConfigMap resource object can be mounted to the internal directory / etc / hosts of the business container by means of Volume mounting, so that the domain name information in the hosts file of the ConfigMap resource object can be synchronously mapped to the local configuration file hosts of the business container, which is convenient for the business container to perform local domain name resolution.

[0085] However, with such mounting, only when the business container is restarted each time or the pod managing the business container is restarted, the domain name information in the hosts file of the ConfigMap resource object will be synchronously mapped to the local configuration file hosts of the business container, and the content of the local configuration file hosts remains unchanged at other times.

[0086] Therefore, in this embodiment, the business container can use relevant tools such as a file monitor to monitor the ConfigMap resource object. Once it senses that the ConfigMap resource object has changed, the business container can obtain all the domain name information in the hosts file of the ConfigMap resource object and synchronously map all the domain name information to its own local configuration file. This belongs to the hot loading mechanism of ConfigMap.

[0087] In the domain name synchronization method adopted in the embodiments of the present invention, the service container monitors the changes of the ConfigMap resource object to update its local configuration file in real time, ensuring the consistency between the local configuration file and the ConfigMap resource object, and avoiding errors in local domain name resolution caused by untimely updates.

[0088] In an alternative embodiment, the computing node is communicatively connected to the DNS server. Service containers usually have a need for domain name resolution, either performing local domain name resolution by themselves or relying on the DNS server for domain name resolution. On the Figure 1 basis, combined with Figure 2 , the method may further include steps S110 to S140.

[0089] S110. The service container obtains the domain name to be resolved and performs local domain name resolution on the domain name to be resolved based on the local configuration file.

[0090] In this embodiment, the domain name to be resolved may be obtained by the service container from an external service request, or may be obtained by the service container itself by jumping when accessing a certain service resource.

[0091] It can be understood that the service container can look up the target IP address corresponding to the domain name to be resolved in the local configuration file. When the target IP address corresponding to the domain name to be resolved can be found in the local configuration file, the local domain name resolution is successful; when the target IP address corresponding to the domain name to be resolved cannot be found in the local configuration file, the local domain name resolution fails.

[0092] S120. When the local domain name resolution is successful, the service container obtains the target IP address corresponding to the domain name to be resolved.

[0093] S130. When the local domain name resolution fails, the service container generates a domain name resolution request based on the domain name to be resolved and sends the domain name resolution request to the DNS server.

[0094] In this embodiment, the failure of local domain name resolution indicates that the domain name information corresponding to the domain name to be resolved does not exist in the local configuration file. At this time, a domain name resolution request needs to be sent to the DNS server to request the DNS server to perform domain name resolution. After receiving the domain name resolution request, the DNS server can obtain the domain name to be resolved from it, then look up the target IP address corresponding to the domain name to be resolved from all the domain name information in its own hosts file, and send the target IP address to the service container.

[0095] In an alternative example, the DNS server may be the domain name resolution server of the local area network where the computing node is located. It can be understood that when local domain name resolution fails, the service container may send the domain name resolution request to the domain name resolution server A of the local area network where the computing node is located, and the domain name resolution server A performs domain name resolution to obtain the target IP address.

[0096] S140. The service container receives the target IP address returned by the DNS server.

[0097] Among them, the target IP address is obtained by the DNS server successfully performing domain name resolution on the domain name to be resolved. If the DNS server can find the target IP address, it means that the DNS server has successfully performed domain name resolution on the domain name to be resolved.

[0098] In another possible situation, if there are a large number of fluctuations in domain name resolution requests on the DNS server, and the service container sends the domain name resolution request to the DNS server, then a domain name resolution exception may occur (for example, the service container displays timeout, unknow host, or error codes above 500), and the DNS server will return a resolution exception message including the domain name to be resolved to the service container. The processing process of the service container in this case is introduced below.

[0099] Optionally, the cluster may further include a synchronization node communicatively connected to the computing node, and both the computing node and the synchronization node are communicatively connected to the DNS server. Therefore, please continue to refer to Figure 2 , after the above step S130, the method may further include the following steps S150 to S160.

[0100] S150. The service container receives the resolution exception message returned by the DNS server.

[0101] Among them, the resolution exception message may be generated when the DNS server encounters an exception during domain name resolution of the domain name to be resolved.

[0102] S160. The service container sends the domain name to be resolved to the synchronization node, so that the synchronization node obtains the domain name information query result corresponding to the domain name to be resolved from the DNS server based on the domain name to be resolved, and updates the ConfigMap resource object based on the domain name information query result.

[0103] In this embodiment, the service container can directly send the domain name to be resolved in the parsing exception message to the domain name synchronization service of the synchronization node. Then, the domain name synchronization service can generate a domain name information confirmation message based on the domain name to be resolved, and then access the DNS server under the same local area network through a command-line tool (such as a Linux command script) to send the domain name information confirmation message to the DNS server. Next, the DNS server can determine the change situation of the domain name information of the domain name to be resolved based on the domain name information confirmation message and its own hosts file, and generate a domain name information query result based on the change situation of the domain name information. Finally, the DNS server returns the domain name information query result to the domain name synchronization service. In this way, the domain name synchronization service can call the apisevice interface of the K8s cluster and update the ConfigMap resource object based on the domain name information query result.

[0104] In an optional example, the domain name information query result may include the abnormal domain name type and the actual domain name information of the domain name to be resolved. The actual domain name information may represent the mapping relationship between the domain name to be resolved and the actual IP address. The abnormal domain name type may include three types: newly added domain names, modified domain names, and deleted domain names.

[0105] Assume that the domain name to be resolved is www.abc.com. Then, in the hosts file of the DNS server, the domain name to be resolved may belong to newly added domain name information, modified domain name information, or domain name information with a deleted label.

[0106] In the first possible case, the domain name to be resolved belongs to newly added domain name information:

[0107] Assume that in the hosts file of the DNS server, the newly added domain name information is that www.abc.com corresponds to 127.0.0.0. Then, the domain name information query result returned by the DNS server to the domain name synchronization service is the newly added domain name and the mapping relationship between www.abc.com and 127.0.0.0.

[0108] Then, the domain name synchronization service can add the actual domain name information corresponding to www.abc.com and 127.0.0.0 to the ConfigMap resource object.

[0109] In the second possible case, the domain name to be resolved belongs to modified domain name information:

[0110] Assume that in the hosts file of the DNS server, the domain name information before modification is that www.abc.com corresponds to 127.0.0.1, and the domain name information after modification is that www.abc.com corresponds to 127.0.0.2; then the query result of the domain name information returned by the DNS server to the domain name synchronization service is the modified domain name and the mapping relationship between www.abc.com and 127.0.0.2.

[0111] Then the domain name synchronization service can modify the domain name information corresponding to www.abc.com and 127.0.0.1 in the ConfigMap resource object to the actual domain name information corresponding to www.abc.com and 127.0.0.2.

[0112] In the third possible case, the domain name to be resolved belongs to the domain name information with a marked deletion label:

[0113] Assume that in the hosts file of the DNS server, the domain name information with the marked deletion label is that www.abc.com corresponds to 127.0.0.0, then the query result of the domain name information returned by the DNS server to the domain name synchronization service is the deleted domain name and the mapping relationship between the marked deletion label of www.abc.com and 127.0.0.0;

[0114] Then the domain name synchronization service can mark the deletion label or completely delete the domain name information corresponding to www.abc.com and 127.0.0.0 in the ConfigMap resource object.

[0115] It should be noted that the domain names and IP addresses in the above examples are only for illustration, and the specific ones shall be subject to the actual application and are not limited herein.

[0116] The above embodiments introducing the domain name synchronization method are mainly based on the business containers of the computing nodes to introduce the relevant processes of domain name synchronization.

[0117] Combined with the above content, the following will introduce the domain name synchronization method of the embodiments of the present invention from the overall perspective of the cluster. It should be noted that its basic principle and the technical effects produced are the same as or similar to those of the foregoing embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding content in the foregoing embodiments.

[0118] In this embodiment, the domain name synchronization method can be applied to a cluster, which includes at least one computing node. The computing node deploys at least one business container, and the business container mounts a ConfigMap resource object pre-established in the cluster. The method may include:

[0119] S300. The target business container monitors whether the ConfigMap resource object has changed.

[0120] Among them, the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between the domain name and the IP address; the target business container is any business container in the cluster.

[0121] S400. When the ConfigMap resource object changes, the target business container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file.

[0122] It can be understood that each business container in the cluster mounts the content in the ConfigMap resource object to its own internal directory / etc / hosts through the Volume mounting method. Once each business container senses that the ConfigMap resource object has changed, it can obtain all the domain name information of the hosts file in the ConfigMap resource object and synchronously map all the domain name information to its own local configuration file.

[0123] Through the domain name synchronization method of the embodiments of the present invention, each business container in the cluster monitors the changes of the ConfigMap resource object to update its own local configuration file in real time, ensuring the consistency between the local configuration file and the ConfigMap resource object and avoiding incorrect local domain name resolution caused by untimely updates.

[0124] In an alternative embodiment, the cluster further includes a synchronization node communicatively connected to each computing node, and each computing node and the synchronization node are communicatively connected to the DNS server. Before the above step S400, the method may further include:

[0125] S310. The target business container obtains the domain name to be resolved and performs local domain name resolution on the domain name to be resolved based on the local configuration file.

[0126] S320. When the local domain name resolution is successful, the target business container obtains the target IP address corresponding to the domain name to be resolved.

[0127] S330. When the local domain name resolution fails, the target business container generates a domain name resolution request based on the domain name to be resolved and sends the domain name resolution request to the DNS server;

[0128] S340. The target business container receives the parsing exception message returned by the DNS server.

[0129] Among them, the parsing exception message may be generated when the DNS server encounters an abnormal situation during the domain name resolution of the domain name to be resolved, so the parsing exception message may include the domain name to be resolved.

[0130] S350. The target service container sends the domain name to be resolved to the synchronization node.

[0131] S360. The synchronization node generates a domain name information confirmation message based on the domain name to be resolved, and sends the domain name information confirmation message to the DNS server, so that the DNS server obtains the domain name information query result based on the domain name information confirmation message.

[0132] S370. The synchronization node receives the domain name information query result returned by the DNS server.

[0133] S380. The synchronization node updates the ConfigMap resource object based on the domain name information query result.

[0134] It can be understood that the above steps S360 to S380 can all be implemented by the domain name synchronization service deployed in the synchronization node. The specific implementation details can refer to the relevant descriptions of the above embodiments and will not be elaborated here.

[0135] In an optional implementation, the domain name information query result may include the abnormal domain name type of the domain name to be resolved and the actual domain name information, and the actual domain name information may represent the mapping relationship between the domain name to be resolved and the actual IP address. After the above step S400, it may further include:

[0136] S410. The synchronization node sends a Ping request to the actual IP address, so that the actual IP address responds to the Ping request.

[0137] It can be understood that the domain name synchronization service of the synchronization node can send a Ping request to the actual IP address, which is to verify the current status of the domain name to be resolved. The current status includes two types: accessible status and inaccessible status.

[0138] S420. When the number of responses to the Ping request received from the actual IP address meets the preset value, the synchronization node determines that the domain name to be resolved is in an accessible state and notifies the target service container that the domain name to be resolved is in an accessible state.

[0139] It can be understood that when the number of responses to the Ping request received by the domain name synchronization service from the actual IP address meets the preset value, it can be determined that the current status of the domain name to be resolved is the accessible state. The domain name synchronization service can notify the target service container that the domain name to be resolved is in an accessible state. Thus, the target service container can re-enter the service process of accessing the domain name to be resolved. In an optional example, the preset value may be 3 or 4 or other values.

[0140] S430. When the number of responses to the Ping request received from the actual IP address does not meet the preset value, the synchronization node determines that the domain name to be resolved is in an inaccessible state. S440. The synchronization node notifies the target service container that the domain name to be resolved is in an inaccessible state and sends a maintenance warning prompt to the operation and maintenance personnel.

[0141] It can be understood that if the number of responses to the Ping request from the actual IP address does not meet the preset value, then the domain name synchronization service can determine that the current state of the domain name to be resolved is the inaccessible state. Therefore, when the domain name synchronization service notifies the target service container that the domain name to be resolved is in an inaccessible state, it will also send a maintenance warning prompt to the operation and maintenance personnel so that the operation and maintenance personnel can perform maintenance tests.

[0142] Optionally, to better illustrate the implementation manner of the present invention, based on the processes of the above two method embodiments, the following gives an interaction implementation manner among the target service container of the service node, the DNS server, and the domain name synchronization service of the synchronization node. Specifically, Figure 4 is the signaling interaction schematic diagram provided by the embodiment of the present invention. Please refer to Figure 4 , and the interaction process among the three can include the following S0 to S17:

[0143] S0. The target service container monitors whether the ConfigMap resource object has changed;

[0144] S1. The target service container obtains the domain name to be resolved and performs local domain name resolution on the domain name to be resolved based on the local configuration file;

[0145] S2. When the local domain name resolution is successful, the target service container obtains the target IP address corresponding to the domain name to be resolved;

[0146] S3. When the local domain name resolution fails, the target service container generates a domain name resolution request based on the domain name to be resolved;

[0147] S4. The target service container sends the domain name resolution request to the DNS server;

[0148] S5. When the DNS server encounters an abnormal situation during domain name resolution of the domain name to be resolved, it generates a resolution exception message;

[0149] S6. The DNS server sends the resolution exception message to the target service container;

[0150] S7. The target service container sends the domain name to be resolved to the domain name synchronization service;

[0151] S8. The domain name synchronization service generates a domain name information confirmation message based on the domain name to be resolved;

[0152] S9. The domain name synchronization service sends the domain name information confirmation message to the DNS server;

[0153] S10. The DNS server obtains the domain name information query result based on the domain name information confirmation message;

[0154] S11. The DNS server sends the domain name information query result to the domain name synchronization service;

[0155] S12. The domain name synchronization service updates the ConfigMap resource object based on the domain name information query result;

[0156] S13. The target business container monitors that the ConfigMap resource object has changed, and synchronizes and maps all the domain name information in the ConfigMap resource object to its own local configuration file;

[0157] S14. The domain name synchronization service sends a Ping request to the actual IP address so that the actual IP address responds to the Ping request;

[0158] S15. The domain name synchronization service determines the current status (accessible status or inaccessible status) of the domain name to be resolved based on the response of the actual IP address to the Ping request;

[0159] S16. The domain name synchronization service sends the current status of the domain name to be resolved to the target business container;

[0160] S17. If the current status is the inaccessible status, the domain name synchronization service sends a maintenance warning prompt to the operation and maintenance personnel.

[0161] It can be understood that the target business container has been executing S0 all the time. When the target business container obtains the domain name to be resolved during business processing, the following situations may exist:

[0162] Situation 1: After the above S1 - S2, the target business container can directly access the domain name to be resolved and enter the business process;

[0163] Situation 2: After S1, S3, S4, when the DNS server successfully resolves the domain name to be resolved, the DNS server directly returns the target IP address of the domain name to be resolved to the target business container, so that the target business container can also access the domain name to be resolved and enter the business process;

[0164] Case 3: After S1, S3, S4, and S5, it is proved that the service request of the target service container to access the domain name to be resolved fails. It is necessary to go through the above S6 - S13. Then the target service container can update the actual domain name information of the domain name to be resolved to its own local configuration file. Then, after the above S14 - S15, the domain name synchronization service determines that the domain name to be resolved is in an accessible state. Then the target service container can retry the service request that needs to access the domain name to be resolved.

[0165] It should be noted that the execution order of each step in the above method embodiments is not limited by the figures shown, and the execution order of each step is subject to the actual application situation.

[0166] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:

[0167] (1) In this solution, the service container monitors the changes of the ConfigMap resource object to update its own local configuration file in real time. The hot loading mechanism of ConfigMap ensures the consistency between the local configuration file and the ConfigMap resource object, avoids incorrect local domain name resolution caused by untimely updates, improves the correctness of domain name resolution in the cluster, and at the same time reduces the traffic and pressure on the DNS server.

[0168] (2) When the service container receives a parsing exception message, it feeds back the domain name in it to the domain name synchronization service. By using such a feedback mechanism of the service container to the domain name synchronization service, the minimum synchronization of the domain name information to be used in the cluster is realized, ensuring that the domain name information synchronized to the cluster is the domain name information that the service container needs to use.

[0169] (3) Moreover, in this solution, a Ping request is sent to the actual IP address of the domain name to be resolved after the update to test whether the domain name to be resolved can be accessed, ensuring the reachability of the request.

[0170] The embodiments of the present invention also provide a service container, which is applied to a computing node of a cluster. The service container is mounted with a ConfigMap resource object pre - established in the cluster. Figure 5 The structure diagram of a service container provided by the embodiments of the present invention is shown. Refer to Figure 5 As shown, the service container 100 includes a monitoring module 110 and a hot loading module 120.

[0171] The monitoring module 110 is used to monitor whether the ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between the domain name and the IP address;

[0172] When the ConfigMap resource object changes, the hot reload module 120 is used to obtain all domain name information in the ConfigMap resource object and synchronously map all domain name information to its own local configuration file.

[0173] In an optional embodiment, the computing node is communicatively connected to the DNS server, and the service container 100 may further include a processing module 115, and the processing module 115 may be configured to: obtain a domain name to be resolved, and perform local domain name resolution on the domain name to be resolved based on the local configuration file; when the local domain name resolution is successful, obtain the target IP address corresponding to the domain name to be resolved; when the local domain name resolution fails, generate a domain name resolution request based on the domain name to be resolved, and send the domain name resolution request to the DNS server; receive the target IP address returned by the DNS server, where the target IP address is obtained by the DNS server successfully resolving the domain name to be resolved.

[0174] In an optional embodiment, the cluster further includes a synchronization node communicatively connected to the computing node, and both the computing node and the synchronization node are communicatively connected to the DNS server; after the processing module 115 is configured to send the domain name resolution request to the DNS server, it may further be configured to:

[0175] Receive a parsing exception message; wherein, the parsing exception message is generated when the DNS server encounters an abnormal situation during domain name resolution of the domain name to be resolved; the parsing exception message includes the domain name to be resolved; send the domain name to be resolved to the synchronization node, so that the synchronization node obtains the domain name information query result corresponding to the domain name to be resolved from the DNS server based on the domain name to be resolved, and updates the ConfigMap resource object based on the domain name information query result.

[0176] Those skilled in the art can clearly understand that for the convenience and conciseness of description, the specific working process of the service container 200 described above can refer to the corresponding process in the foregoing method embodiment, and will not be elaborated herein.

[0177] An embodiment of the present invention further provides a cluster, which includes at least one computing node, at least one service container is deployed on the computing node, and the service container mounts a ConfigMap resource object pre-established in the cluster;

[0178] The target service container is used to monitor whether the ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between the domain name and the IP address; the target service container is any service container in the cluster;

[0179] When the ConfigMap resource object changes, the target business container is also used to obtain all domain name information in the ConfigMap resource object and synchronously map all domain name information to its own local configuration file.

[0180] In an alternative embodiment, the cluster further includes a synchronization node communicatively connected to each computing node, and each computing node and the synchronization node are communicatively connected to a DNS server. Before the step of the ConfigMap resource object changing:

[0181] The target business container can be used to: obtain a domain name to be resolved and perform local domain name resolution on the domain name to be resolved based on the local configuration file; when the local domain name resolution is successful, obtain the target IP address corresponding to the domain name to be resolved; when the local domain name resolution fails, generate a domain name resolution request based on the domain name to be resolved and send the domain name resolution request to the DNS server; receive a parsing exception message returned by the DNS server; wherein, the parsing exception message is generated when the DNS server encounters an exception during domain name resolution of the domain name to be resolved; the parsing exception message includes the domain name to be resolved; send the domain name to be resolved to the synchronization node;

[0182] The synchronization node can be used to: generate a domain name information confirmation message based on the domain name to be resolved and send the domain name information confirmation message to the DNS server, so that the DNS server obtains a domain name information query result based on the domain name information confirmation message; receive the domain name information query result returned by the DNS server; update the ConfigMap resource object based on the domain name information query result.

[0183] In an alternative embodiment, the domain name information query result includes the abnormal domain name type of the domain name to be resolved and the actual domain name information, and the actual domain name information represents the mapping relationship between the domain name to be resolved and the actual IP address; after the target business container is used to synchronously map all domain name information to its own local configuration file, the synchronization node can be used to:

[0184] Send a Ping request to the actual IP address so that the actual IP address responds to the Ping request; when the number of responses to the Ping request received from the actual IP address meets a preset value, determine that the domain name to be resolved is in an accessible state and notify the target business container that the domain name to be resolved is in an accessible state; when the number of responses to the Ping request received from the actual IP address does not meet the preset value, determine that the domain name to be resolved is in an inaccessible state, notify the target business container that the domain name to be resolved is in an inaccessible state and send a maintenance warning prompt to the operation and maintenance personnel at the same time.

[0185] The embodiment of the present invention also provides a computing node, Figure 6 For the structural schematic diagram of a computing node provided by the embodiment of the present invention, see Figure 6, the computing node 300 includes a processor 310, a memory 320, and a bus 330. The processor 310 is connected to the memory 320 through the bus 330.

[0186] The memory 320 can be used to store software programs, for example, Figure 5 the service container 200 shown. Among them, the memory 320 can be, but is not limited to, random access memory (RAM), read-only memory (ROM), flash memory, programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0187] The processor 310 can be an integrated circuit chip with signal processing capabilities. The processor 310 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0188] The memory 320 stores machine-readable instructions executable by the processor 310. When the processor 310 executes the machine-readable instructions, the domain name synchronization method disclosed in the above embodiments is implemented.

[0189] It can be understood that Figure 6 the structure shown is only schematic, and the computing node 300 may further include more or fewer components than Figure 6 shown therein, or have a configuration different from Figure 6 that shown. Figure 6 Each component shown therein can be implemented by hardware, software, or a combination thereof.

[0190] An embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is run by a processor, the domain name synchronization method disclosed in the above embodiment is implemented. The computer-readable storage medium may be, but is not limited to, various media that can store program codes, such as USB flash drives, mobile hard disks, ROM, RAM, PROM, EPROM, EEPROM, FLASH magnetic disks, or optical discs.

[0191] In summary, an embodiment of the present invention provides a domain name synchronization method, a service container, a cluster, a computing node, and a storage medium. The service container monitors whether a ConfigMap resource object changes; the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address; when the ConfigMap resource object changes, the service container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file. Compared with the prior art, in this solution, the service container monitors the change of the ConfigMap resource object to update its own local configuration file in real time, ensuring the consistency between the local configuration file and the ConfigMap resource object and avoiding incorrect local domain name resolution caused by untimely update. Moreover, in this solution, a Ping request is sent to the actual IP address of the domain name to be resolved after the update to test whether the domain name to be resolved can be accessed, ensuring the reachability of the request.

[0192] The above are only the specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims

1. A domain name synchronization method, characterized in that, Applied to a computing node where business containers are deployed; the business containers are located in a cluster, and the business containers are mounted with a ConfigMap resource object pre-established in the cluster, and the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address; The cluster further includes a synchronization node, and both the synchronization node and the computing node are communicatively connected to a DNS server; the method includes: The business container obtains a domain name to be resolved and performs local domain name resolution on the domain name to be resolved based on a local configuration file; When the local domain name resolution is successful, the business container obtains the target IP address corresponding to the domain name to be resolved; When the local domain name resolution fails, the business container generates a domain name resolution request based on the domain name to be resolved and sends the domain name resolution request to the DNS server; The business container receives a parsing exception message returned by the DNS server; wherein, the parsing exception message is generated when the DNS server encounters an abnormal situation during domain name resolution of the domain name to be resolved; The business container sends the domain name to be resolved in the parsing exception message to the synchronization node, so that the synchronization node obtains a domain name information query result corresponding to the domain name to be resolved from the DNS server based on the domain name to be resolved and updates the ConfigMap resource object based on the domain name information query result; wherein, the domain name information query result includes an abnormal domain name type and actual domain name information, and the abnormal domain name type is one of a newly added domain name, a modified domain name, and a deleted domain name; The business container monitors whether the ConfigMap resource object has changed; When the ConfigMap resource object changes, the business container obtains all the domain name information in the ConfigMap resource object and synchronously maps all the domain name information to its own local configuration file.

2. A domain name synchronization method, characterized in that, Applied to a cluster, the cluster includes at least one computing node and a synchronization node, the synchronization node is communicatively connected to each computing node, and both the synchronization node and each computing node are communicatively connected to a DNS server; at least one business container is deployed on the computing node, and the business container is mounted with a ConfigMap resource object pre-established in the cluster, and the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between a domain name and an IP address; the method includes: The target business container obtains a domain name to be resolved and performs local domain name resolution on the domain name to be resolved based on a local configuration file; the target business container is any business container in the cluster; When the local domain name resolution is successful, the target business container obtains the target IP address corresponding to the domain name to be resolved; When the local domain name resolution fails, the target business container generates a domain name resolution request based on the domain name to be resolved and sends the domain name resolution request to the DNS server; The target service container receives the parsing exception message returned by the DNS server; wherein, the parsing exception message is generated when the DNS server encounters an exception during domain name resolution of the domain name to be resolved; The target service container sends the domain name to be resolved in the parsing exception message to the synchronization node; The synchronization node generates a domain name information confirmation message based on the domain name to be resolved, and sends the domain name information confirmation message to the DNS server, so that the DNS server obtains a domain name information query result based on the domain name information confirmation message; The synchronization node receives the domain name information query result returned by the DNS server; the domain name information query result includes an abnormal domain name type and actual domain name information, and the abnormal domain name type is one of a newly added domain name, a modified domain name, and a deleted domain name; The synchronization node updates the ConfigMap resource object based on the domain name information query result; Each service container monitors whether the ConfigMap resource object has changed; when the ConfigMap resource object changes, each service container obtains all the domain name information in the ConfigMap resource object, and synchronously maps all the domain name information to its own local configuration file.

3. The method according to claim 2, wherein The actual domain name information represents the mapping relationship between the domain name to be resolved and the actual IP address; After the step where each service container synchronously maps all the domain name information to its own local configuration file, the method further includes: The synchronization node sends a Ping request to the actual IP address, so that the actual IP address responds to the Ping request; When the number of responses to the Ping request received from the actual IP address meets a preset value, the synchronization node determines that the domain name to be resolved is in an accessible state, and notifies the target service container that the domain name to be resolved is in the accessible state; When the number of responses to the Ping request received from the actual IP address does not meet the preset value, the synchronization node determines that the domain name to be resolved is in an inaccessible state; The synchronization node notifies the target service container that the domain name to be resolved is in the inaccessible state, and sends a maintenance warning prompt to the operation and maintenance personnel.

4. A service container, characterized in that, Applied to the computing nodes of the cluster, the service container mounts the ConfigMap resource object pre-established in the cluster, and the ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between the domain name and the IP address; the cluster further includes a synchronization node, and both the synchronization node and the computing node are communicatively connected to the DNS server; the service container includes a processing module, a monitoring module, and a hot reload module; The processing module is used for: Obtain the domain name to be resolved, and perform local domain name resolution on the domain name to be resolved based on the local configuration file; When the local domain name resolution is successful, obtain the target IP address corresponding to the domain name to be resolved; When the local domain name resolution fails, generate a domain name resolution request based on the domain name to be resolved, and send the domain name resolution request to the DNS server; Receive the parsing exception message returned by the DNS server; wherein, the parsing exception message is generated when the DNS server encounters an exception during the domain name resolution of the domain name to be resolved; Send the domain name to be resolved in the parsing exception message to the synchronization node, so that the synchronization node obtains the domain name information query result corresponding to the domain name to be resolved from the DNS server based on the domain name to be resolved, and updates the ConfigMap resource object based on the domain name information query result; wherein, the domain name information query result includes an abnormal domain name type and actual domain name information, and the abnormal domain name type is one of a newly added domain name, a modified domain name, and a deleted domain name; The monitoring module is used to monitor whether the ConfigMap resource object has changed; When the ConfigMap resource object changes, the hot reload module is used to obtain all the domain name information in the ConfigMap resource object, and synchronously map all the domain name information to its own local configuration file.

5. A cluster, characterized in that, The cluster includes at least one computing node and a synchronization node. The synchronization node is communicatively connected to each computing node, and both the synchronization node and each computing node are communicatively connected to the DNS server; at least one business container is deployed on the computing node, and the business container mounts the ConfigMap resource object pre-established in the cluster. The ConfigMap resource object is used to store at least one piece of domain name information, and the domain name information represents the mapping relationship between the domain name and the IP address; The target business container is used to obtain the domain name to be resolved, and perform local domain name resolution on the domain name to be resolved based on the local configuration file; the target business container is any business container in the cluster; When the local domain name resolution is successful, the target business container is further used to obtain the target IP address corresponding to the domain name to be resolved; When the local domain name resolution fails, the target business container is further used to generate a domain name resolution request based on the domain name to be resolved, and send the domain name resolution request to the DNS server; The target business container is further used to receive the parsing exception message returned by the DNS server; wherein, the parsing exception message is generated when the DNS server encounters an abnormal situation during the domain name resolution of the domain name to be resolved; The target business container is further used to send the domain name to be resolved in the parsing exception message to the synchronization node; The synchronization node is used to generate a domain name information confirmation message based on the domain name to be resolved, and send the domain name information confirmation message to the DNS server, so that the DNS server obtains the domain name information query result based on the domain name information confirmation message; The synchronization node is further configured to receive the query result of the domain name information returned by the DNS server; the query result of the domain name information includes an abnormal domain name type and actual domain name information, and the abnormal domain name type is one of a newly added domain name, a modified domain name, and a deleted domain name; The synchronization node is further configured to update the ConfigMap resource object based on the query result of the domain name information; Each of the service containers is configured to monitor whether the ConfigMap resource object changes; When the ConfigMap resource object changes, each of the service containers is further configured to obtain all the domain name information in the ConfigMap resource object and synchronously map the all domain name information to its own local configuration file.

6. A computing node, characterized in that, Including: A memory and a processor, where the memory stores machine-readable instructions executable by the processor, and when the computing node runs, the processor executes the machine-readable instructions to implement the domain name synchronization method according to claim 1.

7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the domain name synchronization method according to claim 1 is implemented.

Citation Information

Patent Citations

  • Domain name system DNS server query method and apparatus

    CN107613040A

  • Method and device for analyzing host machine name by using kubernetes cluster

    CN107707688A

  • Domain name resolution method and system of container cloud platform, medium and electronic equipment

    CN114785753A