WO2020147396A1 - 服务域名的动态配置方法、装置、设备及存储介质 - Google Patents

服务域名的动态配置方法、装置、设备及存储介质 Download PDF

Info

Publication number
WO2020147396A1
WO2020147396A1 PCT/CN2019/117193 CN2019117193W WO2020147396A1 WO 2020147396 A1 WO2020147396 A1 WO 2020147396A1 CN 2019117193 W CN2019117193 W CN 2019117193W WO 2020147396 A1 WO2020147396 A1 WO 2020147396A1
Authority
WO
WIPO (PCT)
Prior art keywords
domain name
target application
pod
nginx
application
Prior art date
Application number
PCT/CN2019/117193
Other languages
English (en)
French (fr)
Inventor
王飞
崔志良
刘超
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020147396A1 publication Critical patent/WO2020147396A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming

Definitions

  • This application relates to the field of computer technology, and in particular to a method, device, equipment and computer-readable storage medium for dynamic configuration of service domain names.
  • the main purpose of this application is to provide a method, device, device, and computer-readable storage medium for dynamic configuration of service domain names, aiming to solve the technical problem that existing service domain names require manual configuration.
  • this application provides a method for dynamically configuring a service domain name, and the method for dynamically configuring a service domain name includes the following steps:
  • the effective POD address is configured to the nginx configuration file, and the external service of the target application is realized based on the nginx configuration file and the domain name.
  • the method further includes:
  • the step of configuring the valid POD address to a configuration file of nginx, and realizing the external service of the target application based on the configuration file of nginx and the domain name specifically includes:
  • the external service of the target application is realized through the domain name and the valid POD address.
  • the step of analyzing the POD address of the target application based on the proxy server nginx, and determining the valid POD address corresponding to the target application specifically includes:
  • the method further includes:
  • the method for dynamically configuring the service domain name further includes:
  • the effective POD address is replaced according to the analysis result, the replaced effective address is configured to the configuration file of nginx, and the external service of the target application is realized based on the configuration file of nginx and the domain name.
  • the method further includes:
  • this application also provides a dynamic configuration device for a service domain name, and the dynamic configuration device for a service domain name includes:
  • the domain name generation module is used to obtain the application name and port of the target application when the application traffic changes are monitored, and generate a corresponding domain name according to the application name;
  • the address resolution module is configured to analyze the POD address of the target application based on the proxy server nginx, and determine the effective POD address corresponding to the target application;
  • the domain name configuration module is configured to configure the effective POD address to the nginx configuration file, and realize the external service of the target application based on the nginx configuration file and the domain name.
  • this application also provides a dynamic configuration device for a service domain name.
  • the dynamic configuration device for a service domain name includes a processor, a memory, and a device that is stored in the memory and can be executed by the processor.
  • the present application also provides a computer-readable storage medium having computer-readable instructions stored on the computer-readable storage medium.
  • the computer-readable instructions When executed by a processor, the implementation is as described above.
  • This application provides a method for dynamically configuring a service domain name, that is, when a change in application traffic is monitored, the application name and port of the target application are obtained, and the corresponding domain name is generated according to the application name;
  • this application Based on the proxy server nginx, parse the POD address of the target application, and determine the effective POD address corresponding to the target application; configure the effective POD address to the nginx configuration file, and implement all the addresses based on the nginx configuration file and domain name Describe the external services of the target application.
  • this application analyzes the POD address of the target application based on nginx in real time to determine the effective POD address of the target application, and then automatically implements domain name configuration based on the effective POD address and nginx configuration file without manual intervention, which greatly reduces manpower Cost, improve the efficiency of operation and maintenance, and solve the technical problem of manual configuration of existing service domain names.
  • FIG. 1 is a schematic diagram of the hardware structure of the service domain name dynamic configuration device involved in the solution of the embodiment of the application;
  • FIG. 2 is a schematic flowchart of a first embodiment of a method for applying for a dynamic configuration of a service domain name
  • FIG. 3 is a schematic flowchart of a second embodiment of a method for applying for a dynamic configuration of a service domain name
  • FIG. 4 is a schematic flowchart of a third embodiment of a method for dynamically configuring a service domain name for application
  • Fig. 5 is a schematic diagram of functional modules of the first embodiment of a dynamic configuration device for applying for a service domain name.
  • the dynamic configuration method of the service domain name involved in the embodiment of the application is mainly applied to the dynamic configuration device of the service domain name.
  • the dynamic configuration device of the service domain name may be a device with display and processing functions such as a PC, a portable computer, and a mobile terminal.
  • FIG. 1 is a schematic diagram of the hardware structure of the dynamic configuration device of the service domain name involved in the solution of the embodiment of the application.
  • the device for dynamically configuring the service domain name may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components;
  • the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard);
  • the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
  • the memory 1005 can be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory.
  • the memory 1005 may optionally be a storage device independent of the aforementioned processor 1001.
  • FIG. 1 does not constitute a limitation on the dynamic configuration device of the service domain name, and may include more or less components than those shown in the figure, or a combination of certain components, or different components. Component arrangement.
  • the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and computer-readable instructions.
  • the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the computer-readable instructions stored in the memory 1005, and execute the dynamic configuration method of the service domain name provided by the embodiment of the application .
  • the embodiment of the application provides a method for dynamically configuring a service domain name.
  • Fig. 2 is a schematic flowchart of a first embodiment of a method for dynamically configuring a service domain name for application.
  • the method for dynamically configuring the service domain name includes the following steps:
  • Step S10 when it is monitored that the application traffic changes, obtain the application name and port of the target application, and generate a corresponding domain name according to the application name;
  • the server After deploying multiple container instances of an application on the Kubernetes-based PaaS platform (hereinafter referred to as the server), it is usually necessary to expose the service to the outside and configure the domain name corresponding to the application to enable external users
  • the deployed application can be accessed through the domain name.
  • Developers can create application instances on the server.
  • Kubernetes can automatically deploy the application instance to the container.
  • Kubernetes is an open source container cluster management system, which provides application deployment, maintenance, high-availability management, flexible expansion mechanism and other functions, and is packaged into a complete and easy-to-use API to provide external services. Generally, using Kubernetes can easily manage containerized applications running across machines.
  • PaaS(Platform as a Service) is a kind of service that takes the running and development environment of application services as a service and submits it to users in the SaaS mode. Therefore, PaaS is also an application of the SaaS model. PaaS can increase the number of resources utilized on the Web platform. For example, you can use Data-as-a-Service (Data-as-a-Service) through remote Web services, and you can also use visual APIs. Users or manufacturers can quickly develop the applications and products they need based on the PaaS platform.
  • Data-as-a-Service Data-as-a-Service
  • a dynamic configuration method of the service domain name is provided, which is applied to the dynamic configuration platform of the service domain name.
  • the dynamic configuration platform of the service domain name can automatically generate the domain name of the application.
  • the domain name corresponding to the application can be generated according to certain preset rules, for example, according to the spelling of the application name or the English translation. For example, if the Chinese application name of an application is "taobao", the pinyin "taobao" corresponding to "taobao" can be automatically used as the domain name of the application.
  • Step S20 parse the POD address of the target application based on the proxy server nginx, and determine a valid POD address corresponding to the target application;
  • the POD address container in the container is changed, so that the application cannot be accessed by the outside (public network). Therefore, the dynamic configuration platform of the service domain name needs to obtain the effective POD address of the target application in real time, that is, through the nginx plug-in jdomain and the kubernetes Serverless mode to dynamically resolve the POD address corresponding to the application deployed in the container, thereby determining the target The valid POD address of the application, and then the valid POD address enables the target application to be accessed from the outside normally.
  • Step S30 Configure the effective POD address to the configuration file of nginx, and realize the external service of the target application based on the configuration file of nginx and the domain name.
  • the Nginx is a high-performance HTTP and reverse proxy server.
  • the Nginx When the Nginx is used as a web server, it has the characteristics of less memory and strong concurrency.
  • the Nginx When the Nginx is used as a load balancing server, it can directly support Rails and PHP internally, and can also support external services as an HTTP proxy server.
  • service agent registration By configuring the valid POD to the configuration file of the nginx server, service agent registration is completed. Based on the nginx configuration file and domain name, the external service of the target application is realized, that is, the user can use the domain name via the valid Address to access the target application.
  • step S30 specifically includes:
  • the external service of the target application is realized through the domain name and the valid POD address.
  • the effective POD address is configured to the nginx configuration file, that is, the effective POD address is used as the current access path of the target application, and based on the nginx configuration file, the target application is accessed
  • the traffic is imported to the valid POD address, and then the external service of the target application is realized based on the valid POD address and the domain name.
  • the access address filled in is usually a domain name. In order to identify which application the domain name refers to, it is necessary to perform domain name resolution on the domain name to obtain the IP pointing to the target address.
  • the DNS Domain Name System
  • DNS pan-resolution refers to adding any sub-domain name before the domain name to access the pointed WEB address. In this way, "*. domain name" can be resolved to the same IP.
  • the advantage of domain name resolution is that it can resolve applications that users need to access to the correct server in a manner similar to fuzzy matching.
  • DNS pan-resolution can be used, so that the application that the user needs to access is resolved to the corresponding server.
  • the corresponding server here is the nginx server registered by the service agent shown above. The nginx service will match the complete domain name and jump to the real application service address to access the actual container address.
  • step S30 it further includes:
  • the application monitors the configuration changes of the application in the dynamic configuration platform of the service domain name by monitoring computer-readable instructions. Then, the corresponding nginx configuration is dynamically adjusted according to the configuration changes, and the container traffic is imported by nginx. Then, when it is monitored that the target application is offline, or the valid POD address of the target application cannot be parsed, the nginx configuration file of the target application can be deleted.
  • This embodiment provides a method for dynamically configuring service domain names, that is, when the application traffic is monitored, the application name and port of the target application are obtained, and the corresponding domain name is generated according to the application name; based on the proxy server nginx, the resolution The POD address of the target application is determined, and the effective POD address corresponding to the target application is determined; the effective POD address is configured to the nginx configuration file, and the external service of the target application is realized based on the nginx configuration file and domain name.
  • this application analyzes the POD address of the target application based on nginx in real time to determine the effective POD address of the target application, and then automatically implements domain name configuration based on the effective POD address and nginx configuration file without manual intervention, which greatly reduces manpower Cost, improve the efficiency of operation and maintenance, and solve the technical problem of manual configuration of existing service domain names.
  • Fig. 3 is a schematic flowchart of a second embodiment of a method for dynamically configuring a service domain name for application.
  • the method further includes:
  • Step S41 Obtain a target namespace corresponding to the target application, and determine whether the domain name conflicts based on a preset namespace table and the target namespace;
  • namespace is a namespace
  • namespace is mainly used to combine and reuse codes. It is mainly to solve the conflict problem caused by the same variable name.
  • this application can be defined in the namespace to avoid, for example, application name conflicts between different versions of the same application.
  • each application has a unique namespace.
  • Each application will have a unique namespace. Therefore, you can determine whether there is a namespace corresponding to the application by querying the namespace table.
  • the namespace table is a set of namespaces corresponding to other deployed applications.
  • the namespace corresponding to each deployed application will be recorded in the server to form a namespace table. If the namespace corresponding to the application exists in the namespace table, it indicates a domain name conflict. If the namespace corresponding to the application does not exist in the namespace table, the domain name does not conflict.
  • Step S42 If the domain name conflicts, it is determined that the domain name has been used, and a reminder message for reapplying for a domain name is generated and displayed.
  • the server may send a notification to the client, thereby prompting the developer to reapply for the domain name.
  • the server may send a notification to the client, thereby prompting the developer to reapply for the domain name.
  • step S41 it further includes:
  • step S30 is executed.
  • Fig. 4 is a schematic flowchart of a third embodiment of a method for dynamically configuring a service domain name for application.
  • the step S20 specifically includes:
  • Step S21 Obtain all the POD addresses of the target application, analyze the POD addresses of the target application based on the proxy server nginx, and determine whether all the POD addresses have valid POD addresses;
  • the POD address of the target application that is resolved by the nginx-based jdomain plug-in combined with the kubernetes Service is the effective POD address. If the valid address does not exist in all the POD addresses of the target application, it means that the back-end service POD addresses of the target application are all invalid, which means that the target application has been offline.
  • step S22 if the valid POD address exists, the valid POD address is acquired.
  • the POD address is obtained as a valid POD address.
  • Step S23 If the valid POD address does not exist, an invalid address reminder message is generated, and the nginx configuration file corresponding to the target application is deleted.
  • the valid address does not exist in all the POD addresses of the target application, it means that the back-end service POD addresses of the target application are all invalid, which means that the target application has been offline and is detected When the target application goes offline, that is, the target application no longer serves externally, the nginx configuration file corresponding to the target application can be deleted.
  • the method for dynamically configuring the service domain name further includes:
  • the effective POD address is replaced according to the analysis result, the replaced effective address is configured to the configuration file of nginx, and the external service of the target application is realized based on the configuration file of nginx and the domain name.
  • the effective POD address may change during the external service process of the target application.
  • This application monitors the application configuration changes in the container in real time based on monitoring computer-readable instructions.
  • the jdomain plug-in based on nginx combined with the service of kubernetes secondly analyzes the POD of the target application address.
  • the target application can be analyzed in real time based on the jdomain plug-in of nginx and the Service of kubernetes. If the valid POD corresponding to the analysis result of the secondary analysis changes, the current valid POD address is obtained, and the current valid POD address is replaced with the valid POD address in the nginx configuration file. And the access traffic of the target application is imported to the current valid POD address, so as to provide services to the domain name through the current valid POD address.
  • the embodiment of the present application also provides a dynamic configuration device for a service domain name.
  • Fig. 5 is a schematic diagram of the functional modules of the first embodiment of the dynamic configuration device for applying for a service domain name.
  • the device for dynamically configuring the service domain name includes:
  • the domain name generation module 10 is used to obtain the application name and port of the target application when the application traffic changes are monitored, and generate a corresponding domain name according to the application name;
  • the server After deploying multiple container instances of an application on the Kubernetes-based PaaS platform (hereinafter referred to as the server), it is usually necessary to expose the service to the outside and configure the domain name corresponding to the application to enable external users
  • the deployed application can be accessed through the domain name.
  • Developers can create application instances on the server.
  • Kubernetes can automatically deploy the application instance to the container.
  • Kubernetes is an open source container cluster management system, which provides application deployment, maintenance, high-availability management, flexible expansion mechanism and other functions, and is packaged into a complete and easy-to-use API to provide external services. Generally, using Kubernetes can easily manage containerized applications running across machines.
  • PaaS(Platform as a Service) is a kind of service that takes the running and development environment of application services as a service and submits it to users in the SaaS mode. Therefore, PaaS is also an application of the SaaS model. PaaS can increase the number of resources utilized on the Web platform. For example, you can use Data-as-a-Service (Data-as-a-Service) through remote Web services, and you can also use visual APIs. Users or manufacturers can quickly develop the applications and products they need based on the PaaS platform.
  • Data-as-a-Service Data-as-a-Service
  • a dynamic configuration method of the service domain name is provided, which is applied to the dynamic configuration platform of the service domain name.
  • the dynamic configuration platform of the service domain name can automatically generate the domain name of the application.
  • the domain name corresponding to the application can be generated according to certain preset rules, for example, according to the spelling of the application name or the English translation. For example, if the Chinese application name of an application is "taobao", the pinyin "taobao" corresponding to "taobao" can be automatically used as the domain name of the application.
  • the address resolution module 20 is configured to analyze the POD address of the target application based on the proxy server nginx, and determine the effective POD address corresponding to the target application;
  • the POD address container in the container is changed, so that the application cannot be accessed by the outside (public network). Therefore, the dynamic configuration platform of the service domain name needs to obtain the effective POD address of the target application in real time, that is, through the nginx plug-in jdomain and the kubernetes Serverless mode to dynamically resolve the POD address corresponding to the application deployed in the container, thereby determining the target The valid POD address of the application, and then the valid POD address enables the target application to be accessed from the outside normally.
  • the domain name configuration module 30 is configured to configure the effective POD address to a configuration file of nginx, and implement external services of the target application based on the configuration file of nginx and the domain name.
  • the Nginx is a high-performance HTTP and reverse proxy server.
  • the Nginx When the Nginx is used as a web server, it has the characteristics of less memory and strong concurrency.
  • the Nginx When the Nginx is used as a load balancing server, it can directly support Rails and PHP internally, and can also support external services as an HTTP proxy server.
  • service agent registration By configuring the valid POD to the configuration file of the nginx server, service agent registration is completed. Based on the nginx configuration file and domain name, the external service of the target application is realized, that is, the user can pass the valid Address to access the target application.
  • domain name configuration module 30 specifically includes:
  • a traffic import unit configured to configure the valid POD address to a configuration file of nginx, and import access traffic to the valid POD address based on the configuration file of nginx;
  • the service configuration unit is used to realize the external service of the target application through the domain name and the valid POD address.
  • domain name configuration module 30 further includes:
  • the file deletion module is used to delete the nginx configuration file corresponding to the target application when it is detected that the target application is offline.
  • the device for dynamically configuring the service domain name further includes:
  • the domain name judgment module is configured to obtain the target namespace corresponding to the target application, and determine whether the domain name conflicts based on the preset namespace table and the target namespace;
  • the reiteration reminder module is used for determining that the domain name has been used if the domain name conflicts, and generating and displaying a reminder message for reapplying for a domain name.
  • the address resolution module 20 specifically includes:
  • the address judging unit is configured to obtain all the POD addresses of the target application, analyze the POD addresses of the target application based on the proxy server nginx, and determine whether all the POD addresses have valid POD addresses;
  • the address determining unit is configured to obtain the valid POD address if the valid POD address exists.
  • the file deletion unit is configured to generate an invalid address reminding message if the valid POD address does not exist, and delete the nginx configuration file corresponding to the target application.
  • the device for dynamically configuring the service domain name further includes:
  • the secondary analysis module is used to perform secondary analysis on the POD address of the target application based on the proxy server nginx when the effective POD of the target application is detected to change;
  • the address replacement module is used to replace the valid POD address according to the analysis result, configure the replaced valid address to the nginx configuration file, and implement the external service of the target application based on the nginx configuration file and domain name.
  • each module in the above-mentioned service domain name dynamic configuration device corresponds to each step in the above-mentioned embodiment of the service domain name dynamic configuration method, and its functions and implementation processes will not be repeated here.
  • the embodiments of the present application also provide a computer-readable storage medium, and the computer-readable storage medium may be a non-volatile readable storage medium.
  • the computer-readable storage medium of the present application stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the above-mentioned method for dynamic configuration of service domain names are realized.

Landscapes

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

Abstract

本申请提供一种服务域名的动态配置方法、装置、设备及存储介质,即在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。本申请基于nginx实时解析目标应用的POD地址,从而确定有效POD地址,然后结合nginx的配置文件自动实现域名配置,不仅大大降低了人力成本,而且实现了发布过程优化提高了运维效率,解决了现有服务的域名需要人工进行配置的技术问题。

Description

服务域名的动态配置方法、装置、设备及存储介质
本申请要求于2019年1月17日提交中国专利局、申请号为201910042705.2、发明名称为“服务域名的动态配置方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及计算机技术领域,尤其涉及一种服务域名的动态配置方法、装置、设备及计算机可读存储介质。
背景技术
随着云计算的快速发展,虚拟化时代已经到来。在虚拟化时代,采用标配硬件可以降低成本,采用虚拟化技术可以满足用户按需使用资源的需求,并可以保证资源的可用性和隔离性。其中,Docker(应用容器引擎)技术以其轻量、高性能、便捷性广受欢迎。Docker是一个开放源代码软件项目,让应用部署在软件容器下的工作可以自动化进行。开发者开发了一款应用后,需要将其部署在容器中,并需要对外提供服务,针对该服务需要配置一个域名,使得外部可以利用该域名访问应用获取服务。现有服务的域名需要人工进行配置,不仅提高了人工成本,而且降低了运维效率。
因此,如何解决现有服务的域名需要人工进行配置的技术问题,是目前亟需解决的问题。
发明内容
本申请的主要目的在于提供一种服务域名的动态配置方法、装置、设备及计算机可读存储介质,旨在解决现有服务的域名需要人工进行配置的技术问题。
为实现上述目的,本申请提供一种服务域名的动态配置方法,所述服务域名的动态配置方法包括以下步骤:
在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
可选地,所述在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名的步骤之后,还包括:
获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
可选地,所述将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务的步骤具体包括:
将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
通过所述域名以及有效POD地址实现所述目标应用的对外服务。
可选地,所述基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址的步骤具体包括:
获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
若存在所述有效的POD地址,则获取所述有效POD地址。
可选地,所述获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址的步骤之后,还包括:
若不存在所述有效的POD地址,则生成无效地址提醒消息,并删除所述目标应用对应的nginx的配置文件。
可选地,所述服务域名的动态配置方法还包括:
在监测到所述目标应用的有效POD发生变化时,基于代理服务器nginx,对所述目标应用的POD地址进行二次解析;
根据解析结果将所述有效POD地址进行更换,将更换后的有效地址配置至nginx的配置文件,并基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
可选地,所述将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务的步骤之后,还包括:
在监测到所述目标应用下线时,删除所述目标应用对应的nginx的配置文件。
此外,为实现上述目的,本申请还提供 一种服务域名的动态配置装置,所述服务域名的动态配置装置包括:
域名生成模块,用于在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
地址解析模块,用于基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
域名配置模块,用于将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
此外,为实现上述目的,本申请还提供一种服务域名的动态配置设备,所述服务域名的动态配置设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机可读指令,其中所述计算机可读指令被所述处理器执行时,实现如上述的服务域名的动态配置方法的步骤。
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如上述的服务域名的动态配置方法的步骤。
本申请提供一种服务域名的动态配置方法,即在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。通过上述方式,本申请基于nginx实时解析目标应用的POD地址,从而确定所述目标应用的有效POD地址,然后基于有效POD地址以及nginx的配置文件自动实现域名配置,无需人工干预,大大降低了人力成本,提高了运维效率,解决了现有服务的域名需要人工进行配置的技术问题。
附图说明
图1为本申请实施例方案中涉及的服务域名的动态配置设备的硬件结构示意图;
图2为本申请服务域名的动态配置方法第一实施例的流程示意图;
图3为本申请服务域名的动态配置方法第二实施例的流程示意图;
图4为本申请服务域名的动态配置方法第三实施例的流程示意图;
图5为本申请服务域名的动态配置装置第一实施例的功能模块示意图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
具体实施方式
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
本申请实施例涉及的服务域名的动态配置方法主要应用于服务域名的动态配置设备,该服务域名的动态配置设备可以是PC、便携计算机、移动终端等具有显示和处理功能的设备。
参照图1,图1为本申请实施例方案中涉及的服务域名的动态配置设备的硬件结构示意图。本申请实施例中,服务域名的动态配置设备可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。
本领域技术人员可以理解,图1中示出的硬件结构并不构成对服务域名的动态配置设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及计算机可读指令。
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的计算机可读指令,并执行本申请实施例提供的服务域名的动态配置方法。
本申请实施例提供了一种服务域名的动态配置方法。
参照图2,图2为本申请服务域名的动态配置方法第一实施例的流程示意图。
本实施例中,所述服务域名的动态配置方法包括以下步骤:
步骤S10,在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
现有开发中在基于Kubernetes的PaaS平台(以下称为服务端)上部署某个应用的多个容器实例后,通常还需要对外暴露服务,并需要配置对应该应用的域名,从而可以使得外部用户可以通过所述域名访问部署的应用。开发者可以在服务端上创建应用的实例。而Kubernetes可以自动地将该应用的实例部署到容器中。
Kubernetes是一种开源的容器集群管理系统,其提供应用部署、维护、高可用管理,弹性伸缩扩展机制等功能,并封装成为一套完整、简单易用的API对外提供服务。一般的,利用Kubernetes可以方便地管理跨机器运行容器化的应用。
PaaS(Platform as a service,平台即服务),是一种把应用服务的运行和开发环境作为一种服务,以SaaS的模式提交给用户。因此,PaaS也是SaaS模式的一种应用。PaaS可以提高在Web平台上利用的资源数量。例如,可通过远程Web服务使用数据即服务(Data-as-a-Service:数据即服务),还可以使用可视化的API。用户或者厂商基于PaaS平台可以快速开发自己所需要的应用和产品。
本实施例中,为了解决现有服务的域名需要人工进行配置的技术问题,提供一种服务域名的动态配置方法,应用于服务域名的动态配置平台。具体地,在首次部署应用时,服务域名的动态配置平台可以自动生成该应用的域名。通常,可以根据一定预设的规则,例如根据应用名的全拼或者英文翻等方式,生成该应用对应的域名。例如,某个应用的中文应用名为“淘宝”,则可以自动将“淘宝”对应的拼音“taobao”作为应用的域名。
步骤S20,基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
本实施例中,容器中的POD地址容器发生改变,从而导致应用无法被外部(公网)访问。因此,服务域名的动态配置平台需要实时获取目标应用的有效POD地址,即通过nginx的插件jdomain并结合kubernetes的Serverless模式对部署在容器中的应用对应的POD地址进行动态解析,从而确定所述目标应用的有效POD地址,然后通过所述有效POD地址使得目标应用可以正常地被外部访问。
步骤S30,将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
本实施例中,所述Nginx时一个高性能的HTTP和反向代理服务器。在所述Nginx作为Web服务器时,具有占用内存少,并发能力强的特定。在所述Nginx作为负载均衡服务器时,既可以在内部直接支持Rails和PHP,也可以支持作为HTTP代理服务器对外进行服务。通过将所述有效POD配置到nginx服务器的配置文件,从而完成服务代理注册,基于所述nginx的配置文件以及域名,实现所述目标应用的对外服务,即用户可以通过所述域名经由所述有效地址访问所述目标应用。
进一步地,所述步骤S30具体包括:
将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
通过所述域名以及有效POD地址实现所述目标应用的对外服务。
本实施例中,将所述有效POD地址配置至nginx的配置文件,即将所述有效POD地址作为所述目标应用的当前访问路径,并基于所述nginx的配置文件,将所述目标应用的访问流量导入至所述有效POD地址,然后基于所述有效POD地址以及所述域名实现所述目标应用的对外服务。其中,用户使用客户端(如电脑)访问应用时,填写的访问地址通常是域名。而为了识别域名具体是指向哪一个应用,需要对域名进行域名解析,得到指向目标地址的IP。具体地,通过DNS服务器实现,可以理解的,在客户端与应用服务器之间,会设置有一个用于进行DNS解析的DNS服务器。所述DNS(Domain Name System,域名系统)是因特网上作为域名和IP地址相互映射的一个分布式数据库,能够使用户更方便的访问互联网,而不用去记住能够被机器直接读取的IP。所述域名泛解析(DNS泛解析)是指在域名前添加任何子域名,均可以访问到指向的WEB地址。通过这种方式可以将“*.域名”解析到同一IP。域名解析的优点是可以通过类似于模糊匹配的方式将用户需要访问的应用解析到正确的服务器上。例如,在用户访问应用后,即使DNS服务器对域名进行NDS解析后得出该域名不存在对应的IP的情况下,还可以通过DNS泛解析,从而用户需要访问的应用解析到对应的服务器上。这里的对应的服务器即为上述所示的服务代理注册的nginx服务器。该nginx服务会对完整的域名进行匹配,从而跳转到真正的应用服务地址,从而访问实际的容器地址。
进一步地,所述步骤S30之后,还包括:
在监测到所述目标应用下线时,删除所述目标应用对应的nginx的配置文件。
本实施例中,本申请通过监听计算机可读指令监听所述服务域名的动态配置平台中的应用的配置变化。然后根据所述配置变化动态调整对应的nginx配置,并由nginx完成容器流量的导入。然后在监听到所述目标应用下线时,或者是解析不出所述目标应用的有效POD地址时,即可删除所述目标应用的nginx的配置文件。
本实施例提供一种服务域名的动态配置方法,即在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。通过上述方式,本申请基于nginx实时解析目标应用的POD地址,从而确定所述目标应用的有效POD地址,然后基于有效POD地址以及nginx的配置文件自动实现域名配置,无需人工干预,大大降低了人力成本,提高了运维效率,解决了现有服务的域名需要人工进行配置的技术问题。
参照图3,图3为本申请服务域名的动态配置方法第二实施例的流程示意图。
基于上述图2所示实施例,本实施例中,所述步骤S10之后,还包括:
步骤S41,获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
本实施例中,namespace即命名空间,namespace主要用于组合和重用代码。其主要是为了解决变量的重名导致的冲突问题。通过引入namespace,就可以在namespace中定义本应用,避免例如同一应用不同版本之间应用名冲突的情况。一般来说,每一个应用都会对应有一个唯一的namespace。每一个应用都会对应有一个唯一的namespace。因此,可以根据查询namespace表,判断是否存在该应用对应的namespace。所述namespace表是已经部署的其它应用对应的namespace集合。一般,服务端中会记录每一个部署应用对应的namespace,从而形成namespace表。如果namespace表中存在该应用对应的namespace,则说明域名冲突。如果namespace表中不存在该应用对应的namespace,则说明域名不冲突。
步骤S42,若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
本实施例中,在域名冲突的情况下,服务端可以向客户端发送通知,从而提示开发者重新申请域名。通过上述方式,开发中用户仅需提交应用名、端口就可以实现自动配置对外提供服务的域名,并自动处理域名冲突问题,从而避免域名冲突。另一方面的,由于nginx还可以作为负载均衡服务器,所以通过nainx可以实现容器内应用服务施力的负载均衡。
进一步地,所述步骤S41之后,还包括:
若所述域名冲突,则执行步骤S30。
参照图4,图4为本申请服务域名的动态配置方法第三实施例的流程示意图。
基于上述图3所示实施例,本实施例中,所述步骤S20具体包括:
步骤S21,获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
本实施例中,基于nginx的jdomain插件结合kubernetes的Service解析出的所述目标应用的POD地址即为有效POD地址。若所述目标应用的全部POD地址中不存在所述有效地址,即说明目标应用的后端服务POD地址全部无效,也就是表示,所述目标应用已经下线。
步骤S22,若存在所述有效的POD地址,则获取所述有效POD地址。
本实施例中,若所述于nginx的jdomain插件结合kubernetes的Service解析出所述目标应用的POD地址,即获取该POD地址,作为有效POD地址。
步骤S23,若不存在所述有效的POD地址,则生成无效地址提醒消息,并删除所述目标应用对应的nginx的配置文件。
本实施例中,若所述目标应用的全部POD地址中不存在所述有效地址,即说明目标应用的后端服务POD地址全部无效,也就是表示,所述目标应用已经下线,在检测到所述目标应用下线时,即所述目标应用已不再对外服务,可删除所述目标应用对应的nginx的配置文件。
进一步地,所述服务域名的动态配置方法还包括:
在监测到所述目标应用的有效POD发生变化时,基于代理服务器nginx,对所述目标应用的POD地址进行二次解析;
根据解析结果将所述有效POD地址进行更换,将更换后的有效地址配置至nginx的配置文件,并基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
本实施例中,所述目标应用在对外服务过程中,有效POD地址可能会发生变化。本申请基于监听计算机可读指令对容器中的应用配置变化进行实时监控,在监测到目标应用的POD地址发生流量变化时,基于nginx的jdomain插件结合kubernetes的Service二次解析所述目标应用的POD地址。具体实施例中,还可以基于nginx的jdomain插件结合kubernetes的Service实时解析所述目标应用。若二次解析的解析结果对应的有效POD发生变化时,获取当前的有效POD地址,并将所述当前的有效POD地址替换所述nginx的配置文件中的有效POD地址。并将所述目标应用的访问流量由导入至所述当前的有效的POD地址,从而通过所述当前有效POD地址对所述域名提供服务。
此外,本申请实施例还提供一种服务域名的动态配置装置。
参照图5,图5为本申请服务域名的动态配置装置第一实施例的功能模块示意图。
本实施例中,所述服务域名的动态配置装置包括:
域名生成模块10,用于在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
现有开发中在基于Kubernetes的PaaS平台(以下称为服务端)上部署某个应用的多个容器实例后,通常还需要对外暴露服务,并需要配置对应该应用的域名,从而可以使得外部用户可以通过所述域名访问部署的应用。开发者可以在服务端上创建应用的实例。而Kubernetes可以自动地将该应用的实例部署到容器中。
Kubernetes是一种开源的容器集群管理系统,其提供应用部署、维护、高可用管理,弹性伸缩扩展机制等功能,并封装成为一套完整、简单易用的API对外提供服务。一般的,利用Kubernetes可以方便地管理跨机器运行容器化的应用。
PaaS(Platform as a service,平台即服务),是一种把应用服务的运行和开发环境作为一种服务,以SaaS的模式提交给用户。因此,PaaS也是SaaS模式的一种应用。PaaS可以提高在Web平台上利用的资源数量。例如,可通过远程Web服务使用数据即服务(Data-as-a-Service:数据即服务),还可以使用可视化的API。用户或者厂商基于PaaS平台可以快速开发自己所需要的应用和产品。
本实施例中,为了解决现有服务的域名需要人工进行配置的技术问题,提供一种服务域名的动态配置方法,应用于服务域名的动态配置平台。具体地,在首次部署应用时,服务域名的动态配置平台可以自动生成该应用的域名。通常,可以根据一定预设的规则,例如根据应用名的全拼或者英文翻等方式,生成该应用对应的域名。例如,某个应用的中文应用名为“淘宝”,则可以自动将“淘宝”对应的拼音“taobao”作为应用的域名。
地址解析模块20,用于基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
本实施例中,容器中的POD地址容器发生改变,从而导致应用无法被外部(公网)访问。因此,服务域名的动态配置平台需要实时获取目标应用的有效POD地址,即通过nginx的插件jdomain并结合kubernetes的Serverless模式对部署在容器中的应用对应的POD地址进行动态解析,从而确定所述目标应用的有效POD地址,然后通过所述有效POD地址使得目标应用可以正常地被外部访问。
域名配置模块30,用于将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
本实施例中,所述Nginx时一个高性能的HTTP和反向代理服务器。在所述Nginx作为Web服务器时,具有占用内存少,并发能力强的特定。在所述Nginx作为负载均衡服务器时,既可以在内部直接支持Rails和PHP,也可以支持作为HTTP代理服务器对外进行服务。通过将所述有效POD配置到nginx服务器的配置文件,从而完成服务代理注册,基于所述nginx的配置文件以及域名,实现所述目标应用的对外服务,即用户可以通过所述域名经由所述有效地址访问所述目标应用。
进一步地,所述域名配置模块30具体包括:
流量导入单元,用于将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
服务配置单元,用于通过所述域名以及有效POD地址实现所述目标应用的对外服务。
进一步地,所述域名配置模块30还包括:
文件删除模块,用于在监测到所述目标应用下线时,删除所述目标应用对应的nginx的配置文件。
进一步地,所述服务域名的动态配置装置还包括:
域名判断模块,用于获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
重申提醒模块,用于若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
进一步地,所述地址解析模块20具体包括:
地址判断单元,用于获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
地址确定单元,用于若存在所述有效的POD地址,则获取所述有效POD地址。
文件删除单元,用于若不存在所述有效的POD地址,则生成无效地址提醒消息,并删除所述目标应用对应的nginx的配置文件。
进一步地,所述服务域名的动态配置装置还包括:
二次解析模块,用于在监测到所述目标应用的有效POD发生变化时,基于代理服务器nginx,对所述目标应用的POD地址进行二次解析;
地址更换模块,用于根据解析结果将所述有效POD地址进行更换,将更换后的有效地址配置至nginx的配置文件,并基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
其中,上述服务域名的动态配置装置中各个模块与上述服务域名的动态配置方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。
此外,本申请实施例还提供一种计算机可读存储介质,计算机可读存储介质可以为非易失性可读存储介质。
本申请计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如上述的服务域名的动态配置方法的步骤。
其中,计算机可读指令被执行时所实现的方法可参照本申请服务域名的动态配置方法的各个实施例,此处不再赘述。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (20)

  1. 一种服务域名的动态配置方法,其中,所述服务域名的动态配置方法包括以下步骤:
    在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
    基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
    将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
  2. 如权利要求1所述的服务域名的动态配置方法,其中,所述在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名的步骤之后,还包括:
    获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
    若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
  3. 如权利要求1所述的服务域名的动态配置方法,其中,所述将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务的步骤具体包括:
    将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
    通过所述域名以及有效POD地址实现所述目标应用的对外服务。
  4. 如权利要求1所述的服务域名的动态配置方法,其中,所述基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址的步骤具体包括:
    获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
    若存在所述有效的POD地址,则获取所述有效POD地址。
  5. 如权利要求4所述的服务域名的动态配置方法,其中,所述获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址的步骤之后,还包括:
    若不存在所述有效的POD地址,则生成无效地址提醒消息,并删除所述目标应用对应的nginx的配置文件。
  6. 如权利要求1所述的服务域名的动态配置方法,其中,所述服务域名的动态配置方法还包括:
    在监测到所述目标应用的有效POD发生变化时,基于代理服务器nginx,对所述目标应用的POD地址进行二次解析;
    根据解析结果将所述有效POD地址进行更换,将更换后的有效地址配置至nginx的配置文件,并基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
  7. 如权利要求1所述的服务域名的动态配置方法,其中,所述将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务的步骤之后,还包括:
    在监测到所述目标应用下线时,删除所述目标应用对应的nginx的配置文件。
  8. 一种服务域名的动态配置装置,其中,所述服务域名的动态配置装置包括:
    域名生成模块,用于在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
    地址解析模块,用于基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
    域名配置模块,用于将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
  9. 如权利要求8所述的服务域名的动态配置装置,其中,所述域名配置模块具体包括:
    流量导入单元,用于将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
    服务配置单元,用于通过所述域名以及有效POD地址实现所述目标应用的对外服务。
  10. 如权利要求8所述的服务域名的动态配置装置,其中,所述域名配置模块还包括:
    文件删除模块,用于在监测到所述目标应用下线时,删除所述目标应用对应的nginx的配置文件。
  11. 如权利要求8所述的服务域名的动态配置装置,其中,所述服务域名的动态配置装置还包括:
    域名判断模块,用于获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
    重申提醒模块,用于若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
  12. 如权利要求8所述的服务域名的动态配置装置,其中,所述地址解析模块具体包括:
    地址判断单元,用于获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
    地址确定单元,用于若存在所述有效的POD地址,则获取所述有效POD地址。
    文件删除单元,用于若不存在所述有效的POD地址,则生成无效地址提醒消息,并删除所述目标应用对应的nginx的配置文件。
  13. 一种服务域名的动态配置设备,其中,所述服务域名的动态配置设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的服务域名的动态配置程序计算机可读指令,其中所述服务域名的动态配置程序计算机可读指令被所述处理器执行时,实现如下步骤:
    在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
    基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
    将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
  14. 如权利要求13所述的服务域名的动态配置设备,其中,所述在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名的步骤之后,还包括:
    获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
    若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
  15. 如权利要求13所述的服务域名的动态配置设备,其中,所述将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务的步骤具体包括:
    将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
    通过所述域名以及有效POD地址实现所述目标应用的对外服务。
  16. 如权利要求13所述的服务域名的动态配置设备,其中,所述基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址的步骤具体包括:
    获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
    若存在所述有效的POD地址,则获取所述有效POD地址。
  17. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存储有计算机可读指令,其中所述计算机可读指令被处理器执行时,实现如下步骤:
    在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名;
    基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址;
    将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务。
  18. 如权利要求17所述的计算机可读存储介质,其中,所述在监测到应用流量发生变化时,获取目标应用的应用名以及端口,并根据所述应用名生成对应的域名的步骤之后,还包括:
    获取所述目标应用对应的目标命名空间,并基于预设命名空间表与所述目标命名空间,判断所述域名是否冲突;
    若所述域名冲突,则判定所述域名已被使用,生成并显示重新申请域名的提醒消息。
  19. 如权利要求17所述的计算机可读存储介质,其中,所述将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件以及域名实现所述目标应用的对外服务的步骤具体包括:
    将所述有效POD地址配置至nginx的配置文件,基于所述nginx的配置文件将访问流量导入至所述有效POD地址;
    通过所述域名以及有效POD地址实现所述目标应用的对外服务。
  20. 如权利要求17所述的计算机可读存储介质,其中,所述基于代理服务器nginx,解析所述目标应用的POD地址,并确定所述目标应用对应的有效POD地址的步骤具体包括:
    获取所述目标应用的全部POD地址,基于代理服务器nginx,解析所述目标应用的POD地址,并判断所述全部POD地址是否存在有效的POD地址;
    若存在所述有效的POD地址,则获取所述有效POD地址。
PCT/CN2019/117193 2019-01-17 2019-11-11 服务域名的动态配置方法、装置、设备及存储介质 WO2020147396A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910042705.2A CN109714449B (zh) 2019-01-17 2019-01-17 服务域名的动态配置方法、装置、设备及存储介质
CN201910042705.2 2019-01-17

Publications (1)

Publication Number Publication Date
WO2020147396A1 true WO2020147396A1 (zh) 2020-07-23

Family

ID=66262179

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117193 WO2020147396A1 (zh) 2019-01-17 2019-11-11 服务域名的动态配置方法、装置、设备及存储介质

Country Status (2)

Country Link
CN (1) CN109714449B (zh)
WO (1) WO2020147396A1 (zh)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187737A (zh) * 2020-09-10 2021-01-05 中信银行股份有限公司 一种PaaS容器云平台环境下的结合WAF的防护方法
CN112243036A (zh) * 2020-10-21 2021-01-19 北京首都在线科技股份有限公司 PaaS服务的数据处理方法及装置、设备、存储介质
CN112311786A (zh) * 2020-10-28 2021-02-02 北京健康之家科技有限公司 一种服务请求处理方法、装置、存储介质及计算设备
CN113286014A (zh) * 2021-05-24 2021-08-20 平安普惠企业管理有限公司 基础域名的动态配置方法、装置及相关设备
CN113395370A (zh) * 2021-06-23 2021-09-14 上海众言网络科技有限公司 自动化配置自定义域名的方法及装置
CN114070588A (zh) * 2021-11-01 2022-02-18 上海派拉软件股份有限公司 一种基于nginx的域名证书更新方法及装置
CN114374743A (zh) * 2022-01-13 2022-04-19 上海金融期货信息技术有限公司 支持多种服务发现机制的网关路由规则生成方法和系统
CN114491371A (zh) * 2022-01-27 2022-05-13 佛山众陶联供应链服务有限公司 一种web系统前端多系统跳转方法及系统
CN114844859A (zh) * 2022-05-05 2022-08-02 北京达佳互联信息技术有限公司 域名配置方法、装置、电子设备及存储介质

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109714449B (zh) * 2019-01-17 2022-05-17 平安科技(深圳)有限公司 服务域名的动态配置方法、装置、设备及存储介质
CN110427249A (zh) * 2019-07-26 2019-11-08 重庆紫光华山智安科技有限公司 任务分配方法、pod初始化方法及相关装置
CN111010405B (zh) * 2019-12-30 2021-10-22 上海电子信息职业技术学院 一种SaaS化的网站安全监控系统
CN111182089B (zh) * 2019-12-31 2022-09-20 北京金山云网络技术有限公司 容器集群系统和访问大数据组件的方法、装置及服务器
CN112115056A (zh) * 2020-09-23 2020-12-22 北京达佳互联信息技术有限公司 一种项目部署方法和装置、服务器、存储介质
CN113079207B (zh) * 2021-03-26 2022-07-08 重庆紫光华山智安科技有限公司 一种实现端口或网络高可用的方法、系统、终端及介质
CN115065729B (zh) * 2022-05-24 2023-10-17 亚太卫星宽带通信(深圳)有限公司 一种基于Kubernetes的边缘应用沙盒移植方法

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107172176A (zh) * 2017-06-02 2017-09-15 美味不用等(上海)信息科技股份有限公司 基于配置管理的app网络连接方法、设备及配置服务器
CN107302604A (zh) * 2017-06-30 2017-10-27 挖财网络技术有限公司 基于Kubernetes的PaaS平台域名配置方法及装置和电子设备
US20180039494A1 (en) * 2016-08-05 2018-02-08 Oracle International Corporation Zero down time upgrade for a multi-tenant identity and data security management cloud service
CN109714449A (zh) * 2019-01-17 2019-05-03 平安科技(深圳)有限公司 服务域名的动态配置方法、装置、设备及存储介质

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302771A (zh) * 2016-08-23 2017-01-04 浪潮电子信息产业股份有限公司 一种基于Docker容器创建的应用的域名配置方法
CN109104317B (zh) * 2018-08-22 2021-06-29 中科曙光国际信息产业有限公司 基于Docker容器的大数据集群自动配置方法及装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180039494A1 (en) * 2016-08-05 2018-02-08 Oracle International Corporation Zero down time upgrade for a multi-tenant identity and data security management cloud service
CN107172176A (zh) * 2017-06-02 2017-09-15 美味不用等(上海)信息科技股份有限公司 基于配置管理的app网络连接方法、设备及配置服务器
CN107302604A (zh) * 2017-06-30 2017-10-27 挖财网络技术有限公司 基于Kubernetes的PaaS平台域名配置方法及装置和电子设备
CN109714449A (zh) * 2019-01-17 2019-05-03 平安科技(深圳)有限公司 服务域名的动态配置方法、装置、设备及存储介质

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112187737A (zh) * 2020-09-10 2021-01-05 中信银行股份有限公司 一种PaaS容器云平台环境下的结合WAF的防护方法
CN112243036B (zh) * 2020-10-21 2022-03-15 北京首都在线科技股份有限公司 PaaS服务的数据处理方法及装置、设备、存储介质
CN112243036A (zh) * 2020-10-21 2021-01-19 北京首都在线科技股份有限公司 PaaS服务的数据处理方法及装置、设备、存储介质
CN112311786A (zh) * 2020-10-28 2021-02-02 北京健康之家科技有限公司 一种服务请求处理方法、装置、存储介质及计算设备
CN112311786B (zh) * 2020-10-28 2023-06-13 北京水滴科技集团有限公司 一种服务请求处理方法、装置、存储介质及计算设备
CN113286014A (zh) * 2021-05-24 2021-08-20 平安普惠企业管理有限公司 基础域名的动态配置方法、装置及相关设备
CN113395370B (zh) * 2021-06-23 2022-12-09 上海众言网络科技有限公司 自动化配置自定义域名的方法及装置
CN113395370A (zh) * 2021-06-23 2021-09-14 上海众言网络科技有限公司 自动化配置自定义域名的方法及装置
CN114070588A (zh) * 2021-11-01 2022-02-18 上海派拉软件股份有限公司 一种基于nginx的域名证书更新方法及装置
CN114374743A (zh) * 2022-01-13 2022-04-19 上海金融期货信息技术有限公司 支持多种服务发现机制的网关路由规则生成方法和系统
CN114374743B (zh) * 2022-01-13 2023-08-22 上海金融期货信息技术有限公司 支持多种服务发现机制的网关路由规则生成方法和系统
CN114491371A (zh) * 2022-01-27 2022-05-13 佛山众陶联供应链服务有限公司 一种web系统前端多系统跳转方法及系统
CN114491371B (zh) * 2022-01-27 2022-09-16 佛山众陶联供应链服务有限公司 一种web系统前端多系统跳转方法及系统
CN114844859A (zh) * 2022-05-05 2022-08-02 北京达佳互联信息技术有限公司 域名配置方法、装置、电子设备及存储介质

Also Published As

Publication number Publication date
CN109714449A (zh) 2019-05-03
CN109714449B (zh) 2022-05-17

Similar Documents

Publication Publication Date Title
WO2020147396A1 (zh) 服务域名的动态配置方法、装置、设备及存储介质
WO2020119117A1 (zh) 分布式计算方法、装置、系统、设备及可读存储介质
WO2020233077A1 (zh) 系统服务的监控方法、装置、设备及存储介质
WO2020077832A1 (zh) 云桌面的访问方法、装置、设备及存储介质
WO2020015064A1 (zh) 系统故障处理方法、装置、设备及存储介质
WO2020224246A1 (zh) 基于区块链的数据管理方法、装置、设备和存储介质
WO2021006616A1 (en) Method for providing relational decentralized identifier service and blockchain node using the same
WO2021012489A1 (zh) 电话平台日志查询方法、终端设备、存储介质及装置
WO2020186773A1 (zh) 调用请求监控方法、装置、设备及存储介质
WO2020087981A1 (zh) 风控审核模型生成方法、装置、设备及可读存储介质
WO2020147385A1 (zh) 数据录入方法、装置、终端及计算机可读存储介质
WO2020062640A1 (zh) 终端应用动态文案的语言切换方法、服务器及存储介质
WO2020147264A1 (zh) 多系统日志数据的监控方法、装置、设备及可读存储介质
WO2021072881A1 (zh) 基于对象存储的请求处理方法、装置、设备及存储介质
WO2020107761A1 (zh) 广告文案处理方法、装置、设备及计算机可读存储介质
EP2589179A2 (en) Apparatus and method for controlling access to multiple services
WO2020253135A1 (zh) 自动化分析方法、用户设备、存储介质及装置
WO2015103954A1 (en) Information sharing method, information sharing apparatus, and electronic device
WO2015018243A1 (zh) 一种基于iOS设备的网页拦截方法和设备
WO2020233073A1 (zh) 区块链环境检测方法、设备、装置及存储介质
WO2020119115A1 (zh) 数据审核方法、装置、设备及存储介质
WO2018184302A1 (zh) 数据转发方法、系统、虚拟负载均衡器及可读存储介质
WO2020062644A1 (zh) Json劫持漏洞的检测方法、装置、设备及存储介质
WO2020073494A1 (zh) 网页后门检测方法、设备、存储介质及装置
WO2016090775A1 (zh) 同步操作短信数据的方法及系统

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19910184

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19910184

Country of ref document: EP

Kind code of ref document: A1