Data processing method and device based on Kubernetes, computer equipment, readable storage medium and program product

By using sidecar container loading environment backup tool image in Kubernetes, the problem of low data backup efficiency and inability to cross clusters in Kubernetes is solved, efficient data backup and recovery is achieved, and full and incremental backup is supported, which directly solves physical backups. file and network issues.

CN119226042AInactive Publication Date: 2024-12-31GUANGZHOU DINGJIA COMPUTER TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411326655.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-23
Publication Date
2024-12-31
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The existing technology has problems such as inefficient data backup in Kubernetes, inability to cross clusters, and inability to distinguish resources. The traditional etcd database backup method cannot meet the needs of efficient backup and recovery.

Method used

By using the sidecar container loading environment backup tool image in Kubernetes, the backup container and the data to be backed up are run in the same pod, supporting full and incremental backups, and saving backup data in external storage, realizing cross-cluster backup and recovery .

Benefits of technology

It improves backup efficiency, avoids the tedious process of scheduling and mounting of storage volumes, supports cross-cluster backup and recovery, directly solves the file and network problems of physical backup, and realizes metadata backup.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119226042A_ABST
    Figure CN119226042A_ABST
Patent Text Reader

Abstract

The invention relates to a data processing method and device based on Kubernetes, computer equipment, a computer readable storage medium and a computer program product. By adopting the method, the backup process can be accelerated, and the backup efficiency can be improved. The method comprises the following steps: in response to a data backup instruction sent by a client, obtaining to-be-backed-up data, and determining an environment backup tool of the to-be-backed-up data; according to the environment backup tool, constructing an environment backup tool mirror image, and uploading the environment backup tool mirror image to a mirror image warehouse of Kubernetes; loading an environment backup container containing an environment backup tool from the mirror image warehouse through a side vehicle container of Kubernetes; the environment backup container and the data to be backed up are operated in the same pod of Kubernetes in a preset mode; and in the environment backup tool mirror image, backing up the to-be-backed-up data by using an environment backup tool in the environment backup container.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a data processing method, apparatus, computer equipment, computer-readable storage medium, and computer program product based on Kubernetes. Background Art

[0002] With the development of computer technology, an open source container orchestration platform Kubernetes has emerged. During the operation of Kubernetes, a namespace may be accidentally deleted due to various reasons, resulting in the deletion of all resources under the namespace. The reasons may be physical reasons such as server damage or the need to reinstall the system. Therefore, Kubernetes data needs to be backed up.

[0003] In traditional technology, the etcd database that stores metadata in Kubernetes is usually backed up. However, this backup method has many disadvantages, such as the inability to cross clusters and only full backup. In addition, since etcd, a key-value database, has no hierarchical concept and cannot distinguish resources in the cluster, the backup scope is large, resulting in low backup efficiency in this backup method. Summary of the invention

[0004] Based on this, it is necessary to provide a data processing method, device, computer equipment, computer-readable storage medium and computer program product based on Kubernetes to address the above technical problems.

[0005] In a first aspect, the present application provides a data processing method based on Kubernetes, comprising:

[0006] In response to a data backup instruction sent by a client, the data to be backed up is obtained, and an environment backup tool for the data to be backed up is determined;

[0007] According to the environment backup tool, build an environment backup tool image, and upload the environment backup tool image to the image warehouse of Kubernetes;

[0008] Loading the environment backup container containing the environment backup tool from the image repository through the sidecar container of Kubernetes;

[0009] Running the environment backup container and the data to be backed up in the same pod of the Kubernetes in a preset manner;

[0010] In the environment backup tool image, the data to be backed up is backed up using the environment backup tool in the environment backup container.

[0011] In one of the embodiments, loading the environment backup container including the environment backup tool from the image repository through the sidecar container of Kubernetes includes:

[0012] A new container item is configured in the sidecar container of the Kubernetes; the environment backup container including the environment backup tool is loaded from the image repository, and the environment backup container is scheduled to the container item; after the environment backup container is scheduled, the Kubernetes is restarted.

[0013] In one embodiment, the step of running the environment backup container and the data to be backed up in a same pod of the Kubernetes in a preset manner includes:

[0014] Determine that the preset mode is the additional mode, and run the environment backup container and the data to be backed up in the same pod of the Kubernetes through the additional mode; check the running status of the Kubernetes, and when the current state of the pod is the running state, confirm that the environment backup container runs successfully; when the current state of the pod is the non-running state, reload the environment backup container from the image repository.

[0015] In one embodiment, the step of backing up the data to be backed up using the environment backup tool in the environment backup container includes:

[0016] Determine a target backup method among candidate backup methods; the candidate backup methods include full backup and incremental backup; according to the target backup method, use the environment backup tool in the environment backup container to back up the data to be backed up, and save the backed-up data to an external storage device.

[0017] In one embodiment, the method further comprises:

[0018] In response to a data recovery instruction sent by the client, a configuration item corresponding to the image name of the environment backup tool image is added to the environment backup container; according to the configuration item, corresponding metadata backup information is read from the external memory; and resources of the metadata backup information are sorted to obtain the restored data.

[0019] In one embodiment, uploading the environment backup tool image to the image repository of Kubernetes includes:

[0020] Obtain data identification information of the data to be backed up, and match the corresponding target storage space in the image warehouse according to the data identification information; in response to an upload instruction of the environment backup tool image, upload the environment backup tool image to the target storage space in the image warehouse.

[0021] In a second aspect, the present application also provides a data processing device based on Kubernetes, including:

[0022] A data acquisition module, used to respond to a data backup instruction sent by a client, acquire the data to be backed up, and determine an environment backup tool for the data to be backed up;

[0023] An image building module is used to build an environment backup tool image according to the environment backup tool, and upload the environment backup tool image to the image warehouse of Kubernetes;

[0024] A container loading module, used to load the environment backup container containing the environment backup tool from the image repository through the sidecar container of the Kubernetes;

[0025] A container running module, used to run the environment backup container and the data to be backed up in the same pod of the Kubernetes in a preset manner;

[0026] A data backup module is used to back up the data to be backed up in the environment backup tool image using the environment backup tool in the environment backup container.

[0027] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:

[0028] In response to a data backup instruction sent by a client, the data to be backed up is obtained, and an environment backup tool for the data to be backed up is determined; according to the environment backup tool, an environment backup tool image is constructed, and the environment backup tool image is uploaded to the image repository of Kubernetes; through the sidecar container of the Kubernetes, an environment backup container containing the environment backup tool is loaded from the image repository; the environment backup container and the data to be backed up are run in the same pod of the Kubernetes in a preset manner; in the environment backup tool image, the data to be backed up is backed up using the environment backup tool in the environment backup container.

[0029] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the following steps are implemented:

[0030] In response to a data backup instruction sent by a client, the data to be backed up is obtained, and an environment backup tool for the data to be backed up is determined; according to the environment backup tool, an environment backup tool image is constructed, and the environment backup tool image is uploaded to the image repository of Kubernetes; through the sidecar container of the Kubernetes, an environment backup container containing the environment backup tool is loaded from the image repository; the environment backup container and the data to be backed up are run in the same pod of the Kubernetes in a preset manner; in the environment backup tool image, the data to be backed up is backed up using the environment backup tool in the environment backup container.

[0031] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:

[0032] In response to a data backup instruction sent by a client, the data to be backed up is obtained, and an environment backup tool for the data to be backed up is determined; according to the environment backup tool, an environment backup tool image is constructed, and the environment backup tool image is uploaded to the image repository of Kubernetes; through the sidecar container of the Kubernetes, an environment backup container containing the environment backup tool is loaded from the image repository; the environment backup container and the data to be backed up are run in the same pod of the Kubernetes in a preset manner; in the environment backup tool image, the data to be backed up is backed up using the environment backup tool in the environment backup container.

[0033] The above-mentioned data processing method, device, computer equipment, computer-readable storage medium and computer program product based on Kubernetes can directly run the backup container in the same pod in Kubernetes in a preset manner with the backup application, and in Kubernetes, it can be configured so that multiple containers in the pod can share network and storage resources. It only needs to encapsulate any backup method in the prior art into a container, and configure the container to be backed up with the backup container in combination with the above method, so as to solve the problems of files and networks required for physical backup, and there is no need to worry about which storage volume plug-in is used, and it can directly back up and restore. In addition, it can also cross clusters and select resources in the Kubernetes cluster, and can perform full backup and incremental backup. At the same time, metadata can be backed up, effectively avoiding the tedious process of scheduling and mounting the storage volume of Kubernetes, thereby speeding up the backup process and improving backup efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.

[0035] FIG1 is an application environment diagram of a data processing method based on Kubernetes in one embodiment;

[0036] Figure 2 A schematic diagram of a data processing method based on Kubernetes in one embodiment;

[0037] Figure 3 A schematic diagram of a process of loading an environment backup container in one embodiment;

[0038] Figure 4 A schematic diagram of a data processing method based on Kubernetes in a specific embodiment;

[0039] Figure 5 is a structural block diagram of a data processing device based on Kubernetes in one embodiment;

[0040] FIG. 6 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0041] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0042] The Kubernetes-based data processing method provided in the embodiment of the present application can be applied to the application environment shown in Figure 1. Among them, the terminal communicates with the server through the network. The data storage system can store the data that the server needs to process. The data storage system can be integrated on the server, or it can be placed on the cloud or other network servers.

[0043] Specifically, the Kubernetes-based data processing method provided in the embodiment of the present application can be executed by a server.

[0044] Exemplarily, the server responds to a data backup instruction sent by the client, obtains the data to be backed up, and determines an environment backup tool for the data to be backed up; the server builds an environment backup tool image according to the environment backup tool, and uploads the environment backup tool image to the image repository of Kubernetes; the server loads the environment backup container containing the environment backup tool from the image repository through the sidecar container of Kubernetes; the server runs the environment backup container in the same pod of Kubernetes with the data to be backed up in a preset manner; the server uses the environment backup tool in the environment backup container in the environment backup tool image to back up the data to be backed up.

[0045] In the application environment shown in FIG1 , the terminal may be, but is not limited to, various personal computers, notebook computers, smart phones, and tablet computers. The server may be implemented as an independent server or a server cluster consisting of multiple servers.

[0046] In one embodiment, Figure 2 As shown, a data processing method based on Kubernetes is provided, which is described by taking the method applied to the server in FIG1 as an example, and includes the following steps:

[0047] Step S201, in response to a data backup instruction sent by a client, obtaining data to be backed up and determining an environment backup tool for the data to be backed up.

[0048] Among them, the environment backup tool can be used to create and manage backups of the computing environment to ensure that data and configurations can be restored in the event of system failure, data loss or other unexpected events. Depending on the usage scenario, the environment backup tool can have various forms, including system backup, application backup, database backup, etc.

[0049] Specifically, the server obtains the data to be backed up in response to the data backup instruction sent by the client, and determines the environment backup tool of the data to be backed up according to the data backup instruction.

[0050] Step S202: Build an environment backup tool image according to the environment backup tool, and upload the environment backup tool image to the image repository of Kubernetes.

[0051] Specifically, the server builds an environment backup tool image according to the environment backup tool, and uploads the environment backup tool image to the corresponding target storage space in the image warehouse used by Kubernetes.

[0052] Among them, the environment backup tool image can be an image that contains specific backup and recovery tools, which is designed to simplify and standardize backup and recovery operations. Such an image can be used to create, manage and restore data backups, ensure consistency in different environments, and reduce the complexity of configuration and management.

[0053] For example, the server first needs to create an image of the database, files and other environmental backup tools. Here, according to actual needs, XtraBackup can be used for data such as MySQL, MariaDB, and Percona Server. For others, you can query the database-related community to see if there is a suitable tool.

[0054] Step S203: Load the environment backup container containing the environment backup tool from the image repository through the sidecar container of Kubernetes.

[0055] Among them, the sidecar container is a common design pattern in containerized applications. It can be an auxiliary container running next to the main container, usually used to provide additional functions or services. The sidecar container shares the same network namespace and storage volume with the main container, so they can work together to enhance the functionality of the main container.

[0056] Specifically, the server uses the Kubernetes sidecar container to add an environment backup container containing the environment backup tool under the spec configuration container item in the original MySQL Kubernetes cluster YAML file.

[0057] Step S204: Run the environment backup container and the data to be backed up in the same pod of Kubernetes in a preset manner.

[0058] Among them, pod is the smallest and most basic deployment unit in Kubernetes. A pod can contain one or more containers (such as Docker containers), which share the same network namespace, storage volume, and life cycle.

[0059] Specifically, when the preset mode is the additional mode, the server runs the environment backup container in the same pod of Kubernetes with the data to be backed up in the additional mode.

[0060] Step S205: In the environment backup tool image, the environment backup tool in the environment backup container is used to back up the data to be backed up.

[0061] Specifically, the server uses the environment backup tool in the environment backup container to back up the data to be backed up in the environment backup tool image.

[0062] For example, the server enters the created environment backup tool image and uses the environment backup tool in the environment backup container to back up the MySQL database.

[0063] The above-mentioned data processing method based on Kubernetes can directly run the backup container in the same pod in Kubernetes with the backup application in a preset manner, and in Kubernetes, it can be configured so that multiple containers in the pod can share network and storage resources. It is only necessary to encapsulate any backup method in the prior art into a container, and configure the container to be backed up with the backup container in combination with the above method, so as to solve the problems of files and networks required for physical backup, and there is no need to worry about which storage volume plug-in is used, and it can be directly backed up and restored. In addition, it can also cross clusters and select resources in the Kubernetes cluster, and can perform full and incremental backups. At the same time, metadata can be backed up, effectively avoiding the tedious process of scheduling and mounting Kubernetes storage volumes, thereby speeding up the backup process and improving backup efficiency.

[0064] In one embodiment, if Figure 3 As shown, in the above step S203, the environment backup container including the environment backup tool is loaded from the image repository through the sidecar container of Kubernetes, which specifically includes the following steps:

[0065] Step S301, configure a new container item in the sidecar container of Kubernetes.

[0066] Step S302: load an environment backup container including an environment backup tool from an image repository, and schedule the environment backup container to a container item.

[0067] Step S303: After the environment backup container scheduling is completed, restart Kubernetes.

[0068] Specifically, the server configures a new container item in the sidecar container of Kubernetes, loads the environment backup container containing the environment backup tool from the image repository, schedules the environment backup container to the container item, and then uses the kubectl command apply of the Kubernetes cluster to apply the current changes. The cluster will be automatically scheduled and restarted.

[0069] In this embodiment, in Kubernetes, the sidecar container can be implemented by defining multiple containers in a Pod, so that the sidecar container can share the network and volume with the main container to achieve collaborative functions.

[0070] In one embodiment, in the above step S204, the environment backup container is run in the same pod of Kubernetes with the data to be backed up in a preset manner, which specifically includes the following steps:

[0071] Determine that the preset mode is the attachment mode, and run the environment backup container in the same pod of Kubernetes with the data to be backed up in the attachment mode; check the operation status of Kubernetes, and if the current status of the pod is running, confirm that the environment backup container runs successfully; if the current status of the pod is not running, reload the environment backup container from the image repository.

[0072] Specifically, the server runs the environment backup container in the same pod of Kubernetes as the data to be backed up by attaching it; uses the kubectl command to view the running status of the pod in Kubernetes, and when the current state of the pod is running, confirms that the environment backup container runs successfully; when the current state of the pod is not running, reloads the environment backup container from the image repository.

[0073] In this embodiment, by checking the running status of Kubernetes and making adaptive adjustments, the stable operation of the environment backup container is guaranteed and the backup process is accelerated.

[0074] In one embodiment, in the above step S205, backing up the data to be backed up using the environment backup tool in the environment backup container specifically includes the following steps:

[0075] Determine the target backup method among the candidate backup methods; the candidate backup methods include full backup and incremental backup; according to the target backup method, use the environment backup tool in the environment backup container to back up the data to be backed up, and save the backed-up data to the external storage. In response to the data recovery instruction sent by the client, add the configuration item corresponding to the image name of the environment backup tool image in the environment backup container; according to the configuration item, read the corresponding metadata backup information from the external storage, and sort the metadata backup information by resources to obtain the restored data.

[0076] Configuration items are items used to set and adjust operating parameters in software or systems. These configuration items can control the behavior, functionality, and appearance of the software. For example, in an application, configuration items may include network settings, user permissions, and interface themes. They are usually defined in configuration files and can be loaded and applied at runtime or startup.

[0077] Specifically, the server enters the created environment backup tool image, uses the environment backup tool prepared in the environment backup container to back up the MySQL database, and saves the backed-up data to the external storage. When restoring data, the environment backup container and the lnit container feature of Kubernetes are used to perform data recovery, and new configuration items need to be added to the original MySQL yaml file.

[0078] In this embodiment, by configuring the container to be backed up and the backup container, the problems of files and networks required for physical backup can be solved, and there is no need to worry about the type of storage volume plug-in, and data can be directly backed up and restored.

[0079] In one embodiment, in the above step S202, uploading the environment backup tool image to the image repository of Kubernetes specifically includes the following steps:

[0080] Obtain data identification information of the data to be backed up, and match the corresponding target storage space in the image warehouse according to the data identification information; in response to the upload instruction of the environment backup tool image, upload the environment backup tool image to the target storage space in the image warehouse.

[0081] Among them, data identification information can be various information used to uniquely identify, mark and track data. This identification information can help the system accurately locate, manage and operate specific data items in large amounts of data, such as unique identifiers, metadata and tags.

[0082] Specifically, the server matches the corresponding target storage space in the image warehouse according to the data identification information, and in response to the upload instruction of the environment backup tool image, uploads the environment backup tool image to the target storage space in the image warehouse.

[0083] In this embodiment, by matching the corresponding target storage space in the image warehouse according to the data identification information, and uploading the environment backup tool image to the target storage space in the image warehouse, the environment backup tool image is uploaded to the image warehouse in a regular and orderly manner based on the data identification information, which is beneficial to the efficient storage and subsequent utilization of the environment backup tool image.

[0084] In one embodiment, Figure 4 As shown, a data processing method based on Kubernetes in a specific embodiment is provided, which specifically includes the following steps:

[0085] Step S401, in response to a data backup instruction sent by a client, obtaining data to be backed up, and determining an environment backup tool for the data to be backed up.

[0086] Step S402: Build an environment backup tool image based on the environment backup tool, obtain data identification information of the data to be backed up, and match the corresponding target storage space in the image warehouse based on the data identification information; in response to the upload instruction of the environment backup tool image, upload the environment backup tool image to the target storage space in the image warehouse.

[0087] Step S403, configure a new container item in the sidecar container of Kubernetes; load the environment backup container containing the environment backup tool from the image repository, and schedule the environment backup container to the container item; after the environment backup container is scheduled, restart Kubernetes.

[0088] Step S404, determine that the preset mode is the additional mode, and run the environment backup container in the same pod of Kubernetes with the data to be backed up in the additional mode; check the operation status of Kubernetes, and when the current state of the pod is the running state, confirm that the environment backup container runs successfully; when the current state of the pod is the non-running state, reload the environment backup container from the image repository.

[0089] Step S405, in the environment backup tool image, determine the target backup method from the candidate backup methods; according to the target backup method, use the environment backup tool in the environment backup container to back up the data to be backed up, and save the backed-up data to the external storage device.

[0090] Step S406, in response to the data recovery instruction sent by the client, add the configuration item corresponding to the image name of the environment backup tool image in the environment backup container; according to the configuration item, read the corresponding metadata backup information from the external storage device, and sort the metadata backup information by resources to obtain the restored data.

[0091] The beneficial effects brought by the above embodiments are as follows:

[0092] The technical solution of this application does not need to mount PV (Persistent Volume) like other backups. Instead, the backup container is directly run in the same pod in the Kubernetes cluster with the backup application through an attached method, and in Kubernetes, multiple containers in the pod can be configured to share network and storage resources. It only needs to encapsulate any backup method in the prior art into a container, and configure the container to be backed up with the backup container in combination with the above method to solve the problems of files and networks required for physical backup. There is no need to worry about the type of storage volume plug-in, and it can be directly backed up and restored. At the same time, metadata can be backed up, effectively avoiding the tedious process of scheduling and mounting the storage volume of Kubernetes, thereby speeding up the backup process and improving backup efficiency. In addition, this application can also cross clusters and select resources in the Kubernetes cluster, and can perform full backup and incremental backup. Corresponding backup tools are used, such as PostgreSQL backup tools, which effectively ensure data consistency.

[0093] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0094] Based on the same inventive concept, the embodiment of the present application also provides a Kubernetes-based data processing device for implementing the above-mentioned Kubernetes-based data processing method. The implementation solution for solving the problem provided by the device is similar to the implementation solution recorded in the above-mentioned method, so the specific limitations in the one or more Kubernetes-based data processing device embodiments provided below can refer to the above limitations on the Kubernetes-based data processing method, which will not be repeated here.

[0095] In an exemplary embodiment, Figure 5 As shown, a data processing device based on Kubernetes is provided, including:

[0096] The data acquisition module 501 is used to respond to the data backup instruction sent by the client, acquire the data to be backed up, and determine the environment backup tool of the data to be backed up;

[0097] An image building module 502 is used to build an environment backup tool image according to the environment backup tool, and upload the environment backup tool image to the image warehouse of Kubernetes;

[0098] The container loading module 503 is used to load the environment backup container including the environment backup tool from the image repository through the sidecar container of Kubernetes;

[0099] The container running module 504 is used to run the environment backup container and the data to be backed up in the same pod of Kubernetes in a preset manner;

[0100] The data backup module 505 is used to back up the data to be backed up by using the environment backup tool in the environment backup container in the environment backup tool image.

[0101] In one embodiment, the container loading module 503 is also used to configure a new container item in the sidecar container of Kubernetes; load the environment backup container containing the environment backup tool from the image repository, and schedule the environment backup container to the container item; after the environment backup container is scheduled, restart Kubernetes.

[0102] In one embodiment, the container running module 504 is also used to determine that the preset mode is the additional mode, and run the environment backup container in the same pod of Kubernetes with the data to be backed up in the additional mode; check the operation status of Kubernetes, and when the current state of the pod is the running state, confirm that the environment backup container runs successfully; when the current state of the pod is the non-running state, reload the environment backup container from the image repository.

[0103] In one embodiment, the data backup module 505 is also used to determine a target backup method among candidate backup methods; the candidate backup methods include full backup and incremental backup; according to the target backup method, the environment backup tool in the environment backup container is used to back up the data to be backed up, and the backed-up data is saved to an external storage device.

[0104] In one embodiment, the Kubernetes-based data processing device also includes a data recovery module, which is used to respond to the data recovery instruction sent by the client, add a configuration item corresponding to the image name of the environment backup tool image in the environment backup container; according to the configuration item, read the corresponding metadata backup information from the external storage device, and sort the metadata backup information by resources to obtain the restored data.

[0105] In one embodiment, the image construction module 502 is also used to obtain data identification information of the data to be backed up, and match the corresponding target storage space in the image warehouse according to the data identification information; in response to the upload instruction of the environment backup tool image, the environment backup tool image is uploaded to the target storage space in the image warehouse.

[0106] Each module in the above-mentioned Kubernetes-based data processing device can be implemented in whole or in part by software, hardware, and a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0107] In an exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be shown in FIG6. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store environment backup tool image data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data processing method based on Kubernetes is implemented.

[0108] Those skilled in the art will understand that the structure shown in FIG. 6 is merely a block diagram of a partial structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different arrangement of components.

[0109] In one embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above method embodiments when executing the computer program.

[0110] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0111] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0112] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.

[0113] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.

[0114] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0115] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A data processing method based on Kubernetes, characterized in that: The method comprises: In response to a data backup instruction sent by a client, the data to be backed up is obtained, and an environment backup tool for the data to be backed up is determined; According to the environment backup tool, build an environment backup tool image, and upload the environment backup tool image to the image warehouse of Kubernetes; Loading the environment backup container containing the environment backup tool from the image repository through the sidecar container of Kubernetes; Running the environment backup container and the data to be backed up in the same pod of the Kubernetes in a preset manner; In the environment backup tool image, the data to be backed up is backed up using the environment backup tool in the environment backup container.

2. The method according to claim 1, characterized in that The step of loading the environment backup container including the environment backup tool from the image repository through the sidecar container of Kubernetes includes: Configure a new container item in the sidecar container of the Kubernetes; Loading the environment backup container including the environment backup tool from the image repository, and scheduling the environment backup container into the container item; After the environment backup container scheduling is completed, restart the Kubernetes.

3. The method according to claim 1, characterized in that The step of running the environment backup container and the data to be backed up in the same pod of the Kubernetes in a preset manner includes: Determine that the preset mode is an additional mode, and run the environment backup container and the data to be backed up in the same pod of the Kubernetes through the additional mode; Check the running status of the Kubernetes, and if the current state of the pod is in the running state, confirm that the environment backup container runs successfully; if the current state of the pod is in the non-running state, reload the environment backup container from the image repository.

4. The method according to claim 1, characterized in that: The backing up the data to be backed up by using the environment backup tool in the environment backup container includes: Determine a target backup mode among candidate backup modes; the candidate backup modes include full backup and incremental backup; According to the target backup mode, the data to be backed up is backed up using the environment backup tool in the environment backup container, and the backed-up data is saved in an external memory.

5. The method according to claim 4, characterized in that The method further comprises: In response to the data recovery instruction sent by the client, adding a configuration item corresponding to the image name of the environment backup tool image in the environment backup container; According to the configuration item, corresponding metadata backup information is read from the external memory, and resource sorting is performed on the metadata backup information to obtain restored data.

6. The method according to any one of claims 1 to 5, characterized in that: The step of uploading the environment backup tool image to the image repository of Kubernetes includes: Acquire data identification information of the data to be backed up, and match the corresponding target storage space in the image warehouse according to the data identification information; In response to an upload instruction of the environment backup tool image, the environment backup tool image is uploaded to the target storage space in the image warehouse.

7. A data processing device based on Kubernetes, characterized in that: The device comprises: A data acquisition module, used to respond to a data backup instruction sent by a client, acquire the data to be backed up, and determine an environment backup tool for the data to be backed up; An image building module is used to build an environment backup tool image according to the environment backup tool, and upload the environment backup tool image to the image warehouse of Kubernetes; A container loading module, used to load the environment backup container containing the environment backup tool from the image repository through the sidecar container of the Kubernetes; A container running module, used to run the environment backup container and the data to be backed up in the same pod of the Kubernetes in a preset manner; A data backup module is used to back up the data to be backed up in the environment backup tool image using the environment backup tool in the environment backup container.

8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.

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

Citation Information

Patent Citations

  • Agent authentication method and equipment for cloud product based on cloud native

    CN115562804A

  • Method and system for realizing heterogeneous kubernetes cluster data migration based on backup and recovery

    CN115794492A

  • Node management method and device for database cluster and electronic equipment

    CN115878361A

  • Main and standby container cluster system, data synchronization method thereof and electronic equipment

    CN116244040A

  • Universal data backup method and system for kubernetes platform application, and universal data restoration method and system for kubernetes platform application

    CN117687841A