Micro-service Sidecar injection method and system based on configuration file deployment

Through the configuration file-based deployment method, the sidecar injection process is automated, and the problems of complex injection process and strong dependencies in the existing technology are solved, and the unaware sidecar injection and efficient microservice access service grid are realized, reducing work quantity and complexity, support sidecar management in multiple scenarios.

CN119088430APending Publication Date: 2024-12-06CHINA CITIC BANK CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411023481.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-29
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

In the prior art, the sidecar injection process is complex and the dependencies are strong, which leads to the inability of microservices to inject sidecars without perception, which increases operational complexity and workload, and cannot achieve efficient use of automation tools, especially in enterprise-level environments. Multi-version management issues.

Method used

Through a configuration file-based deployment method, maintain the injection template configuration file, publish the Sidecar version configuration file, set the Webhook effectiveness mechanism and execution policy, configure the microservice configuration file, use the Kubernetes cluster to intercept the Pod to create actions, automatically match and perform Sidecar injection operations, Generate a microservice pod containing the Sidecar container.

Benefits of technology

It realizes unaware sidecar injection, reduces the dependence between microservices and sidecar deployment order, reduces the workload of the grid platform, improves flexibility and efficiency, and supports sidecar injection in scenarios such as grayscale release.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088430A_ABST
    Figure CN119088430A_ABST
Patent Text Reader

Abstract

The invention relates to a configuration file deployment-based micro-service Sidecar injection method, which is characterized in that a corresponding injection version and a version label are matched by configuring a Sidecar configuration file and a micro-service configuration file, so that a correct Sidecar configuration file can be automatically selected to execute Sidecar injection operation, and the Sidecar injection operation can be automatically executed by optimizing a Sidecar injection process. The workload of the micro-service access service grid in the aspect of Sidecar injection is reduced, the micro-service party does not need to pay attention to the whole process of Sidecar injection and the dependency relationship between the service and the Sidecar deployment sequence, and only needs to pay attention to the self service deployment condition, so that non-inductive injection and transparent injection are realized, and the implementation efficiency is improved. The method can effectively help to reduce the workload of a grid platform party related to the Sidecar injection process, including injection tool development, test, maintenance, popularization, troubleshooting and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of microservice control and data processing technology, and in particular to a microservice Sidecar injection method based on configuration file deployment. Background Art

[0002] Service Mesh is an infrastructure layer that handles inter-service communication and is used to provide reliable, fast, and secure inter-service calls in a microservice architecture. The Service Mesh platform is mainly divided into a control plane and a data plane in terms of architecture: the control plane consists of a series of control components and is mainly responsible for the management and control of the data plane, including Sidecar images, Sidecar injection conditions, service governance rules, etc.; the data plane mainly includes multiple microservices connected to the platform and a network proxy Sidecar dedicated to each microservice. The process of configuring Sidecar for a microservice during access is called Sidecar injection. Generally, Sidecar parameters are configured in the control plane to control the injection process of Sidecar and the distribution of governance rules. If microservices are deployed in a containerized manner, there will be one application container and one Sidecar container in a single Pod. As a network proxy for microservices, Sidecar itself is responsible for implementing traffic management between microservices in the mesh, including service discovery, service routing, load balancing, reliable communication, etc.

[0003] When each microservice has different customization requirements when accessing the service grid, the platform needs to release and maintain multiple versions of Sidecar for use. To ensure accurate matching injection between microservices and Sidecars with specific functions, the uniqueness of each microservice in the process of configuring Sidecar injection on the control plane is used as the effective scope: such as the microservice name, specific field values ​​in the microservice configuration Yaml file, etc. The addition, deletion, modification, and query of Sidecar images and configuration files, as well as the control and delivery to the microservice Pod, all rely on the calls between multiple components of the grid platform control plane and the Kubernetes principle.

[0004] The Sidecar injection process in complex scenarios under the existing technology mainly includes: publishing all available versions of Sidecar and their configuration files in the Mesh console; configuring microservice injection conditions and rules in the Mesh console; deploying microservices, and injecting Sidecar into them by the injection component, and the microservices are unaware of this process. Among them, due to the differences between the configuration files of multiple versions of Sidecar, for the convenience of maintenance, 1-2 level data can be used for maintenance; Level 1 is to maintain the full version of Sidecar configuration files to the Mesh console, and all microservices configure their own injection rules based on a specific version of Sidecar, mainly to define that this rule is only effective for this application; Level 2 is to abstract multiple large versions of Sidecar configuration files as a general template, and each small version references the general template to replace the placeholder information, and each microservice finds a specific version of Sidecar configuration injection rules. Due to complex scenarios such as environmental isolation in the enterprise background, the deployment locations of microservices are different. In order to facilitate the management of the Mesh platform, all Kubernetes clusters where the microservices connected to the mesh are located are generally managed so that the microservices can be operated through the cluster Apiserver. When managing a cluster, you need to submit the Kubeconfig file of the data plane cluster to the Mesh control plane component and pass it to the Openapi of Kubernetes through the interface. The control plane writes a MutatingWebhookConfiguration to the corresponding data plane cluster, which defines the effective scenario of the Kubernetes webhook mechanism. Deploy the microservice Yaml configuration file in the cluster. Under the Webhook mechanism, the Apiserver of the cluster where the microservice is located sends the Yaml file to the injection component of the control plane. The injection component reads the Yaml information and matches the configmap with the same effective range in the configmap generated by all injection configuration rules of the control plane. It takes out the Sidecar Yaml and splices it with the microservice Yaml to complete the Sidecar injection and return. Since there are a large number of Sidecar version configuration files and each microservice's proprietary information is required when configuring the injection configuration rules, microservice professionals need to intervene to complete the relevant operations.

[0005] However, in actual applications of the existing technology, due to the strong dependency between the steps, the Sidecar injection configuration must be performed first, and then the microservices are deployed and started. If the order is wrong, the microservice will not be able to inject the Sidecar; when adding the injection configuration rules for each microservice, since multiple Sidecar versions and microservice information are involved, the intervention of professionals from the microservice side is required, which significantly increases the complexity of the operation. In addition, the Service Mesh platform has long been involved in the research and development, testing, release, optimization, and execution of automation tools, which wastes human resources and cannot achieve seamless injection. On the other hand, when the Sidecar injection is configured and issued based on a certain condition of the microservice under the existing technology, if the application is grayed out, it may not meet the needs. Summary of the invention

[0006] To address the deficiencies in the prior art, the present invention proposes a microservice Sidecar injection method and system based on configuration file deployment. By optimizing the Sidecar injection process, the workload of microservice access to the service grid in Sidecar injection is reduced. The microservice party does not need to pay attention to the entire Sidecar injection process, nor does it need to pay attention to the dependency between the service and the Sidecar deployment sequence. It only needs to pay attention to its own service deployment, thereby achieving senseless injection and transparent injection, which can effectively help reduce the workload of the grid platform party related to the Sidecar injection process, including injection tool development, testing, maintenance, promotion and troubleshooting.

[0007] To achieve the above objectives, the technical solutions adopted by the present invention include:

[0008] A microservice Sidecar injection method based on configuration file deployment, characterized in that it includes executing the following steps:

[0009] S1. Maintain an injection template configuration file, and associate the injection template configuration file with at least one injection version;

[0010] S2. Release a Sidecar version configuration file, where the Sidecar version configuration file includes Sidecar information, an injection version, and an injection template configuration file associated with the injection version;

[0011] S3. Set the Webhook’s effectiveness mechanism and execution strategy;

[0012] S4. Configure a microservice configuration file corresponding to the microservice to be deployed, wherein the microservice configuration file includes a version tag, and the version tag has the same data format rule as the injected version;

[0013] S5. Deploy the microservice configuration file in the Kubernetes cluster;

[0014] S6. Use Webhook to intercept the Pod creation action and obtain the corresponding Sidecar version configuration file based on the injection version matched by the version label of the microservice configuration file;

[0015] S7. Execute and complete the Sidecar injection operation to generate a microservice Pod containing the Sidecar container.

[0016] Furthermore, the step S3 comprises:

[0017] Verify the validity of the Sidecar version configuration file;

[0018] Set the target service endpoint and trigger rules for the Webhook.

[0019] Furthermore, the Sidecar version configuration file and the microservice configuration file are in YAML file format.

[0020] Furthermore, the use of Webhook to intercept the Pod creation action includes:

[0021] Determine whether the Pod creation action meets the Webhook triggering rules;

[0022] When it is determined that the Pod creation action meets the triggering rules of the Webhook, the Pod creation action is intercepted and the corresponding Sidecar version configuration file is called according to the target service endpoint of the Webhook.

[0023] Furthermore, the executing and completing the Sidecar injection operation includes:

[0024] Perform the Sidecar injection operation according to the injection template configuration file included in the Sidecar version configuration file.

[0025] Furthermore, the version tag and the injected version have the same data format rules, including that the key name of the version tag is the same as the key name of the injected version, and the key value of the version tag selects the key value corresponding to the injected version in the Sidecar version configuration file released by the Service Mesh platform. In particular, the injection component splices and ensures that the key value of the microservice version tag has the same data format rules as the injected version, including that the key value of the version tag is consistent with the injected version number, and the spliced ​​field value is the same as the name of the Sidecar version configuration file released by the Service Mesh platform.

[0026] The present invention also relates to a microservice Sidecar injection system deployed based on a configuration file, characterized in that it includes:

[0027] A template maintenance module, used for maintaining an injection template configuration file and associating the injection template configuration file with at least one injection version;

[0028] Sidecar version configuration file publishing module, used to publish Sidecar version configuration files;

[0029] Webhook setting module, used to set the effectiveness mechanism and execution strategy of Webhook;

[0030] The microservice configuration file setting module is used to configure the microservice configuration file corresponding to the microservice to be deployed;

[0031] Microservice configuration file deployment module, used to deploy microservice configuration files in Kubernetes cluster;

[0032] The interception execution module is used to intercept the Pod creation action using Webhook, and obtain the corresponding Sidecar version configuration file according to the injection version matched by the version label of the microservice configuration file;

[0033] The injection execution module is used to execute and complete the Sidecar injection operation and generate a microservice Pod containing a Sidecar container.

[0034] The present invention also relates to a computer-readable storage medium, characterized in that a computer program is stored on the storage medium, and the computer program implements the above method when executed by a processor.

[0035] The present invention also relates to an electronic device, characterized in that it comprises a processor and a memory;

[0036] The memory is used to store the Sidecar version configuration file and the microservice configuration file;

[0037] The processor is used to execute the above method by calling the Sidecar version configuration file and the microservice configuration file.

[0038] The present invention also relates to a computer program product, comprising a computer program and / or instructions, characterized in that the computer program and / or instructions implement the steps of the above method when executed by a processor.

[0039] The beneficial effects of the present invention are:

[0040] The Sidecar injection method and system for microservices deployed based on configuration files of the present invention are used to directly specify the Sidecar version expected to be injected in the microservice Yaml file through a custom label, thereby reducing the steps of configuring the injection rules on the Mesh console, optimizing the Sidecar injection process, and the Mesh platform does not pay attention to the configuration of each injection rule, but only pays attention to the configuration files of each version of the Sidecar released by itself. To a certain extent, the Sidecar injection process of microservices is decoupled from the Mesh platform, reducing the workload of microservices accessing the service grid in Sidecar injection. The microservice party does not need to pay attention to the entire process of Sidecar injection, nor does it need to pay attention to the dependency between the service and the Sidecar deployment sequence. It only needs to pay attention to its own service deployment, realizing non-sense injection and transparent injection, which can effectively help reduce the workload of the grid platform party related to the Sidecar injection process, including injection tool development, testing, maintenance, promotion and troubleshooting. The Sidecar injection method and system for microservices of the present invention significantly improve flexibility and efficiency, and the microservice party can quickly select and replace the Sidecar version according to its own needs, and can support Sidecar injection in multiple scenarios such as grayscale release. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] Figure 1 The present invention is a flow chart of the microservice Sidecar injection method deployed based on the configuration file.

[0042] Figure 2 This is a schematic diagram of the structure of the microservice Sidecar injection system deployed based on the configuration file of the present invention. DETAILED DESCRIPTION

[0043] In order to more clearly understand the content of the present invention, it will be described in detail with reference to the accompanying drawings and embodiments. It should be noted that in the embodiments of the present application, some existing solutions in the industry such as certain software, components, models, etc. may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.

[0044] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.

[0045] The first aspect of the present invention relates to a process of steps as follows Figure 1 The method shown comprises:

[0046] S1. Maintain an injection template configuration file, and associate the injection template configuration file with at least one injection version.

[0047] In the specific implementation, the Sidecar injection template configuration file and injection version are maintained on the Mesh console, and the naming methods of the Sidecar injection template configuration files and versions are standardized to ensure that the basic information of each Sidecar template and version can be displayed, including the injection template configuration file / version, the deployment cloud container platform, i.e., Lingqiao Cloud / Full Stack Cloud, the Sidecar template number / version number, etc., such as template-mosn-container-2.0.0, version-mosn-container-arm-1.1.1, etc. The Sidecar YAML of each Sidecar injection version is created based on the Sidecar YAML of a Sidecar injection template configuration file, and replaces the placeholder information in the template, such as image, IP / port, etc.

[0048] S2. Release a Sidecar version configuration file, wherein the Sidecar version configuration file includes Sidecar information, an injection version, and an injection template configuration file associated with the injection version. Preferably, the Sidecar version configuration file adopts a YAML file format.

[0049] Preferably, in the enterprise-level context where the injection scenario is complex and the data is large, a configuration center can be introduced to further improve management efficiency. Each microservice configures the desired injected Sidecar version in the configuration center without configuring any mesh-related parameters in the Yaml file. In the specific implementation, the microservice configures the Sidecar version number in the configuration center; deploys the Yaml file under the managed cluster; under the Mutating Webhook mechanism, the Sidecar injection component receives the Yaml file to read the configuration information and then accesses the configuration center to read the Sidecar version number, and performs Sidecar version name splicing; the Sidecar injection component accesses the Mesh console interface, reads the Sidecar Yaml return of the corresponding version name, and renders it into the Pod Yaml to complete the Sidecar injection.

[0050] S3. Set the Webhook’s effectiveness mechanism and execution strategy.

[0051] Preferably, it includes verifying the validity of the Sidecar version configuration file; setting the target service endpoint and triggering rules of the Webhook.

[0052] In the specific implementation, the kubeconfig file of the data plane cluster where each microservice connected to Service Mesh is located needs to be provided to the Service Mesh platform control plane for cluster management. Cluster management is mainly to ensure that the ServiceMesh control plane can operate the cluster where the microservice is located. Once the control plane obtains the kubeconfig file, it will write specific configuration to the data plane cluster where the microservice is located through the kubernetes openapi to implement the mutating webhook mechanism to complete the Sidecar injection.

[0053] S4. Configure a microservice configuration file corresponding to the microservice to be deployed, wherein the microservice configuration file includes a version tag, and the version tag has the same data format rule as the injected version. Preferably, the microservice configuration file adopts a Yaml file format.

[0054] Preferably, the version tag and the injected version have the same data format rules, including that the key name of the version tag is the same as the key name of the injected version, and the key value of the version tag is selected from the key value corresponding to the injected version in the published Sidecar version configuration file. In particular, the injection component splices and ensures that the key value of the microservice version tag and the injected version have the same data format rules, including that the key value of the version tag is consistent with the injected version number, and the spliced ​​field value is the same as the name of the Sidecar version configuration file published by the Service Mesh square.

[0055] In the specific implementation, prepare the microservice YAML file to be deployed. The microservice party no longer needs to configure specific injection configuration rules on the mesh console. It only needs to add a custom label in the YAML file. The key of this label in all microservice YAMLs must be unified, and the Value must be the Sidecar version number released on the Mesh console. For example, if you use sidecarVersion as the Key Value of the custom label and use Sidecar version 2.3, you need to add a corresponding definition item in the deployment YAML file.

[0056] S5. Deploy the microservice configuration file in the Kubernetes cluster.

[0057] In the specific implementation, the Yaml file is deployed in the corresponding kubernetes cluster; because the Webhook Configuration has been written to the cluster where the application is located when the cluster is managed before, when the microservice Yaml file is deployed, Kubernetes detects the action of Pod creation, automatically intercepts the Pod creation action, and sends the deployed Yaml from the Apiserver of the cluster to the Sidecar injection component. The injection component reads the Yaml file in the current Pod, finds the corresponding value of the specific Label, i.e. sidecarVersion, to obtain the Sidecar version number; and automatically splices and completes the format of each Sidecar injection version name on the mesh console, splices it into version-mosn-container-2.3 according to the naming specification, accesses the Openapi interface of the mesh console to obtain the list of all version names for comparison, filters out the corresponding name Sidecar version Yaml configuration file, obtains the corresponding Sidecar Yaml from the detailed configuration and returns it to the Sidecar injection component, and the injection component renders the Sidecar Yaml into the Pod Yaml and returns it to the Kubernetes cluster to complete the injection. Each running microservice Pod has 1 application container and 1 Sidecar container.

[0058] S6. Use Webhook to intercept the Pod creation action and obtain the corresponding Sidecar version configuration file based on the injection version matched by the version label of the microservice configuration file.

[0059] Preferably, it is determined whether the Pod creation action satisfies the triggering rules of the Webhook; when it is determined that the Pod creation action satisfies the triggering rules of the Webhook, the Pod creation action is intercepted and the corresponding microservice configuration file is called according to the target service endpoint of the Webhook.

[0060] In the specific implementation, the sidecar injection process mainly uses the mutating webhook mechanism of kubernetes. When a Pod creation action is detected, the Pod creation action will be automatically intercepted, and the Pod content will be modified before returning. When the microservice deploys the application yaml file, the webhook configuration has been written to the cluster where the application is located when the cluster was previously managed. This configuration describes the configuration of the webhook. The webhook can accept or reject object requests, or change objects.

[0061] S7. The Sidecar injection component executes and completes the Sidecar injection operation, including executing the Sidecar injection operation according to the injection template configuration file included in the Sidecar version configuration file, and generating a microservice Pod containing a Sidecar container.

[0062] In specific implementation, the process of Sidecar injection is to obtain a specific injection version of Sidecar YAML and splice it with the microservice YAML. The kubeconfig file of the data plane cluster where each microservice is located needs to be provided to the ServiceMesh platform control plane for cluster management. Once the control plane obtains the Kubeconfig file, it will write a specific MutatingWebhookConfiguration to the data plane cluster where the microservice is located through Kubernetes' Openapi. MutatingWebhookConfiguration specifies that certain Kubernetes actions will be intercepted and modified under specific actions. Common actions are mainly Pod CREATE / UPDATE. When deploying the yaml file in the specified cluster and namespace, the yaml file will be sent to the Sidecar injection component by the cluster apiserver. When deploying the yaml, a new empty Pod is created, and the Sidecar injection component copies the application yaml into the empty Pod. The injection component reads the YAML in the current Pod, finds the key value in the specific label (i.e. SidecarVersion:2.3) to get the Sidecar version number, and automatically completes the Sidecar injection version name format on the mesh console. According to the naming convention, it is spliced ​​into version-mosn-container-2.3. At the same time, it accesses the openapi interface of the mesh console to obtain a list of all version names for comparison, and selects the Sidecar version configuration information with the corresponding name. The corresponding sidecar YAML is obtained from the detailed configuration and returned to the Sidecar injection component. The injection component renders the sidecar YAML into the Pod with the application YAML and returns it to the Kubernetes cluster. You can see that each corresponding running Pod has 1 application container and 1 Sidecar container.

[0063] When using the above method, the entire injection process is completed by the service mesh control plane component. The access party does not need to pay attention to the entire Sidecar injection process, achieving transparent injection.

[0064] Another aspect of the present invention relates to a system, the structure of which is as follows: Figure 2 As shown, including:

[0065] Sidecar version configuration file publishing module, used to publish Sidecar version configuration files;

[0066] Webhook setting module, used to set the corresponding Webhook according to the Sidecar version configuration file;

[0067] The microservice configuration file setting module is used to configure the microservice configuration file corresponding to the microservice to be deployed;

[0068] Microservice configuration file deployment module, used to deploy microservice configuration files in Kubernetes cluster;

[0069] The interception execution module is used to intercept the Pod creation action using Webhook, and obtain the corresponding Sidecar version configuration file according to the injection version matched by the version label of the microservice configuration file;

[0070] The injection execution module is used to perform the Sidecar injection operation using the Sidecar version configuration file to generate a microservice Pod containing a Sidecar container.

[0071] By using this system, the above-mentioned operation processing method can be executed and the corresponding technical effects can be achieved.

[0072] An embodiment of the present invention also provides a computer-readable storage medium capable of implementing all the steps in the method in the above embodiment, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, all the steps in the method in the above embodiment are implemented.

[0073] An embodiment of the present invention also provides an electronic device for executing the above method. As an implementation device of the method, the electronic device has at least a processor and a memory, and in particular, the memory stores data and related computer programs required for executing the method, such as a Sidecar version configuration file and a microservice configuration file, etc., and the processor calls the data and program in the memory to execute all the steps of the implementation method and obtains the corresponding technical effect.

[0074] Preferably, the electronic device may include a bus architecture, the bus may include any number of interconnected buses and bridges, and the bus will include various circuits linked together by one or more processors and memories. The bus may also link together various other circuits such as peripherals, voltage regulators, and power management circuits, which are all well known in the art and are therefore not further described herein. The bus interface provides an interface between the bus and the receiver and transmitter. The receiver and transmitter may be the same component, i.e., a transceiver, providing a unit for communicating with various other systems over a transmission medium. The processor is responsible for managing the bus and general processing, while the memory may be used to store data used by the processor when performing operations.

[0075] In addition, the electronic device may further include components such as a communication module, an input unit, an audio processor, a display, and a power supply. The processor (or controller, operation control) used may include a microprocessor or other processor device and / or a logic device, which receives input and controls the operation of various components of the electronic device; the memory may be one or more of a cache, a flash memory, a hard drive, a removable medium, a volatile memory, a non-volatile memory, or other suitable devices, which may store the above-mentioned related data information, and may also store a program for executing related information, and the processor may execute the program stored in the memory to realize information storage or processing, etc.; the input unit is used to provide input to the processor, for example, it may be a key or a touch input device; the power supply is used to provide power to the electronic device; the display is used to display display objects such as images and text, for example, it may be an LCD display. The communication module is a transmitter / receiver that sends and receives signals via an antenna. The communication module (transmitter / receiver) is coupled to the processor to provide input signals and receive output signals, which may be the same as the case of a conventional mobile communication terminal. Based on different communication technologies, multiple communication modules may be provided in the same electronic device, such as a cellular network module, a Bluetooth module and / or a wireless local area network module, etc. The communication module (transmitter / receiver) is also coupled to a speaker and a microphone via an audio processor to provide an audio output via the speaker and receive an audio input from the microphone, thereby realizing a common telecommunication function. The audio processor may include any suitable buffer, decoder, amplifier, etc. In addition, the audio processor is also coupled to a central processor, so that recording can be performed on the machine through the microphone, and the sound stored on the machine can be played through the speaker.

[0076] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0077] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A system that specifies the functions of a box or multiple boxes.

[0078] These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory produce a product including an instruction system, which is implemented in the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0079] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps of the functions specified in a box or multiple boxes. Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they know the basic creative concept. Therefore, the attached claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0080] The above is only a preferred specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by a person skilled in the art within the technical scope disclosed by the present invention should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims

1. A microservice Sidecar injection method based on configuration file deployment, characterized in that: This involves performing the following steps: S1. Maintain an injection template configuration file, and associate the injection template configuration file with at least one injection version; S2. Release a Sidecar version configuration file, where the Sidecar version configuration file includes Sidecar information, an injection version, and an injection template configuration file associated with the injection version; S3. Set the Webhook’s effectiveness mechanism and execution strategy; S4. Configure a microservice configuration file corresponding to the microservice to be deployed, wherein the microservice configuration file includes a version tag, and the version tag has the same data format rule as the injected version; S5. Deploy the microservice configuration file in the Kubernetes cluster; S6. Use Webhook to intercept the Pod creation action and obtain the corresponding Sidecar version configuration file based on the injection version matched by the version label of the microservice configuration file; S7. Execute and complete the Sidecar injection operation to generate a microservice Pod containing the Sidecar container.

2. The method according to claim 1, characterized in that The step S3 comprises: Verify the validity of the Sidecar version configuration file; Set the target service endpoint and trigger rules for the Webhook.

3. The method according to claim 1, characterized in that The Sidecar version configuration file and microservice configuration file are in YAML file format.

4. The method according to claim 2, characterized in that The use of Webhook to intercept Pod creation actions includes: Determine whether the Pod creation action meets the Webhook triggering rules; When it is determined that the Pod creation action meets the triggering rules of the Webhook, the Pod creation action is intercepted and the corresponding Sidecar version configuration file is called according to the target service endpoint of the Webhook.

5. The method according to claim 4, characterized in that The execution and completion of the Sidecar injection operation includes: Perform the Sidecar injection operation according to the injection template configuration file included in the Sidecar version configuration file.

6. The method according to claim 1, characterized in that The version tag and the injected version have the same data format rules, including that the key name of the version tag is the same as the key name of the injected version, and the key value of the version tag selects the key value corresponding to the injected version in the Sidecar version configuration file released by the Service Mesh platform.

7. A microservice Sidecar injection system deployed based on a configuration file, characterized in that: include: A template maintenance module, used for maintaining an injection template configuration file and associating the injection template configuration file with at least one injection version; Sidecar version configuration file publishing module, used to publish Sidecar version configuration files; Webhook setting module, used to set the effectiveness mechanism and execution strategy of Webhook; The microservice configuration file setting module is used to configure the microservice configuration file corresponding to the microservice to be deployed; Microservice configuration file deployment module, used to deploy microservice configuration files in Kubernetes cluster; The interception execution module is used to intercept the Pod creation action using Webhook, and obtain the corresponding Sidecar version configuration file according to the injection version matched by the version label of the microservice configuration file; The injection execution module is used to execute and complete the Sidecar injection operation and generate a microservice Pod containing a Sidecar container.

8. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 6 is implemented.

9. An electronic device, characterized in that: including a processor and a memory; The memory is used to store the Sidecar version configuration file and the microservice configuration file; The processor is used to execute the method described in any one of claims 1 to 6 by calling a Sidecar version configuration file and a microservice configuration file.

10. A computer program product comprising a computer program and / or instructions, characterized in that: When the computer program and / or the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

Citation Information

Cited By

  • Elastic fault tolerance method and device based on sidecar container

    CN120336071A