CN117806615A - Micro-service interface arrangement system and method based on k8s and helm - Google Patents

Micro-service interface arrangement system and method based on k8s and helm Download PDF

Info

Publication number
CN117806615A
CN117806615A CN202311759018.5A CN202311759018A CN117806615A CN 117806615 A CN117806615 A CN 117806615A CN 202311759018 A CN202311759018 A CN 202311759018A CN 117806615 A CN117806615 A CN 117806615A
Authority
CN
China
Prior art keywords
service
aggregation
module
authentication
configuring
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.)
Pending
Application number
CN202311759018.5A
Other languages
Chinese (zh)
Inventor
任园波
李成钢
蒋思玉
赵志宏
乔胜勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Telecom Corp Ltd
China Telecom Digital Intelligence Technology Co Ltd
Original Assignee
China Telecom Corp Ltd
China Telecom Digital Intelligence Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Telecom Corp Ltd, China Telecom Digital Intelligence Technology Co Ltd filed Critical China Telecom Corp Ltd
Priority to CN202311759018.5A priority Critical patent/CN117806615A/en
Publication of CN117806615A publication Critical patent/CN117806615A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses a k8s and palm-based micro-service interface arrangement system and method, which consists of a pipeline task module, an authentication authorization plug-in module, a gateway aggregation client module and a gateway aggregation server module, wherein the pipeline task module is used for rapidly publishing aggregation services; the authentication authorization plug-in module is used for aggregating authentication configuration during inter-service call; the gateway aggregation client module is used for configuring aggregation service; the gateway aggregation server side module is used for realizing the aggregation service when executing specific requests according to the service configured by the client side. The invention manages the deployment of the aggregation service in a container arrangement and pipeline mode, reduces the complexity and flexibility of service deployment, and calls the aggregation service without a developer knowing the specific address of each service after the deployment of the aggregation service is completed, and only needs to know the name of the aggregation service, arrange a service interface in a visual configuration mode and issue and use.

Description

Micro-service interface arrangement system and method based on k8s and helm
Technical Field
The invention relates to the technical field of container arrangement, in particular to a k8s and palm-based micro-service interface arrangement system and method.
Background
Large complex software projects typically have multiple platforms and multiple services. When the user needs to display the used data from a plurality of platform services, the common method is that firstly, the address of each service is obtained, then each service is requested by the configuration parameters, the required data is extracted after the result is obtained, the front-end workload is huge and errors are easy to occur.
At present, although spring closed micro-service ecology can provide a gateway, service management and other schemes capable of realizing service aggregation, the gateway aggregation still has the advantages that the quick release iteration of the service needs to be adapted through the micro-service, the aggregation call needs to manually search related interfaces and related fields, if document class references are not available, the difficulty is multiplied, and the development and debugging difficulty of the aggregation interfaces is definitely greatly increased. Meanwhile, the authority verification among different services needs to be carried out by each service to make corresponding authority release on the request, and service call can be carried out after authentication and authentication processing is completed.
Therefore, the existing scheme has the defects of insufficient rapid release iteration support, service promotion and degradation, inflexible expansion and contraction capacity, complex workload in the arranging and aggregation process, difficult authentication and the like.
Disclosure of Invention
Aiming at the problems in the prior art, the invention provides a k8s and palm-based micro-service interface arrangement system and a k8s and palm-based micro-service interface arrangement method, service deployment is managed in a container arrangement and pipeline mode, and complexity and flexibility of service deployment are reduced.
In order to achieve the technical purpose, the invention adopts the following technical scheme: the micro-service interface arranging system based on k8s and a helm comprises a pipeline task module, an authentication authorization plug-in module, a gateway aggregation client module and a gateway aggregation server module, wherein the pipeline task module is used for rapidly publishing an aggregation service; the authentication authorization plug-in module is used for aggregating authentication configuration during inter-service call; the gateway aggregation client module is used for configuring aggregation service; the gateway aggregation server side module is used for realizing aggregation service when executing specific requests according to the service configured by the client side.
Further, the invention also provides an arrangement method of the k8s and palm-based micro service interface arrangement system, which specifically comprises the following steps:
step 1, creating a pipeline flow in a pipeline task module, configuring a palm-char package of each aggregation service in the pipeline task module, and releasing the aggregation service to a container environment through the palm-char package;
step 2, the aggregation service configures auto-Auth authority authentication plug-in parameters and authentication and authorization modes through an authentication and authorization plug-in module;
step 3, configuring a gateway aggregation service flow in a gateway aggregation client module;
and step 4, the gateway aggregation server module calls the configuration result in the step 1-3 and executes the gateway aggregation service flow.
Further, the specific process of creating the pipeline flow in the pipeline task module in the step 1 is as follows:
step 1.1.1, configuring a detection task corresponding to an aggregation service, selecting and configuring a code address and a branch of a relevant code warehouse, and pulling out a code for executing the detection task;
step 1.1.2, detecting codes pulled by the tasks according to the step 1.1.1, configuring compiling commands of the detected tasks, and uploading compiling code generating products of the detected tasks to a maven's nexus product warehouse;
and 1.1.3, generating a product according to a compiled code in a maven's nexus product warehouse, configuring a designated dockerfile to construct a mirror task to generate a mirror image, and uploading the mirror image to a docker's nexus product warehouse.
Further, the specific process of publishing the aggregation service to the container environment through the helm-charts in the step 1 is as follows:
step 1.2.1, configuring the name of the mirror image to the mirror image name parameter of the palm template file, configuring the version to the version parameter of the palm template file, and uploading to a palm warehouse of the nexus for storage after the configuration is completed;
step 1.2.2, pulling the generated mirror image from the doxus product warehouse of the docker, and automatically generating container service in the docker environment according to the helm configuration.
Further, when the authentication authorization plug-in module in step 2 is used for unified verification of the token, the token parameter is configured in the auto_auth authorization plug-in, and the token is automatically brought into request header information when the corresponding aggregation service request is analyzed for analysis and authentication of the aggregation service;
when the authentication authorization plug-in module in the step 2 is used for checking account passwords, configuring a user name and a password in the auto_Auth authorization authentication plug-in, automatically logging in through the user name password when analyzing a corresponding aggregation service request to generate token information for analysis and authentication of the aggregation service;
when the authentication authorization plug-in module in the step 2 is used for customizing the authorization plug-in, an authentication mode of the aggregation service is customized and configured in the auto_Auth authority authentication plug-in, and an authentication class is written to realize authentication.
Further, step 3 comprises the following sub-steps:
step 3.1, configuring interface basic information, which comprises the following steps: the specific method and interface path of the service, interface description and interface request are adopted, and an authentication and authorization mode is selected according to the configured interface basic information;
step 3.2, configuring input parameters, wherein the input parameters comprise: an entry parameter, an entry-request header parameter, and an entry-query parameter;
step 3.3, configuring request steps, namely configuring a plurality of aggregation service requests according to each request step, and configuring a request mode according to the aggregation service requests, wherein the request mode supports k8s service, reads and selects aggregation service issued to a container environment by the helm-charts;
step 3.4, configuring an output result, selecting a field required to be output in each step in the configuration step, and filling a response body;
and 3.5, after the configuration is finished, checking whether the overall format is wrong through json validity, checking the input item parameters and requesting, and finally checking whether the output result is in an interface result set, if not, prompting that the result field cannot be acquired.
Further, when a single interface is configured in step 3.3, the number of failed retries is increased.
Further, step 4 comprises the following sub-steps:
step 4.1, the gateway aggregation server module receives an aggregation service request of a user;
step 4.2, calling the gateway aggregation client module to check the input parameters, judging that the input parameters are configured in the network aggregation client module, returning error information if the input parameters are not present, and otherwise, executing the step 4.3;
step 4.3, calling an auto_Auth authority authentication plug-in the authentication authorization plug-in module, generating authorization information token of the requested aggregation service, checking the requested aggregation service, and executing step 4.4 after passing, otherwise, returning an error message;
step 4.4, according to the request step configured in the gateway aggregation client module, requesting the aggregation service name and the access parameters configured in each step in parallel, executing the request, and configuring and outputting the result;
and 4.5, obtaining a final response result of the aggregated service request according to the configured output result.
Compared with the prior art, the invention has the following beneficial effects: according to the k8s and palm-based micro-service interface arrangement system and method, a pipeline task module is arranged, so that a plurality of aggregation services are deployed for one-time configuration, subsequent configuration is not needed again, and one-key upgrading and publishing of the aggregation services can be realized by clicking configuration pipeline operation; the request step can be configured in the gateway aggregation client module, so that the calling of a plurality of aggregation services is realized, meanwhile, the configured request mode supports k8s service, is more efficient than the http mode calling, and when a single interface is configured abnormally, the number of failed retries can be returned in a fast failure way for the single service interface in the aggregation interface, so that the influence on the efficiency of the aggregation interface due to overlong waiting time is avoided; the authentication authorization plug-in module in the invention authenticates through the auto_Auth authority authentication plug-in without adding extra special treatment for each interface. The invention manages service deployment through container arrangement and pipeline mode, and reduces complexity and flexibility of service deployment.
Drawings
FIG. 1 is a block diagram of a k8s and palm based microservice interface orchestration system of the present invention;
FIG. 2 is a flow chart of a k8s and palm based micro service interface orchestration method of the present invention.
Detailed Description
The technical scheme of the invention is further explained below with reference to the accompanying drawings.
FIG. 1 is a block diagram of a k8s and helm-based micro-service interface orchestration system according to the present invention, where the micro-service interface orchestration system is composed of a pipeline task module, an authentication authorization plug-in module, a gateway aggregation client module, and a gateway aggregation server module, where the pipeline task module is used for fast publishing of an aggregation service; the authentication authorization plug-in module is used for aggregating authentication configuration during inter-service call; the gateway aggregation client module is used for configuring aggregation service; the gateway aggregation server side module is used for realizing the aggregation service when executing specific requests according to the service configured by the client side. The invention manages the deployment of the aggregation service in a container arrangement and pipeline mode, and the aggregation service has the capabilities of service discovery, load homoenergetic and the like. The gateway aggregation service orchestrates the services and publishes usage through a service discovery capability visualization configuration interface. After the deployment of the aggregation service is completed, the developer does not need to know the specific address of each service, and only needs to know the name of the aggregation service, the gateway aggregation service can arrange the service interface and issue and use the service interface in a visual configuration mode.
Fig. 2 is a flowchart of a micro service interface arrangement method based on k8s and a helm according to the present invention, which specifically includes the following steps:
step 1, creating a pipeline flow in a pipeline task module, configuring a palm-char package of each aggregation service in the pipeline task module, and releasing the aggregation service into a container environment through the palm-char, wherein the palm is a package management tool of kubernetes and is a set of related files describing k8s resources. The method has the advantages that a method of arranging a palm container is used, custom task deployment is executed through a flow engine, only one palm-charts package is needed to be configured, the subsequent deployment can automatically complete deployment only by triggering tasks once, meanwhile, the complexity problem of a large number of service deployments is solved by integrating aggregated service registration, service discovery, load balancing and the like, the number of service copies is designated by service load configuration through the charts, and dynamic horizontal expansion and contraction are realized so as to cope with the change of interface concurrency.
The specific process of creating the pipeline flow in the pipeline task module in the invention is as follows:
step 1.1.1, configuring a detection task corresponding to an aggregation service, selecting and configuring a code address and a branch of a relevant code warehouse, and pulling out a code for executing the detection task;
step 1.1.2, detecting codes pulled by the tasks according to the step 1.1.1, configuring compiling commands of the detected tasks, and uploading compiling code generating products of the detected tasks to a maven's nexus product warehouse;
and 1.1.3, generating a product according to a compiled code in a maven's nexus product warehouse, configuring a designated dockerfile to construct a mirror task to generate a mirror image, and uploading the mirror image to a docker's nexus product warehouse.
The specific process of issuing the aggregation service to the container environment through the palm-charts in the invention is as follows:
step 1.2.1, configuring the name of the mirror image to the mirror image name parameter of the palm template file, configuring the version to the version parameter of the palm template file, and uploading to a palm warehouse of the nexus for storage after the configuration is completed;
and 1.2.2, pulling the generated mirror image from a nexus product warehouse of the dock, automatically generating container service in the dock environment according to the palm configuration, performing one-time configuration, performing subsequent one-key operation, and performing automatic execution of configuration related tasks through argo service after clicking operation.
And 2, the aggregation service configures auto-Auth authority authentication plug-in parameters and authentication and authorization modes through an authentication and authorization plug-in module, so that the interface is free from perception and secret calling.
When the authentication authorization plug-in module is used for unified verification of the token, the token parameter is configured in the auto-Auth authorization authentication plug-in, and the token is automatically brought into request header information when the corresponding aggregation service request is analyzed for analysis and authentication of the aggregation service;
when the authentication authorization plug-in module is used for checking account passwords, configuring a user name and a password in the auto-Auth authorization authentication plug-in, automatically logging in through the user name password to generate token information when analyzing a corresponding aggregation service request, and analyzing and authenticating the aggregation service;
when the authentication authorization plug-in module is used for customizing the authorization plug-in, an authentication mode of the aggregation service is customized and configured in the auto-Auth authority authentication plug-in, and an authentication class is written to realize authentication.
And 3, configuring a gateway aggregation service flow in a gateway aggregation client module, configuring interface services in a visual page configuration mode, changing complex multi-interface call development into flexible configuration service release, and taking effect in real time without restarting. The method specifically comprises the following substeps:
step 3.1, configuring interface basic information for basic information storage, and selecting an authentication and authorization mode according to the configured interface basic information; the interface basic information includes: the specific methods of the service, the interface description and the interface request and the interface path;
step 3.2, configuring input parameters, wherein the input parameters comprise: an entry parameter, an entry-request header parameter, and an entry-query parameter; the system configures the input item parameters according to the unified entry of the input item, and the input item parameters are distributed to different service processing containers in the subsequent flow;
step 3.3, configuring request steps, namely configuring a plurality of aggregation service requests according to each request step, and configuring a request mode according to the aggregation service requests, wherein the request mode supports k8s service, reads and selects aggregation service issued to a container environment by the helm-charts; and when a single interface is configured to be abnormal according to actual conditions, the number of failed retries is counted;
step 3.4, configuring an output result, selecting a field required to be output in each step in the configuration step, and filling a response body; the configuration format of the output result is JSON or XML, and parameters can be added in response body header information;
and 3.5, after the configuration is finished, checking whether the overall format is wrong through json validity, checking the input item parameters and requesting, and finally checking whether the output result is in an interface result set, if not, prompting that the result field cannot be acquired.
Step 4, the gateway aggregation server module calls the configuration result of the step 1-3 and executes a gateway aggregation service flow; the method specifically comprises the following substeps:
step 4.1, the gateway aggregation server module receives an aggregation service request of a user;
step 4.2, calling the gateway aggregation client module to check the input parameters, judging that the input parameters are configured in the network aggregation client module, returning error information if the input parameters are not present, and otherwise, executing the step 4.3;
step 4.3, calling an auto_Auth authority authentication plug-in the authentication authorization plug-in module, generating authorization information token of the requested aggregation service, checking the requested aggregation service, and executing step 4.4 after passing, otherwise, returning an error message;
step 4.4, according to the request step configured in the gateway aggregation client module, requesting the aggregation service name and the access parameters configured in each step in parallel, executing the request, and configuring and outputting the result;
and 4.5, obtaining a final response result of the aggregated service request according to the configured output result.
The k8s and palm-based micro-service interface arrangement method of the invention rapidly distributes services through one key, adopts plug-in authentication and configuration type service aggregation, and is very suitable for data query and return of service aggregation class under a multi-service scene.
The above is only a preferred embodiment of the present invention, and the scope of the present invention is not limited to the above embodiment, and all technical solutions belonging to the concept of the present invention are within the scope of the present invention. It should be noted that modifications and adaptations to the invention without departing from the principles thereof are intended to be within the scope of the invention as set forth in the following claims.

Claims (8)

1. The micro-service interface arranging system based on k8s and the helm is characterized by comprising a pipeline task module, an authentication and authorization plug-in module, a gateway aggregation client module and a gateway aggregation server module, wherein the pipeline task module is used for rapidly publishing an aggregation service; the authentication authorization plug-in module is used for aggregating authentication configuration during inter-service call; the gateway aggregation client module is used for configuring aggregation service; the gateway aggregation server side module is used for realizing aggregation service when executing specific requests according to the service configured by the client side.
2. A method for orchestrating a k8s and hellm based microservice interface orchestration system according to claim 1, comprising the steps of:
step 1, creating a pipeline flow in a pipeline task module, configuring a palm-char package of each aggregation service in the pipeline task module, and releasing the aggregation service to a container environment through the palm-char package;
step 2, the aggregation service configures auto-Auth authority authentication plug-in parameters and authentication and authorization modes through an authentication and authorization plug-in module;
step 3, configuring a gateway aggregation service flow in a gateway aggregation client module;
and step 4, the gateway aggregation server module calls the configuration result in the step 1-3 and executes the gateway aggregation service flow.
3. The orchestration method of a k8s and helm based micro-service interface orchestration system according to claim 2, wherein the specific process of creating a pipeline flow at the pipeline task module in step 1 is:
step 1.1.1, configuring a detection task corresponding to an aggregation service, selecting and configuring a code address and a branch of a relevant code warehouse, and pulling out a code for executing the detection task;
step 1.1.2, detecting codes pulled by the tasks according to the step 1.1.1, configuring compiling commands of the detected tasks, and uploading compiling code generating products of the detected tasks to a maven's nexus product warehouse;
and 1.1.3, generating a product according to a compiled code in a maven's nexus product warehouse, configuring a designated dockerfile to construct a mirror task to generate a mirror image, and uploading the mirror image to a docker's nexus product warehouse.
4. The orchestration method of a k8s and palm-based micro-service interface orchestration system according to claim 3, wherein the specific process of issuing the aggregated service into the container environment through the palm-charts in step 1 is:
step 1.2.1, configuring the name of the mirror image to the mirror image name parameter of the palm template file, configuring the version to the version parameter of the palm template file, and uploading to a palm warehouse of the nexus for storage after the configuration is completed;
step 1.2.2, pulling the generated mirror image from the doxus product warehouse of the docker, and automatically generating container service in the docker environment according to the helm configuration.
5. The k8s and helm based micro-service interface orchestration system orchestration method according to claim 2, wherein when the authentication authorization plug-in module in step 2 is used for token unified verification, token parameters are configured in auto_auth permission authentication plug-in, and token is automatically brought into request header information when a corresponding aggregated service request is analyzed for analysis and authentication of the aggregated service;
when the authentication authorization plug-in module in the step 2 is used for checking account passwords, configuring a user name and a password in the auto_Auth authorization authentication plug-in, automatically logging in through the user name password when analyzing a corresponding aggregation service request to generate token information for analysis and authentication of the aggregation service;
when the authentication authorization plug-in module in the step 2 is used for customizing the authorization plug-in, an authentication mode of the aggregation service is customized and configured in the auto_Auth authority authentication plug-in, and an authentication class is written to realize authentication.
6. The orchestration method of a k8s and palm based micro service interface orchestration system according to claim 2, wherein step 3 comprises the sub-steps of:
step 3.1, configuring interface basic information, which comprises the following steps: the specific method and interface path of the service, interface description and interface request are adopted, and an authentication and authorization mode is selected according to the configured interface basic information;
step 3.2, configuring input parameters, wherein the input parameters comprise: an entry parameter, an entry-request header parameter, and an entry-query parameter;
step 3.3, configuring request steps, namely configuring a plurality of aggregation service requests according to each request step, and configuring a request mode according to the aggregation service requests, wherein the request mode supports k8s service, reads and selects aggregation service issued to a container environment by the helm-charts;
step 3.4, configuring an output result, selecting a field required to be output in each step in the configuration step, and filling a response body;
and 3.5, after the configuration is finished, checking whether the overall format is wrong through json validity, checking the input item parameters and requesting, and finally checking whether the output result is in an interface result set, if not, prompting that the result field cannot be acquired.
7. The arrangement method of k8s and helm based micro-service interface arrangement system according to claim 6, wherein the number of failed retries when a single interface is configured as abnormal in step 3.3.
8. The orchestration method of a k8s and palm based micro service interface orchestration system according to claim 2, wherein step 4 comprises the sub-steps of:
step 4.1, the gateway aggregation server module receives an aggregation service request of a user;
step 4.2, calling the gateway aggregation client module to check the input parameters, judging that the input parameters are configured in the network aggregation client module, returning error information if the input parameters are not present, and otherwise, executing the step 4.3;
step 4.3, calling an auto_Auth authority authentication plug-in the authentication authorization plug-in module, generating authorization information token of the requested aggregation service, checking the requested aggregation service, and executing step 4.4 after passing, otherwise, returning an error message;
step 4.4, according to the request step configured in the gateway aggregation client module, requesting the aggregation service name and the access parameters configured in each step in parallel, executing the request, and configuring and outputting the result;
and 4.5, obtaining a final response result of the aggregated service request according to the configured output result.
CN202311759018.5A 2023-12-20 2023-12-20 Micro-service interface arrangement system and method based on k8s and helm Pending CN117806615A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311759018.5A CN117806615A (en) 2023-12-20 2023-12-20 Micro-service interface arrangement system and method based on k8s and helm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311759018.5A CN117806615A (en) 2023-12-20 2023-12-20 Micro-service interface arrangement system and method based on k8s and helm

Publications (1)

Publication Number Publication Date
CN117806615A true CN117806615A (en) 2024-04-02

Family

ID=90419235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311759018.5A Pending CN117806615A (en) 2023-12-20 2023-12-20 Micro-service interface arrangement system and method based on k8s and helm

Country Status (1)

Country Link
CN (1) CN117806615A (en)

Similar Documents

Publication Publication Date Title
CN108415832B (en) Interface automation test method, device, equipment and storage medium
CN107370786B (en) General information management system based on micro-service architecture
US11176030B2 (en) Conducting automated software testing using centralized controller and distributed test host servers
US20190065351A1 (en) System and method for providing a test manager for use with a mainframe rehosting platform
US8108456B2 (en) Method and apparatus for migrating the system environment on which the applications depend
CN108628748B (en) Automatic test management method and automatic test management system
CN109582301A (en) Method for processing business, device, equipment and the medium of task based access control scheduling system
CN107241315B (en) Access method and device of bank gateway interface and computer readable storage medium
CN102880503A (en) Data analysis system and data analysis method
US20180329808A1 (en) Conducting Automated Software Testing Using Centralized Controller And Distributed Test Host Servers
CN112799782B (en) Model generation system, method, electronic device and storage medium
US8423620B2 (en) Apparatus and method for testing web service interoperability
CN112463588A (en) Automatic test system and method, storage medium and computing equipment
CN115686540A (en) RPA control method and system based on Hongmong system
CN114398293A (en) Interface test case generation method, electronic device and storage medium
CN110532182B (en) Automatic testing method and device for virtualization platform
CN110727575B (en) Information processing method, system, device and storage medium
CN117056240B (en) Data element development and debugging method and system supporting offline Jar package
CN109388420A (en) Application upgrade test method, device, computer equipment and storage medium
US9374437B2 (en) Schema validation proxy
TW201407503A (en) System and method for work schedule of cloud platform
CN117806615A (en) Micro-service interface arrangement system and method based on k8s and helm
CN115185841A (en) System reconfiguration test method, device, equipment and storage medium
WO2021036987A1 (en) Method and device for achieving operation and maintenance monitoring
CN115914055A (en) Distributed network testing method, device, medium and equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination