A method based on Gitops and Kubernetes container interaction

CN116662421BActive Publication Date: 2026-06-30CHINA MOBILE INFORMATION TECHNOLOGY CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA MOBILE INFORMATION TECHNOLOGY CO LTD
Filing Date
2022-02-17
Publication Date
2026-06-30

Smart Images

  • Figure CN116662421B_ABST
    Figure CN116662421B_ABST
Patent Text Reader

Abstract

This application provides a method for interaction between a GitTops and a Kubernetes container, relating to the field of internet technology. The method includes: establishing an interactive link between a web page and a Git repository, and passing the container's execution command to the Git repository; monitoring the Git repository via a webhook and invoking the container linker based on the interaction request; establishing interactive links between the container linker and the Git repository, and between the container linker and the container console, enabling the Kubernetes container to execute the container's execution command; and recording operation logs in the Git repository for auditing. This application's embodiments achieve isolated interaction between the web page and the Kubernetes container, avoiding direct exposure of the Kubernetes container's link address and improving interaction security; auditing during the interaction is only performed on the Git repository, effectively improving audit accuracy and reducing audit risk.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet technology, specifically to a method for interaction between gitops and Kubernetes containers. Background Technology

[0002] In existing technologies, console interaction with Kubernetes containers via web pages is primarily achieved by establishing a direct WebSocket connection between the front-end and the Kubernetes container. This method directly exposes the Kubernetes container's connection address, increasing security risks during the interaction process. Furthermore, because a WebSocket connection is used, the entire operation process of the Kubernetes container cannot be recorded after the connection is established, making it difficult to audit the console interaction process and trace the interaction information. Summary of the Invention

[0003] This application provides a method for interaction between gitops and Kubernetes containers to solve the technical problem of low security in existing direct interaction methods between web pages and Kubernetes containers.

[0004] In a first aspect, embodiments of this application provide a method for interacting with a Kubernetes container via a web page based on Gitops, including:

[0005] Based on the interaction request issued through the web page, an interactive link is established between the web page and the git repository, and the command to be executed in the container is passed to the git repository through the interactive link between the web page and the git repository;

[0006] The git repository is monitored via webhook, and the container linker is invoked based on the interaction request.

[0007] Establish interactive links between the container linker and the git repository, and between the container linker and the container console, respectively. Use the container console to make the Kubernetes container execute the commands to be executed and to provide feedback on the execution results of the commands to be executed.

[0008] Operation logs are recorded in the aforementioned git repository for auditing purposes.

[0009] In one embodiment, the git repository includes a console interaction request file, a console request file, a console response file, and a console user file. The console interaction request file is used to store the interaction requests, the console request file is used to store the commands to be executed in the container, the console response file is used to store the execution results of the commands to be executed in the container, and the console user file is used to store the operation logs.

[0010] In one embodiment, establishing an interactive link between the web page and the Git repository based on an interaction request issued through the web page includes:

[0011] The interaction request is written to the console interaction request file of the git repository via the web page;

[0012] Based on the interaction request, an interactive link is established between the web page and the console request file and console response file of the git repository.

[0013] In one embodiment, the step of monitoring the Git repository via webhook and invoking the container linker based on the interaction request includes:

[0014] The console interaction request file of the git repository is monitored by webhook, and the link information of the interaction request is extracted from the console interaction request file;

[0015] The container linker is invoked based on the link information.

[0016] In one embodiment, establishing interactive links between the container linker and the git repository, and between the container linker and the container console, includes:

[0017] Establish an interactive link between the container linker and the console request file and console response file of the git repository;

[0018] Establish an interactive link between the container linker and the container console.

[0019] In one embodiment, it also includes:

[0020] Based on the exit command issued through the web page, the file contents of the console interaction request file, console request file, and console response file in the git repository are cleared, and the interactive links between the web page and the git repository, between the container linker and the git repository, and between the container linker and the container console are closed.

[0021] In one embodiment, it also includes:

[0022] Configure access permissions for the git repository for both the web page and the container linker.

[0023] Secondly, embodiments of this application provide a device for interacting with a Kubernetes container via a web page based on Gitops, comprising:

[0024] The interaction request module is used to: establish an interaction link between the web page and the git repository based on the interaction request issued through the web page, and pass the command to be executed in the container to the git repository through the interaction link between the web page and the git repository;

[0025] The listening module is used to: listen to the git repository via webhook and call the container linker based on the interaction request;

[0026] The interaction module is used to: establish interactive links between the container linker and the git repository, and between the container linker and the container console, and to enable the k8s container to execute the container command to be executed and to provide feedback on the execution result of the container command to be executed through the container console;

[0027] The audit module is used to record operation logs in the git repository for auditing purposes.

[0028] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the program to implement the steps of the method for interacting with a Kubernetes container via a web page based on Gitops as described in the first aspect.

[0029] Fourthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for interacting with a Kubernetes container via a web page based on Gitops as described in the first aspect.

[0030] The method for interaction between Gitops and Kubernetes containers provided in this application is based on the Gitops concept. It establishes interactive links between the web page and the Git repository, the container linker and the Git repository, and the container linker and the container console using Git repository and webhook technology. This achieves isolated interaction between the web page and the Kubernetes container, avoiding direct exposure of the Kubernetes container's link address and greatly improving interaction security. Furthermore, all operation records during the interaction between the web page and the Kubernetes container are recorded in the Git repository, making all operations traceable and auditable. Auditing during the interaction between the web page and the Kubernetes container only needs to be performed on the Git repository, which effectively improves audit accuracy and reduces audit risk. Attached Figure Description

[0031] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0032] Figure 1 This is a flowchart illustrating the method for interacting with a Kubernetes container via a web page based on Gitops, as provided in an embodiment of this application.

[0033] Figure 2 This shows a partial internal structure diagram of a Git repository.

[0034] Figure 3 This is a schematic diagram of a device based on Gitops that interacts with a Kubernetes container via a web page, as provided in an embodiment of this application.

[0035] Figure 4 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application. Detailed Implementation

[0036] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0037] Figure 1 This application provides a flowchart illustrating a method for interacting with a Kubernetes container via a web page using Gitops, as described in an embodiment of the present application.

[0038] Reference Figure 1 This application provides a method for interacting with a Kubernetes container via a web page using Gitops, which may include:

[0039] S110. Based on the interaction request issued through the web page, establish an interaction link between the web page and the git repository, and pass the command to be executed in the container to the git repository through the interaction link between the web page and the git repository.

[0040] S120. Monitor the git repository via webhook and call the container linker based on the interaction request.

[0041] S130. Establish interactive links between the container linker and the git repository, and between the container linker and the container console, respectively. Use the container console to make the k8s container execute the container command to be executed and provide feedback on the execution result of the container command to be executed.

[0042] S140. Record the operation log in the git repository for auditing purposes.

[0043] It should be noted that the execution subject of the method for interacting with a Kubernetes container via a web page based on Gitops provided by this invention can be any network-side device, such as a page-to-container interaction system, etc.

[0044] Between steps S110 and S140, the network-side device will first execute step S100:

[0045] Set up a Git repository.

[0046] To achieve isolated interaction between the web page and the Kubernetes container, it is necessary to add directories and file designs related to the transit function in the Git repository, for example, see [link to Git repository]. Figure 2You can add a `container` directory to the root directory of the Git repository, and then create a `console.opt` file, a `consolerequest.opt` file, a `consoleresponse.opt` file, and a `consoleuserx.log` file for a specific user (UserN) within the `container` directory. The `console.opt` file stores interaction requests, the `consolerequest.opt` file stores commands to be executed in the container, the `consoleresponse.opt` file stores the execution results of commands to be executed in the container, and the `consoleuserx.log` file stores operation logs.

[0047] Specifically, step S100 may include:

[0048] S1001. Add a container directory in the root directory of the git repository.

[0049] S1002. Create user directories and console interaction files for users;

[0050] Specifically, after creating a user on the application system or Git, you can use an API (such as GitLab API) to call Git's directory and file creation service to create a subdirectory (UserN) for that user in the container directory, as well as userxconsole interaction request files, console request files, console response files, and console user files.

[0051] The console interaction request file can be configured to: temporarily store interaction requests from the web page, and delete the interaction request after it is processed; the console request file can be configured to: temporarily store container commands to be executed from the web page, and delete the container commands to be executed after they are processed; the console response file can be configured to: temporarily store the execution results of container commands to be executed, and delete the execution results of container commands to be executed after they are successfully returned to the web page; and the console user file can be configured to: record the entire process of user (UserN) interaction.

[0052] The console user file can record information such as the following:

[0053] 1) Record the process of establishing a two-way interactive long link between the user and the container console:

[0054] Record the interaction requests initiated by the user on the web page to establish interaction with the Kubernetes container, and record the operation information of the network-side device to write the interaction requests to the console interaction request file;

[0055] Record information about the process of establishing a two-way interactive long link between the web page and the container's Git repository.

[0056] 2) Record the process of a user issuing a command to be executed in a container via a web page:

[0057] Record the operation of the user entering the command to be executed for the container through the command interaction window of the web page, and the network-side device writing the command to be executed for the container into the console request file;

[0058] Record the process of a web page reading the execution result of a command to be executed from a container in a console response file, and displaying the result in an interactive window.

[0059] 3) Record the process of closing the interaction between the web page and the Kubernetes container:

[0060] Records user actions such as issuing the exit command (exit command) through the command interface window of the web page;

[0061] Record the process by which the network-side device disconnects the bidirectional long-lived links between the web page and the console request file, the console response file, the container linker and the git repository, and the container linker and the container console.

[0062] In step S110, the network-side device establishes an interactive link between the web page and the git repository based on the interactive request sent through the web page, and transmits the container's execution command to the git repository through the interactive link between the web page and the git repository.

[0063] It should be noted that step S110 may include:

[0064] The interaction request is written to the console interaction request file of the git repository via the web page;

[0065] Based on the interaction request, a bidirectional long link is established between the web page and the console request file and console response file of the git repository.

[0066] In step S120, the network-side device will listen to the git repository through webhook and call the container linker according to the interaction request.

[0067] It should be noted that step S120 may include:

[0068] The webhook listener monitors the console interaction request file of the git repository and extracts the link information of the interaction request from the console interaction request file.

[0069] The container linker is invoked based on the link information.

[0070] In step S130, the network-side device establishes interactive links between the container linker and the git repository, as well as between the container linker and the container console, and uses the container console to enable the k8s container to execute the container command to be executed and to provide feedback on the execution result of the container command to be executed.

[0071] It should be noted that step S130 may include:

[0072] Establish a bidirectional long-lived link between the container linker and the console request file and console response file of the git repository;

[0073] A bidirectional, long-lived interactive link is established between the container linker and the container console by calling an API interface (such as the k8s ApiServer interface).

[0074] It should be noted that a long-lived bidirectional link between the container linker and the console request file allows the container linker to read the command to be executed from the console request file. Then, a long-lived bidirectional link between the container linker and the container console allows the container console to control the Kubernetes container to execute the command. After the Kubernetes container executes the command, it will obtain the execution result. The long-lived bidirectional link between the container linker and the container console allows the container linker to obtain the execution result. A long-lived bidirectional link between the container linker and the console response file then sends the execution result back to the console response file. Finally, a long-lived bidirectional link between the web page and the console response file sends the execution result back to the web page.

[0075] In step S140, the network-side device will record the operation log to the git repository for auditing purposes.

[0076] It should be noted that operation logs can be recorded in the `console.log` file in the corresponding user's home directory within the Git repository. For example, all user interactions with the Kubernetes container via the web page can be recorded in the `consoleuserx.log` file located in the user's home directory within the Git repository.

[0077] Auditing the console user file allows for the auditing of all operations that interact with the Kubernetes container through web pages.

[0078] The audit content may include, for example:

[0079] 1) Users initiate an interaction request to establish interaction with the Kubernetes container through function buttons on the web page, and the network-side device writes the interaction request to the console interaction request file.

[0080] 2) The process of establishing a two-way interactive long link between the web page and the console request file and console response file, the process of establishing a two-way interactive long link between the container linker and the console request file and console response file, and the process of establishing a two-way interactive long link between the container linker and the container console.

[0081] 3) The user enters the command to be executed for the container through the command interaction window of the web page, and the network-side device writes the command to be executed for the container into the console request file.

[0082] 4) The process of the web page reading the execution result of the container command to be executed in the console response file and displaying the execution result of the container command to be executed in the interactive interface window of the web page.

[0083] 5) Users can initiate an exit command through the command interface window on the web page.

[0084] 6) The process of establishing a two-way interactive long link between the web page and the console request file and console response file, the process of establishing a two-way interactive long link between the container linker and the console request file and console response file, and the process of establishing a two-way interactive long link between the container linker and the container console.

[0085] Flexible auditing methods can be adopted, such as real-time online auditing and offline auditing, which makes the auditing process simpler and more convenient, improves auditing efficiency and credibility, and reduces auditing risks.

[0086] The method for interacting with a Kubernetes container via a web page using Gitops, provided in this application embodiment, is based on the Gitops concept. It utilizes Git repository and webhook technology to establish interactive links between the web page and the Git repository, between the container linker and the Git repository, and between the container linker and the container console. This achieves isolated interaction between the web page and the Kubernetes container, avoiding direct exposure of the Kubernetes container's link address and greatly improving interaction security. Furthermore, all operations during the interaction between the web page and the Kubernetes container are recorded in the Git repository, making all operations traceable and auditable. Auditing during the interaction between the web page and the Kubernetes container only needs to be performed on the Git repository, effectively improving audit accuracy and reducing audit risk. In addition, the method for interacting with a Kubernetes container via a web page using Gitops provided in this application embodiment ensures environmental consistency and enables version management of resource configurations and stable, reproducible rollback.

[0087] In one embodiment, the method for interacting with a Kubernetes container via a web page based on Gitops may further include the following steps:

[0088] Based on the exit command issued through the web page, the file contents of the console interaction request file, console request file, and console response file in the git repository are cleared, and the interactive links between the web page and the git repository, between the container linker and the git repository, and between the container linker and the container console are closed.

[0089] It's important to note that after the user's interaction with the Kubernetes container ends, they can issue an `exit` command via the web page. The network-side device, upon receiving this command, will simultaneously close the persistent connections between the web page and the Git repository's console request and response files. The web page will then send the exit command to the container linker. Upon receiving the exit command, the network-side device will close the persistent connections between the container linker and the Git repository's console request and response files. The container linker will then call the Kubernetes APIServer to close the persistent connections between itself and the container's console. Simultaneously, the container linker will send the disconnection information to the webhook listener, which will then clear the contents of the console request, console request file, and console response file in the Git repository. Throughout this process, all operations are logged to the Git repository's console user file, providing comprehensive auditing data.

[0090] In one embodiment, the method for interacting with a Kubernetes container via a web page based on Gitops may further include the following steps:

[0091] Configure access permissions for the git repository for both the web page and the container linker.

[0092] It's important to note that you can configure permissions so that only the web page has write access to the Git repository's console request file; you can configure the web page to have read access only to the Git repository's console response file; you can configure the container linker to have read access only to the Git repository's console request file; and you can configure only the container linker to have write access only to the Git repository's console response file. In other words, for the Git repository's console request file, only the web page can write information, while the container linker can only read information; for the Git repository's console response file, only the container linker can write information, while the web page can only read information. This prevents resource contention. Furthermore, by controlling access permissions to files in the Git repository, you can restrict access to the Kubernetes container, effectively improving security.

[0093] The method provided in this application for interacting with the Kubernetes container via a web page based on Gitops can provide a user interface by writing a front-end program in Vue and a program written in Go to listen for Git and cluster events. It avoids the need to establish long connections between the front-end and back-end, thus consuming network resources. It decouples the front-end from Git, allowing users to directly operate Git and update cluster resources in real time. It can also check and update resource status in a targeted manner based on Git and cluster events, avoiding resource consumption caused by periodically traversing a large number of configuration files in Git.

[0094] The following describes the apparatus for interacting with a Kubernetes container via a web page based on Gitops, provided in the embodiments of this application. The apparatus for interacting with a Kubernetes container via a web page based on Gitops described below can be referred to in correspondence with the method for interacting with a Kubernetes container via a web page based on Gitops described above.

[0095] Figure 3 This application provides a schematic diagram of the structure of a device that interacts with a Kubernetes container via a web page using Gitops, according to an embodiment of the present application.

[0096] Reference Figure 3 This application provides an apparatus for interacting with a Kubernetes container via a web page using Gitops, which may include:

[0097] The interaction request module 310 is used to: establish an interaction link between the web page and the git repository based on the interaction request issued through the web page, and pass the container's execution command to the git repository through the interaction link between the web page and the git repository;

[0098] The listening module 320 is used to: listen to the git repository via webhook and call the container linker based on the interaction request;

[0099] The interaction module 330 is used to: establish interactive links between the container linker and the git repository, and between the container linker and the container console, and to enable the k8s container to execute the container command to be executed and to provide feedback on the execution result of the container command to be executed through the container console;

[0100] Audit module 340 is used to record operation logs to the git repository for auditing purposes.

[0101] It should be noted that the git repository includes a console interaction request file, a console request file, a console response file, and a console user file. The console interaction request file is used to store the interaction requests, the console request file is used to store the commands to be executed in the container, the console response file is used to store the execution results of the commands to be executed in the container, and the console user file is used to store the operation logs.

[0102] In one embodiment, the interaction request module 310 may include:

[0103] The interaction request writing submodule is used to: write the interaction request to the console interaction request file of the git repository through the web page;

[0104] The first interactive link establishment submodule is used to: establish an interactive link between the web page and the console request file and console response file of the git repository according to the interactive request.

[0105] In one embodiment, the monitoring module 320 may include:

[0106] The link information extraction submodule is used to: listen to the console interaction request file of the git repository through webhook, and extract the link information of the interaction request from the console interaction request file;

[0107] The container linker calling submodule is used to: call the container linker based on the linking information.

[0108] In one embodiment, the interaction module 330 may include:

[0109] The second interactive link establishment submodule is used to: establish an interactive link between the container linker and the console request file and console response file of the git repository;

[0110] The third interactive link establishment submodule is used to establish an interactive link between the container linker and the container console.

[0111] In one embodiment, it further includes:

[0112] The interactive exit module is used to: based on the exit command issued through the web page, clear the file contents of the console interactive request file, console request file, and console response file in the git repository, and close the interactive links between the web page and the git repository, between the container linker and the git repository, and between the container linker and the container console.

[0113] In one embodiment, it further includes:

[0114] The access permission setting module is used to set the access permissions of the web page and the container linker to the git repository, respectively.

[0115] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 810, a communication interface 820, a memory 830, and a communication bus 840, wherein the processor 810, the communication interface 820, and the memory 830 communicate with each other via the communication bus 840. The processor 810 can call a computer program in the memory 830 to execute steps of a method for interacting with a Kubernetes container via a web page based on Gitops, such as including:

[0116] Based on the interaction request issued through the web page, an interactive link is established between the web page and the git repository, and the command to be executed in the container is passed to the git repository through the interactive link between the web page and the git repository;

[0117] The git repository is monitored via webhook, and the container linker is invoked based on the interaction request.

[0118] Establish interactive links between the container linker and the git repository, and between the container linker and the container console, respectively. Use the container console to make the Kubernetes container execute the commands to be executed and to provide feedback on the execution results of the commands to be executed.

[0119] Operation logs are recorded in the aforementioned git repository for auditing purposes.

[0120] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0121] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can perform the steps of the method for interacting with a Kubernetes container via a web page based on Gitops provided in the above embodiments, such as including:

[0122] Based on the interaction request issued through the web page, an interactive link is established between the web page and the git repository, and the command to be executed in the container is passed to the git repository through the interactive link between the web page and the git repository;

[0123] The git repository is monitored via webhook, and the container linker is invoked based on the interaction request.

[0124] Establish interactive links between the container linker and the git repository, and between the container linker and the container console, respectively. Use the container console to make the Kubernetes container execute the commands to be executed and to provide feedback on the execution results of the commands to be executed.

[0125] Operation logs are recorded in the aforementioned git repository for auditing purposes.

[0126] On the other hand, embodiments of this application also provide a processor-readable storage medium storing a computer program, the computer program being used to cause a processor to execute the steps of the method for interacting with a Kubernetes container via a web page based on Gitops provided in the above embodiments, for example including:

[0127] Based on the interaction request issued through the web page, an interactive link is established between the web page and the git repository, and the command to be executed in the container is passed to the git repository through the interactive link between the web page and the git repository;

[0128] The git repository is monitored via webhook, and the container linker is invoked based on the interaction request.

[0129] Establish interactive links between the container linker and the git repository, and between the container linker and the container console, respectively. Use the container console to make the Kubernetes container execute the commands to be executed and to provide feedback on the execution results of the commands to be executed.

[0130] Operation logs are recorded in the aforementioned git repository for auditing purposes.

[0131] The processor-readable storage medium can be any available medium or data storage device that the processor can access, including but not limited to magnetic memory (e.g., floppy disk, hard disk, magnetic tape, magneto-optical disk (MO)), optical memory (e.g., CD, DVD, BD, HVD), and semiconductor memory (e.g., ROM, EPROM, EEPROM, non-volatile memory (NAND FLASH), solid-state drive (SSD)).

[0132] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0133] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0134] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for interacting with a Kubernetes container via a web page using Gitops, characterized in that, include: Based on the interaction request issued through the web page, an interactive link is established between the web page and the git repository, and the command to be executed in the container is passed to the git repository through the interactive link between the web page and the git repository; The git repository is monitored via webhook, and the container linker is invoked based on the interaction request. Establish interactive links between the container linker and the git repository, and between the container linker and the container console, respectively. Use the container console to make the Kubernetes container execute the commands to be executed and to provide feedback on the execution results of the commands to be executed. The operation logs will be recorded in the aforementioned git repository for auditing purposes; The Git repository includes a console interaction request file, a console request file, a console response file, and a console user file. The console interaction request file stores the interaction requests, the console request file stores the commands to be executed by the container, the console response file stores the execution results of the commands to be executed by the container, and the console user file stores the operation logs. Specifically, for the Git repository's console request file, only the web page can write information, while the container linker can only read information; similarly, for the Git repository's console response file, only the container linker can write information, while the web page can only read information.

2. The method for interacting with a Kubernetes container via a web page based on Gitops according to claim 1, characterized in that, The step of establishing an interactive link between the web page and the Git repository based on the interaction request issued through the web page includes: The interaction request is written to the console interaction request file of the git repository via the web page; Based on the interaction request, an interactive link is established between the web page and the console request file and console response file of the git repository.

3. The method for interacting with a Kubernetes container via a web page based on Gitops according to claim 2, characterized in that, The step of monitoring the Git repository via webhook and invoking the container linker based on the interaction request includes: The console interaction request file of the git repository is monitored by webhook, and the link information of the interaction request is extracted from the console interaction request file; The container linker is invoked based on the link information.

4. The method for interacting with a Kubernetes container via a web page based on Gitops according to claim 1, characterized in that, The establishment of interactive links between the container linker and the git repository, and between the container linker and the container console, includes: Establish an interactive link between the container linker and the console request file and console response file of the git repository; Establish an interactive link between the container linker and the container console.

5. The method for interacting with a Kubernetes container via a web page based on Gitops according to any one of claims 1-4, characterized in that, Also includes: Based on the exit command issued through the web page, the file contents of the console interaction request file, console request file, and console response file in the git repository are cleared, and the interactive links between the web page and the git repository, between the container linker and the git repository, and between the container linker and the container console are closed.

6. The method for interacting with a Kubernetes container via a web page based on Gitops according to any one of claims 1-4, characterized in that, Also includes: Configure access permissions for the git repository for both the web page and the container linker.

7. A device for interacting with a Kubernetes container via a web page using Gitops, characterized in that, include: The interaction request module is used to: establish an interaction link between the web page and the git repository based on the interaction request issued through the web page, and pass the command to be executed in the container to the git repository through the interaction link between the web page and the git repository; The listening module is used to: listen to the git repository via webhook and call the container linker based on the interaction request; The interaction module is used to: establish interactive links between the container linker and the git repository, and between the container linker and the container console, and to enable the k8s container to execute the container command to be executed and to provide feedback on the execution result of the container command to be executed through the container console; The auditing module is used to: record operation logs in the git repository for auditing purposes; The Git repository includes a console interaction request file, a console request file, a console response file, and a console user file. The console interaction request file stores the interaction requests, the console request file stores the commands to be executed by the container, the console response file stores the execution results of the commands to be executed by the container, and the console user file stores the operation logs. Specifically, for the Git repository's console request file, only the web page can write information, while the container linker can only read information; similarly, for the Git repository's console response file, only the container linker can write information, while the web page can only read information.

8. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method for interacting with a Kubernetes container via a web page based on Gitops, as described in any one of claims 1 to 6.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method for interacting with a Kubernetes container via a web page based on Gitops, as described in any one of claims 1 to 6.