CN107302604B - Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment - Google Patents
Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment Download PDFInfo
- Publication number
- CN107302604B CN107302604B CN201710521771.9A CN201710521771A CN107302604B CN 107302604 B CN107302604 B CN 107302604B CN 201710521771 A CN201710521771 A CN 201710521771A CN 107302604 B CN107302604 B CN 107302604B
- Authority
- CN
- China
- Prior art keywords
- domain name
- application
- name
- suffix
- condition
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/45—Network directories; Name-to-address mapping
- H04L61/4505—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols
- H04L61/4511—Network directories; Name-to-address mapping using standardised directories; using standardised directory access protocols using domain name system [DNS]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/09—Mapping addresses
- H04L61/10—Mapping addresses of different types
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5046—Resolving address allocation conflicts; Testing of addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/59—Network arrangements, protocols or services for addressing or naming using proxies for addressing
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Computer And Data Communications (AREA)
Abstract
The application provides a Kubernetes-based PaaS platform domain name configuration method and device, and the method comprises the following steps: receiving an application name and a port submitted by a client and generating a domain name according to the application name; creating an Ingress object according to the application name and the port and the domain name suffix; monitoring whether a new Ingress object is created; under the condition that a new Ingress object is monitored to be created, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix; and configuring the new domain name to a configuration file of the nginx server. By applying the embodiment of the application, the domain name of the application service can be automatically configured.
Description
Technical Field
The application relates to the technical field of computing, in particular to a Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment.
Background
Generally, after a developer develops a type of application, the application needs to be deployed in a container and needs to provide a service to the outside, and a domain name needs to be configured for the service, so that the outside can access the application by using the domain name to obtain the service.
Disclosure of Invention
The application provides a Kubernetes-based PaaS platform domain name configuration method and device, which aim to solve the problem of automatic domain name configuration in the prior art.
According to the method for configuring the domain name of the PaaS platform based on Kubernetes, which is provided by the embodiment of the application, the method comprises the following steps:
receiving an application name and a port submitted by a client and generating a domain name according to the application name;
creating an Ingress object according to the application name and the port and the domain name suffix;
monitoring whether a new Ingress object is created;
under the condition that a new Ingress object is monitored to be created, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix;
and configuring the new domain name to a configuration file of the nginx server.
Preferably, before creating an Ingress object according to the application name and port, and the domain name suffix, the method further comprises:
judging whether the domain names conflict or not;
the creating of the Ingress object according to the application name, the port and the domain name suffix specifically includes:
and under the condition that the domain names do not conflict, creating an Ingress object according to the application name and the port and the domain name suffix.
Preferably, the determining whether the domain name conflicts specifically includes:
acquiring a first namespace corresponding to the application;
comparing with second namespace corresponding to other deployed applications;
and determining the domain name conflict under the condition that the first namespace is the same as the second namespace.
According to the application access method provided by the embodiment of the application, the method comprises the following steps:
performing domain name extensive resolution on a domain name accessed by a user under the condition that the domain name resolution is failed;
judging whether a specific domain name suffix is contained;
under the condition that a specific domain name suffix is contained, resolving the domain name to a nginx server corresponding to the specific domain name suffix;
and returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy.
According to the device for configuring the domain name of the PaaS platform based on Kubernetes, provided by the embodiment of the application, the device comprises:
the receiving unit is used for receiving the application name and the port submitted by the client and generating a domain name according to the application name;
the creating unit is used for creating an Ingress object according to the application name, the port and the domain name suffix;
the monitoring unit monitors whether a new Ingress object is created or not;
the generating unit is used for generating a new domain name according to the application name, the corresponding namespace and the domain name suffix under the condition that the creation of a new Ingress object is monitored;
and the configuration unit is used for configuring the new domain name to a configuration file of the nginx server.
Preferably, before the creating unit, the apparatus further comprises:
the judging unit is used for judging whether the domain names conflict or not;
the creating unit specifically includes:
and under the condition that the domain names do not conflict, creating an Ingress object according to the application name and the port and the domain name suffix.
Preferably, the determining unit specifically includes:
the acquisition subunit acquires a first namespace corresponding to the application;
comparing the sub-unit with a second namespace corresponding to other deployed applications;
and the determining subunit determines the domain name conflict under the condition that the first namespace is the same as the second namespace.
According to an embodiment of the present application, an application access apparatus is provided, the apparatus including:
the domain name analyzing unit is used for performing domain name extensive analysis on the domain name accessed by the user under the condition that the domain name analysis fails;
a judging unit that judges whether or not a specific domain name suffix is contained;
a forwarding unit, which forwards the domain name to a nginx server corresponding to a specific domain name suffix under the condition that the domain name suffix is included;
and the return unit is used for returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy.
According to an embodiment of the present application, there is provided an electronic device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving an application name and a port submitted by a client and generating a domain name according to the application name;
creating an Ingress object according to the application name and the port and the domain name suffix;
monitoring whether a new Ingress object is created;
under the condition that a new Ingress object is monitored to be created, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix;
and configuring the new domain name to a configuration file of the nginx server.
According to an embodiment of the present application, there is provided an electronic device including:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
performing domain name extensive resolution on a domain name accessed by a user under the condition that the domain name resolution is failed;
judging whether a specific domain name suffix is contained;
under the condition that a specific domain name suffix is contained, resolving the domain name to a nginx server corresponding to the specific domain name suffix;
and returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy.
In the embodiment of the application, an application instance can be created on a PaaS platform by utilizing Kubernets, and the domain name providing service to the outside can be automatically configured and the domain name conflict problem can be automatically processed only by submitting an application name and a port in development; specifically, after a newly created Ingress object is monitored, a new domain name is automatically generated according to an application name, a corresponding namespace and a domain name suffix, so that domain name collision is avoided. On the other hand, since nginx can also be used as a load balancing server, load balancing of application service force application in the container can be realized through nainx.
Drawings
Fig. 1 is a flowchart of a domain name configuration method of a PaaS platform based on Kubernetes according to an embodiment of the present application;
FIG. 2 is a flowchart of an application access method provided by an embodiment of the present application;
fig. 3 is a schematic block diagram of a domain name configuration apparatus of a PaaS platform based on kubernets according to an embodiment of the present application;
fig. 4 is a block diagram of an application access device according to an embodiment of the present application;
fig. 5 is a schematic diagram of a hardware structure of a server according to an embodiment of the present application;
fig. 6 is a schematic diagram of a server according to an embodiment of the present application.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The application is suitable for the PaaS platform based on the Kubernets container cluster management system.
The Kubernetes is an open-source container cluster management system, provides functions of application deployment, maintenance, high-availability management, an elastic expansion and contraction extension mechanism and the like, and is packaged into a set of complete, simple and easy-to-use API (application programming interface) to provide services for the outside. In general, it is convenient to manage running containerized applications across machines using kubernets.
The PaaS (Platform as a service) is a service that submits an operation and development environment of an application service to a user in a SaaS mode. Thus, PaaS is also an application of the SaaS model. PaaS can increase the amount of resources utilized on a Web platform. For example, Data-as-a-Service (Data-as-a-Service) can be used through a remote Web Service, and also visual API can be used. A user or a manufacturer can rapidly develop applications and products required by the user or the manufacturer based on the PaaS platform.
Based on the containers created by kubernets, the following problems exist:
1. the IP address acquired by the container is generally the internal IP address of the container and cannot be directly accessed from the outside.
2. If the application in the container exposes the service to the outside, the domain name conflict problem exists.
3. If the application in the container is deployed in a plurality of container instances, the load balance of the service needs to be realized.
In order to solve the above problem, please refer to fig. 2, which is a flowchart of a PaaS platform domain name configuration method based on Kubernetes according to an embodiment of the present application, including the following steps:
step 110: and receiving an application name and a port submitted by a client and generating a domain name according to the application name.
Generally, after a plurality of container instances of an application are deployed on a PaaS platform (hereinafter referred to as a service end) based on kubernets in development, a service is usually exposed to the outside, and a domain name corresponding to the application needs to be configured, so that an external user can access the deployed application through the domain name. A developer may create an instance of an application on a server. And kubernets may automatically deploy instances of the application into containers.
When an application is deployed for the first time, the server side can automatically generate the domain name of the application. Generally, the domain name corresponding to the application may be generated according to a certain preset rule, for example, according to a full spelling of the application name or an english translation. For example, if the Chinese application name of an application is "dig money", the pinyin "wacai" corresponding to "dig money" can be automatically used as the domain name of the application.
Generally, after the instance of the application is deployed in the container, the developer needs to complete the exposure of the application external access in the container, and the process is as shown in step 110:
the developer can submit the application name, the port and the domain name of the application to the server through the client.
And the server can receive the application name and the port submitted by the client and generate the domain name according to the application name.
Step 120: and creating an Ingress object according to the application name and the port and the domain name suffix.
The following problems exist with containers created based on Kubernetes:
the IP address acquired by the container is typically the content IP address of the container, and such IP address can only be routed in the container cluster content network and cannot be directly accessed by the outside (public network). Therefore, the server also needs to process the IP corresponding to the application deployed in the container to a certain extent so that it can be accessed externally.
In this embodiment, the problem that the application IP in the container cannot be directly accessed from the outside is solved by creating the Ingress object.
Ingress is a set of rules between an external Service to a Service in a container cluster (Kubernetes' Service), which allows access requests entering the container cluster to be forwarded to the Service in the container cluster.
Specifically, Ingress can configure Service as a URL suffix (i.e., domain name suffix) that is accessible by the extranet; and traffic load balancing can be achieved, SSL is terminated, a virtual host provided for domain name access, and the like. Thus, a user need only enter and request Service by accessing a URL (form of API resource Service, e.g., caas.one/kibana). Generally, one Ingress controller may be responsible for handling the request traffic of all Ingress objects; the Ingress controller may also typically be a load balancer; the Ingress controller may be located on a border router or an additional front end may help handle HA mode traffic.
Step 130: and monitoring whether a new Ingress object is created.
Step 140: and under the condition that the creation of a new Ingress object is monitored, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix.
The namespace is a namespace, which is mainly used for combining and reusing code. It is mainly to solve the conflict problem caused by the renaming of variables. Taking an application as an example, by introducing namespace, the application can be defined in namespace, and the situation of application name conflict between different versions of the same application is avoided. Generally, each application will have a unique namespace associated with it.
In this embodiment, a new domain name is generated according to the application name, the corresponding namespace, and the domain name suffix, and may be embodied as a new domain name: "application name-space.url suffix".
Step 150: and configuring the new domain name to a configuration file of the nginx server.
The Nginx is a high performance HTTP and reverse proxy server. When the Nginx is used as a Web server, the Nginx has the characteristics of less occupied memory and strong concurrency capability. When the Nginx is used as a load balancing server, the Rails and the PHP can be directly supported inside, and the Nginx can also be used as an HTTP proxy server to serve outside.
And configuring the new domain name to a configuration file of the nginx server, thereby completing service agent registration.
The new domain name, the "application name-space.url suffix," ultimately points to the application instance within the application's corresponding container.
By the embodiment, the domain name for providing the service to the outside can be automatically configured only by submitting the application name and the port in the development, and the problem of domain name conflict is automatically processed; specifically, after a newly created Ingress object is monitored, a new domain name is automatically generated according to an application name, a corresponding namespace and a domain name suffix, so that domain name collision is avoided. On the other hand, since nginx can also be used as a load balancing server, load balancing of application service force application in the container can be realized through nainx.
On the basis of the embodiment shown in fig. 1, before the step 120, the method may further include:
judging whether the domain names conflict or not;
the step 120 specifically includes:
and under the condition that the domain names do not conflict, creating an Ingress object according to the application name and the port and the domain name suffix.
In this embodiment, the determining whether the domain name is in conflict may be implemented by determining namespace of an application.
As mentioned above, each application will have a unique namespace associated with it. Therefore, whether the namespace corresponding to the application exists can be judged according to the query namespace table. The namespace table is a namespace set corresponding to other applications already deployed. Generally, a namespace corresponding to each deployed application is recorded in a server, so that a namespace table is formed.
If the namespace table has the namespace corresponding to the application, the domain name conflict is indicated;
and if the namespace table does not have the namespace corresponding to the application, the domain name is not conflicted. Under the condition of domain name conflict, the server side can send a notice to the client side, so that a developer is prompted to re-apply for the domain name.
Referring to fig. 2, a flowchart of an application access method according to an embodiment of the present application includes the following steps:
step 210: and under the condition that domain name resolution on the domain name accessed by the user fails, performing domain name extensive resolution on the domain name.
Step 220: it is determined whether a specific domain name suffix is included.
Step 230: and under the condition that a specific domain name suffix is contained, resolving the domain name to a nginx server corresponding to the specific domain name suffix.
Step 240: and returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy.
In practical applications, when a user accesses an application using a client (e.g., a computer), the access address is usually a domain name. In order to identify which application the domain name is specifically directed to, domain name resolution needs to be performed on the domain name to obtain an IP directed to a target address. Specifically, by implementing with a DNS server, it can be understood that, between the client and the application server, a DNS server for performing DNS resolution is provided. The DNS (Domain Name System) is a distributed database on the internet as a mapping between Domain names and IP addresses, and enables a user to access the internet more conveniently without remembering the IP that can be directly read by a machine.
The domain name universal resolution (DNS universal resolution) refers to that any sub domain name is added before the domain name, and the pointed WEB address can be accessed. In this way, the ". times.Domain" can be resolved to the same IP. The advantage of domain name resolution is that applications that the user needs to access can be resolved to the correct server in a way similar to fuzzy matching.
Still taking the name-space.url suffix as an example, after the user accesses the application, even if the DNS server performs NDS resolution on the domain name and then finds that there is no corresponding IP for the domain name, the DNS general resolution can be used to find a specific domain name suffix ("URL suffix"), so that the application that the user needs to access is resolved to the server corresponding to the name-space.url suffix. Here, the server corresponding to the "name-space.url suffix" is the nginx server registered by the service agent shown in step 150 of the above embodiment. The nginx service will match the complete domain name, i.e. "application name. name-space. url suffix", to jump to the real application service address and thus access the actual container address.
Corresponding to the embodiment of the PaaS platform domain name configuration method based on Kubernetes described in fig. 1, the present application also provides an embodiment of a PaaS platform domain name configuration device based on Kubernetes. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the device where the software implementation is located as a logical means. In terms of hardware, a hardware structure of the device in which the apparatus is located in the PaaS platform domain name configuration based on kubernets according to the present application may include a processor, a network interface, a memory, and a nonvolatile memory, and the device in which the apparatus is located in the embodiment generally configures an actual function according to the PaaS platform domain name configuration based on kubernets, and may include other hardware, which is not described herein again.
Referring to fig. 3, a block diagram of a apparatus for configuring domain names of PaaS platforms based on kubernets according to an embodiment of the present application is provided, where the apparatus includes:
a receiving unit 310, configured to receive an application name and a port submitted by a client and generate a domain name according to the application name;
a creating unit 320, creating an Ingress object according to the application name and the port, and the domain name suffix;
a monitoring unit 330, configured to monitor whether a new Ingress object is created;
a generating unit 340, configured to generate a new domain name according to the application name, the corresponding namespace, and the domain name suffix when it is monitored that a new Ingress object is created;
a configuration unit 350, configured the new domain name to the configuration file of the nginx server.
In an alternative embodiment:
before the creating unit 320, the apparatus further includes:
the judging unit is used for judging whether the domain names conflict or not;
the creating unit 320 specifically includes:
and under the condition that the domain names do not conflict, creating an Ingress object according to the application name and the port and the domain name suffix.
In an alternative embodiment:
the judging unit specifically includes:
the acquisition subunit acquires a first namespace corresponding to the application;
comparing the sub-unit with a second namespace corresponding to other deployed applications;
and the determining subunit determines the domain name conflict under the condition that the first namespace is the same as the second namespace.
Corresponding to the foregoing embodiment of the application access method shown in fig. 2, the present application also provides an embodiment of an application access apparatus. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. The software implementation is taken as an example, and is formed by reading corresponding computer program instructions in the nonvolatile memory into the memory for operation through the processor of the device where the software implementation is located as a logical means. In terms of hardware, a hardware structure of the device in which the application access apparatus is located in the present application may include a processor, a network interface, a memory, and a nonvolatile memory, and the device in which the apparatus is located in the embodiment generally accesses an actual function according to the application, and may also include other hardware, which is not described again.
Referring to fig. 4, a block diagram of an application access apparatus provided in an embodiment of the present application is shown, the apparatus including:
the resolution unit 410 is configured to perform domain name extensive resolution on a domain name accessed by a user when the domain name resolution fails;
a judgment unit 420 for judging whether a specific domain name suffix is included;
a forwarding unit 430, configured to forward, when a specific domain name suffix is included, the domain name to a nginx server corresponding to the specific domain name suffix;
the returning unit 440 returns the nginx server to the user according to the result of the application service corresponding to the domain name proxy.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
Fig. 3 above describes internal functional modules and a structural schematic of the apparatus for domain name configuration based on the PaaS platform of kubernets, and the substantial execution subject thereof may be an electronic device, such as a server, fig. 5 is a schematic diagram of a hardware structure of a server shown according to an exemplary embodiment, and the server includes, with reference to fig. 5:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving an application name and a port submitted by a client and generating a domain name according to the application name;
creating an Ingress object according to the application name and the port and the domain name suffix;
monitoring whether a new Ingress object is created;
under the condition that a new Ingress object is monitored to be created, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix;
and configuring the new domain name to a configuration file of the nginx server.
Similarly, fig. 4 above describes the internal functional modules and the structural schematic of the application access device, and the execution subject may be an electronic device, such as a server, fig. 5 is a schematic diagram of the hardware structure of a server shown in an exemplary embodiment, and the server includes, with reference to fig. 5:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
performing domain name extensive resolution on a domain name accessed by a user under the condition that the domain name resolution is failed;
judging whether a specific domain name suffix is contained;
under the condition that a specific domain name suffix is contained, resolving the domain name to a nginx server corresponding to the specific domain name suffix;
and returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy.
In the above embodiments of the electronic device, it should be understood that the Processor may be a Central Processing Unit (CPU), other general-purpose processors, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), etc. The general-purpose processor may be a microprocessor, or the processor may be any conventional processor, and the aforementioned memory may be a read-only memory (ROM), a Random Access Memory (RAM), a flash memory, a hard disk, or a solid state disk. The steps of a method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in the processor.
Fig. 6 is a schematic diagram of a server 1000 shown in accordance with an example embodiment. Referring to fig. 6, server 1000 includes a processing component 1022 that further includes one or more processors and memory resources, represented by memory 1032, for storing instructions, such as application programs, that are executable by processing component 1022. The application programs stored in memory 1032 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1022 is configured to execute instructions to perform all or a portion of the steps of the convolutional neural network-based picture retrieval method described above.
The server 1000 may also include a power component 1026 configured to perform power management for the server 1000, a wired or wireless network interface 1050 configured to connect the server 1000 to a network, and an input/output (I/O) interface 1058. Server 1000 may operate based on an operating system stored in memory 1032, such as a Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiment of the electronic device, since it is substantially similar to the embodiment of the method, the description is simple, and for the relevant points, reference may be made to part of the description of the embodiment of the method.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
Claims (8)
1. A PaaS platform domain name configuration method based on Kubernetes is characterized by comprising the following steps:
receiving an application name and a port submitted by a client and generating a domain name according to the application name;
judging whether the domain names conflict or not;
under the condition that the domain names are not in conflict, creating an Ingress object according to the application name and the port and the domain name suffix;
monitoring whether a new Ingress object is created;
under the condition that a new Ingress object is monitored to be created, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix;
and configuring the new domain name to a configuration file of the nginx server.
2. The method according to claim 1, wherein the determining whether the domain name is in conflict specifically comprises:
acquiring a first namespace corresponding to the application;
comparing with second namespace corresponding to other deployed applications;
and determining the domain name conflict under the condition that the first namespace is the same as the second namespace.
3. An application access method, characterized in that the method comprises:
performing domain name extensive resolution on a domain name accessed by a user under the condition that the domain name resolution is failed;
judging whether a specific domain name suffix is contained;
under the condition that a specific domain name suffix is contained, resolving the domain name to a nginx server corresponding to the specific domain name suffix;
returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy;
wherein the domain name accessed by the user is configured by the method of claim 1.
4. A PaaS platform domain name configuration device based on Kubernetes is characterized by comprising:
the receiving unit is used for receiving the application name and the port submitted by the client and generating a domain name according to the application name;
the judging unit is used for judging whether the domain names conflict or not;
the creating unit is used for creating an Ingress object according to the application name, the port and the domain name suffix under the condition that the domain names are not in conflict;
the monitoring unit monitors whether a new Ingress object is created or not;
the generating unit is used for generating a new domain name according to the application name, the corresponding namespace and the domain name suffix under the condition that the creation of a new Ingress object is monitored;
and the configuration unit is used for configuring the new domain name to a configuration file of the nginx server.
5. The apparatus according to claim 4, wherein the determining unit specifically includes:
the acquisition subunit acquires a first namespace corresponding to the application;
comparing the sub-unit with a second namespace corresponding to other deployed applications;
and the determining subunit determines the domain name conflict under the condition that the first namespace is the same as the second namespace.
6. An application access apparatus, the apparatus comprising:
the domain name analyzing unit is used for performing domain name extensive analysis on the domain name accessed by the user under the condition that the domain name analysis fails;
a judging unit that judges whether or not a specific domain name suffix is contained;
a forwarding unit, which forwards the domain name to a nginx server corresponding to a specific domain name suffix under the condition that the domain name suffix is included;
the return unit is used for returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy;
wherein the domain name accessed by the user is configured by the method of claim 1.
7. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
receiving an application name and a port submitted by a client and generating a domain name according to the application name;
judging whether the domain names conflict or not;
under the condition that the domain names are not in conflict, creating an Ingress object according to the application name and the port and the domain name suffix;
monitoring whether a new Ingress object is created;
under the condition that a new Ingress object is monitored to be created, generating a new domain name according to the application name, the corresponding namespace and the domain name suffix;
and configuring the new domain name to a configuration file of the nginx server.
8. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to:
performing domain name extensive resolution on a domain name accessed by a user under the condition that the domain name resolution is failed;
judging whether a specific domain name suffix is contained;
under the condition that a specific domain name suffix is contained, resolving the domain name to a nginx server corresponding to the specific domain name suffix;
returning the nginx server to the user according to the result of the application service corresponding to the domain name proxy;
wherein the domain name accessed by the user is configured by the method of claim 1.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710521771.9A CN107302604B (en) | 2017-06-30 | 2017-06-30 | Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710521771.9A CN107302604B (en) | 2017-06-30 | 2017-06-30 | Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107302604A CN107302604A (en) | 2017-10-27 |
CN107302604B true CN107302604B (en) | 2020-01-03 |
Family
ID=60135248
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710521771.9A Active CN107302604B (en) | 2017-06-30 | 2017-06-30 | Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107302604B (en) |
Families Citing this family (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108039975B (en) * | 2017-12-21 | 2020-08-28 | 北京搜狐新媒体信息技术有限公司 | Container cluster management system and application method thereof |
CN108810013B (en) * | 2018-07-02 | 2021-12-24 | 上海浪潮云计算服务有限公司 | Container-based service access method |
CN109150616B (en) * | 2018-09-03 | 2021-09-14 | 成都潜在人工智能科技有限公司 | Intelligent gateway capable of automatically increasing https entrance and working method thereof |
CN110968356B (en) * | 2018-09-29 | 2023-09-29 | 北京金山云网络技术有限公司 | Method and device for acquiring configuration information |
US10778798B2 (en) | 2018-10-24 | 2020-09-15 | Hewlett Packard Enterprise Development Lp | Remote service access in a container management system |
CN109714449B (en) * | 2019-01-17 | 2022-05-17 | 平安科技(深圳)有限公司 | Dynamic configuration method, device, equipment and storage medium for service domain name |
CN109815704B (en) * | 2019-01-24 | 2020-08-04 | 中国—东盟信息港股份有限公司 | Safety detection method and system for Kubernetes cloud native application |
CN110276199B (en) * | 2019-06-25 | 2020-12-01 | 中国—东盟信息港股份有限公司 | Dynamic security detection method for Kubernetes cloud native application |
CN112579310B (en) * | 2019-09-30 | 2024-09-17 | 北京车和家信息技术有限公司 | Service calling method and device |
CN111193783B (en) * | 2019-12-19 | 2022-08-26 | 新浪网技术(中国)有限公司 | Service access processing method and device |
CN111367662B (en) * | 2020-02-26 | 2023-06-02 | 普信恒业科技发展(北京)有限公司 | Load balancing method, device and system |
CN111431740B (en) * | 2020-03-16 | 2023-07-14 | 深信服科技股份有限公司 | Data transmission method, device, equipment and computer readable storage medium |
CN111800458B (en) * | 2020-05-22 | 2021-04-23 | 浙商银行股份有限公司 | Dynamic load balancing method and system for Kubernetes container cloud platform |
CN111949366B (en) * | 2020-07-07 | 2024-04-05 | 北京思特奇信息技术股份有限公司 | System and method for reversely proxy out-of-container service to inside of container |
US11567811B2 (en) | 2020-09-28 | 2023-01-31 | Red Hat, Inc. | Detecting multiple operator pattern services making conflicting resource modifications |
CN112243036B (en) * | 2020-10-21 | 2022-03-15 | 北京首都在线科技股份有限公司 | Data processing method and device for PaaS service, equipment and storage medium |
CN112448856B (en) * | 2021-01-28 | 2021-05-07 | 杭州朗澈科技有限公司 | Method and system for providing public network access for external through intranet kubernets |
CN114844859B (en) * | 2022-05-05 | 2024-06-11 | 北京达佳互联信息技术有限公司 | Domain name configuration method, device, electronic equipment and storage medium |
CN115314432A (en) * | 2022-07-30 | 2022-11-08 | 济南浪潮数据技术有限公司 | Cross-cluster application route access method, system, equipment and medium |
Family Cites Families (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US9418168B2 (en) * | 2013-10-29 | 2016-08-16 | Sap Se | Providing cloud-based, generic OData mashup services using an on-demand service |
CN106657426A (en) * | 2015-11-04 | 2017-05-10 | 中兴通讯股份有限公司 | Processing method and device for domain name parsing request, and server |
CN106657220A (en) * | 2016-09-21 | 2017-05-10 | 郑州云海信息技术有限公司 | Nginx based Cloud Foundry intranet deployment scheme |
-
2017
- 2017-06-30 CN CN201710521771.9A patent/CN107302604B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN107302604A (en) | 2017-10-27 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107302604B (en) | Kubernetes-based PaaS platform domain name configuration method and device and electronic equipment | |
CN109714449B (en) | Dynamic configuration method, device, equipment and storage medium for service domain name | |
AU2019257143B2 (en) | Policy based service routing | |
CN113746887B (en) | Cross-cluster data request processing method, device and storage medium | |
CN109547570B (en) | Service registration method, device, registration center management equipment and storage medium | |
US10686755B2 (en) | Assigning IP addresses and configuration parameters in hyper-converged infrastructure | |
CN111327647B (en) | Method and device for providing service to outside by container and electronic equipment | |
US11422797B1 (en) | Using graph partitioning for software decomposition during modernization processes | |
CN109657434B (en) | Application access method and device | |
CN111182089B (en) | Container cluster system, method and device for accessing big data assembly and server | |
CN113557747B (en) | Method and apparatus for processing media content in network-based media processing | |
US20230054683A1 (en) | Correspondence of external operations to containers and mutation events | |
CN110515631B (en) | Method for generating application installation data packet, server and computer storage medium | |
US6898701B2 (en) | Method and system for organized booting of a target device in a network environment by a reservation server based on available boot resources | |
KR20210013723A (en) | Attached accelerator-based inference service | |
CN112492060B (en) | Service resource processing method and system, proxy equipment and request equipment | |
CN103338233A (en) | Load balancing device, Web server, request information processing method and system | |
CN114448849B (en) | Method for detecting supporting mode of IPv6 network of website and electronic equipment | |
CN113254165A (en) | Load flow distribution method and device for virtual machine and container, and computer equipment | |
CN113296838A (en) | Cloud server management method, and method and device for providing data service | |
CN110769020B (en) | Resource request processing method, device, equipment and system | |
US20200313981A1 (en) | Method and device for processing a network service instantiation request | |
US11729246B2 (en) | Apparatus and method for determining types of uniform resource locator | |
CN114662102A (en) | File processing method and device and storage medium | |
CN110515905B (en) | Method, device and server for configuring route |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |