CN114090344B - Method, device, equipment and medium for deleting backup resources of container cluster - Google Patents

Method, device, equipment and medium for deleting backup resources of container cluster Download PDF

Info

Publication number
CN114090344B
CN114090344B CN202210058574.9A CN202210058574A CN114090344B CN 114090344 B CN114090344 B CN 114090344B CN 202210058574 A CN202210058574 A CN 202210058574A CN 114090344 B CN114090344 B CN 114090344B
Authority
CN
China
Prior art keywords
backup
resource
resources
plug
information
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210058574.9A
Other languages
Chinese (zh)
Other versions
CN114090344A (en
Inventor
刘茂扬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Inspur Intelligent Technology Co Ltd
Original Assignee
Suzhou Inspur Intelligent Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Suzhou Inspur Intelligent Technology Co Ltd filed Critical Suzhou Inspur Intelligent Technology Co Ltd
Priority to CN202210058574.9A priority Critical patent/CN114090344B/en
Publication of CN114090344A publication Critical patent/CN114090344A/en
Application granted granted Critical
Publication of CN114090344B publication Critical patent/CN114090344B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1446Point-in-time backing up or restoration of persistent data
    • G06F11/1458Management of the backup or restore process
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/445Program loading or initiating
    • G06F9/44521Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
    • G06F9/44526Plug-ins; Add-ons

Abstract

The invention discloses a method, a device, equipment and a medium for deleting backup resources of a container cluster, wherein the method comprises the following steps: responding to the starting of a backup plug-in of a container cluster, scanning a resource type created in the container cluster by the backup plug-in, and recording the resource type, wherein the resource type comprises backup resources; scanning a configuration file mounted by a backup plug-in to acquire information stored by an object butted by the backup plug-in; responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources; monitoring a backup resource deleting event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deleting event. By the scheme of the invention, the unified deletion of various backup resources established by the container cluster is realized.

Description

Method, device, equipment and medium for deleting backup resources of container cluster
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for deleting backup resources for a container cluster.
Background
In a container cluster, when container cluster resources are backed up, various types of backup resources can be generated, the generated backup resources may be stored in a plurality of different positions of an object storage, when a user cleans up the backup resources, the backup resources and corresponding data cannot be uniformly deleted, multiple operations are required to delete various backup data, and the operations are complicated and unintuitive, and residual data are easy to miss.
Taking a currently mainstream container cluster backup plug-in veloro as an example, the veloro realizes the backup of the container cluster, but the veloro is very complicated to divide backup resources into a plurality of self-defined resources such as backup, restore, bucket, file snapshot, volume snapshot and the like. These resources will perform their own duties when backup and restoration are performed, but velero lacks a uniform management mode, and especially when deletion, if the backup and restoration are not taken into consideration, a lot of redundant data can be easily generated.
Disclosure of Invention
In view of this, the present invention provides a method, an apparatus, a device, and a medium for deleting backup resources for a container cluster, which do not need to delete backup resources of various types generated in backup plug-ins one by one when deleting the backup resources, and can delete the backup resources uniformly, thereby effectively saving operation steps of a user, avoiding redundant data and garbage data generated in a backup process, and saving storage space.
Based on the above object, an aspect of the embodiments of the present invention provides a method for deleting backup resources for a container cluster, which specifically includes the following steps:
responding to the starting of a backup plug-in of a container cluster, scanning a resource type created in the container cluster by the backup plug-in, and recording the resource type, wherein the resource type comprises backup resources;
scanning a configuration file mounted by a backup plug-in to acquire information stored by an object butted by the backup plug-in;
responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources;
monitoring a backup resource deleting event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deleting event.
In some embodiments, the associated resources include one or more of cluster resources, object storage resources, backup restore resources.
In some embodiments, scanning the configuration file mounted by the backup plug-in to obtain the information stored by the object docked by the backup plug-in comprises:
and scanning the configuration file mounted by the backup plug-in to acquire the address and the authorization information stored in the object connected with the backup plug-in.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
if the associated resource is a cluster resource, a container cluster interface is called based on the information of the associated resource to delete the associated resource.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resources are backup restoration resources, accessing the object storage based on the address and the authorization information of the object storage, and calling corresponding associated resource interfaces in the object storage based on the information of the associated resources to delete the associated resources.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resource is an object storage resource, accessing the object storage based on the address and the authorization information of the object storage to delete the associated resource.
In another aspect of the embodiments of the present invention, an apparatus for deleting backup resources for a container cluster is further provided, where the apparatus includes:
the scanning module is configured to respond to the starting of a backup plug-in of a container cluster, scan a resource type created in the container cluster by the backup plug-in, and record the resource type, wherein the resource type comprises backup resources;
the scanning module is also configured to scan the configuration file mounted by the backup plug-in to acquire information stored by an object to which the backup plug-in is docked;
the monitoring and recording module is configured to respond to the backup plug-in to backup the container cluster, and monitor and record information of the associated resources triggered by the backup resources in the life cycle of the backup resources;
and the monitoring and deleting module is configured to monitor a backup resource deleting event, and delete the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deleting event.
In some embodiments, the scanning module is further configured to scan the configuration file mounted by the backup plug-in to obtain the address and the authorization information stored in the object connected to the backup plug-in.
In another aspect of the embodiments of the present invention, there is also provided a computer device, including: at least one processor; and a memory storing a computer program executable on the processor, the computer program when executed by the processor implementing the steps of the method:
responding to the starting of a backup plug-in of a container cluster, scanning a resource type created in the container cluster by the backup plug-in, and recording the resource type, wherein the resource type comprises backup resources;
scanning a configuration file mounted by a backup plug-in to acquire information stored by an object butted by the backup plug-in;
responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources;
monitoring a backup resource deleting event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deleting event.
In some embodiments, the associated resources include one or more of cluster resources, object storage resources, backup restore resources.
In some embodiments, scanning the configuration file mounted by the backup plug-in to obtain the information stored by the object docked by the backup plug-in comprises:
and scanning the configuration file mounted by the backup plug-in to acquire the address and the authorization information stored in the object connected with the backup plug-in.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
if the associated resource is a cluster resource, a container cluster interface is called based on the information of the associated resource to delete the associated resource.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resources are backup restoration resources, accessing the object storage based on the address and the authorization information of the object storage, and calling corresponding associated resource interfaces in the object storage based on the information of the associated resources to delete the associated resources.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resource is an object storage resource, accessing the object storage based on the address and the authorization information of the object storage to delete the associated resource.
In another aspect of the embodiments of the present invention, a computer-readable storage medium is further provided, in which a computer program for implementing the following method steps when executed by a processor is stored:
responding to the starting of a backup plug-in of a container cluster, scanning a resource type created in the container cluster by the backup plug-in, and recording the resource type, wherein the resource type comprises backup resources;
scanning a configuration file mounted by a backup plug-in to acquire information stored by an object butted by the backup plug-in;
responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources;
monitoring a backup resource deleting event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deleting event.
In some embodiments, the associated resources include one or more of cluster resources, object storage resources, backup restore resources.
In some embodiments, scanning the configuration file mounted by the backup plug-in to obtain the information stored by the object docked by the backup plug-in comprises:
and scanning the configuration file mounted by the backup plug-in to acquire the address and the authorization information stored in the object connected with the backup plug-in.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
if the associated resource is a cluster resource, a container cluster interface is called based on the information of the associated resource to delete the associated resource.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resources are backup restoration resources, accessing the object storage based on the address and the authorization information of the object storage, and calling corresponding associated resource interfaces in the object storage based on the information of the associated resources to delete the associated resources.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resource is an object storage resource, accessing the object storage based on the address and the authorization information of the object storage to delete the associated resource.
The invention has at least the following beneficial technical effects: scanning a resource type created in a container cluster by a backup plug-in response to the starting of the backup plug-in of the container cluster, and recording the resource type, wherein the resource type comprises backup resources; scanning the configuration file mounted by the backup plug-in to acquire information stored by an object butted by the backup plug-in; responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources; and monitoring a backup resource deletion event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deletion event, without deleting a plurality of backup resources created by the container cluster one by one, thereby realizing the uniform deletion of the plurality of backup resources created by the container cluster.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other embodiments can be obtained by using the drawings without creative efforts.
FIG. 1 is a block diagram of an embodiment of a method for deleting backup resources for a container cluster provided by the present invention;
FIG. 2 is a diagram illustrating an embodiment of a backup resource triggered association resource during a backup resource lifecycle;
FIG. 3 is a diagram illustrating an embodiment of an apparatus for deleting backup resources for a container cluster according to the present invention;
FIG. 4 is a schematic structural diagram of an embodiment of a computer device provided in the present invention;
fig. 5 is a schematic structural diagram of an embodiment of a computer-readable storage medium provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following embodiments of the present invention are described in further detail with reference to the accompanying drawings.
It should be noted that all expressions using "first" and "second" in the embodiments of the present invention are used for distinguishing two entities with the same name but different names or different parameters, and it should be noted that "first" and "second" are merely for convenience of description and should not be construed as limitations of the embodiments of the present invention, and they are not described in any more detail in the following embodiments.
In view of the above objects, a first aspect of embodiments of the present invention proposes an embodiment of a method for deleting backup resources for a container cluster. As shown in fig. 1, it includes the following steps:
step S101, responding to the starting of a backup plug-in of a container cluster, scanning a resource type created in the container cluster by the backup plug-in, and recording the resource type, wherein the resource type comprises backup resources;
step S103, scanning the configuration file mounted by the backup plug-in to acquire information stored by an object butted by the backup plug-in;
step S105, responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources;
and S107, monitoring a backup resource deleting event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deleting event.
Taking a backup process of a backup plug-in veloro of a Kubernetes (k 8s for short) cluster as an example, when the veloro is started, scanning the veloro, recording resource types related to backup and information stored by a butted object, wherein the recorded resource types are multiple backup resources which need to be deleted uniformly when the backup is deleted subsequently, and the specific implementation process is as follows:
after a k8s cluster starts a velero, monitoring various resource types registered by the velero in a backup restoration process based on a creating event of k8s, wherein the various resource types are used for backup and restoration of resources in the k8s cluster, and the various resource types are recorded in a text, such as backup resources, restore resources, backstorage resources and the like; meanwhile, scanning a configuration file mounted by the velero of the backup plug-in, and acquiring information stored by an object connected with the velero of the backup plug-in, such as an account number, a password, an address and the like, for accessing the object storage based on the information subsequently.
When the velero backs up the k8s cluster, a resource with a resource type of backup is generated for data which a user requires to back up, and all other resources are connected in series through the backup resources, so that the whole life cycle of creating, modifying and deleting the backup resources is monitored, and all resources used by the velero in the backup restoration are found. As shown in fig. 2, the monitored association resource triggered by the backup resource in the lifecycle of the backup resource includes: volume backup resources, restore resources, schedule backup resources, k8s native resources, object storage resources, and the like, and records information such as names and resource types of the associated resources.
When the k8s cluster hears the backup resource deletion event, the associated resource is deleted through a different path based on the resource type of the associated resource to be deleted.
Specifically, in the backup and restoration process of the velero, a backup resource triggers velero resources, k8s native resources and object storage resources of various resource types registered in the early stage, for the velero resources, the velero resources are stored in storage bucket resources stored in an object, the bucket names of the storage bucket resources are globally unique and cannot be changed, the various resources stored in the object storage and the storage bucket resources are in one-to-one correspondence, the object storage is accessed based on the account number, the password and the address of the object storage, and the information such as the resource types, the names, the naming spaces and the like of the velero resources in the object storage is positioned to the corresponding storage bucket resources to find the velero resources to be deleted; for k8s native resources, calling a k8s cluster interface based on the k8s cluster information, finding k8s native resources to be deleted and deleting the native resources; and for the object storage resource, accessing the object storage based on the account number, the password and the address of the object storage, and finding the object storage resource to be deleted in the object storage for deletion.
Scanning a resource type created in a container cluster by a backup plug-in response to the starting of the backup plug-in of the container cluster, and recording the resource type, wherein the resource type comprises backup resources; scanning the configuration file mounted by the backup plug-in to acquire information stored by an object butted by the backup plug-in; responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources; and monitoring a backup resource deletion event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deletion event, without deleting a plurality of backup resources created by the container cluster one by one, thereby realizing the uniform deletion of the plurality of backup resources created by the container cluster.
In some embodiments, scanning the configuration file mounted by the backup plug-in to obtain the information stored by the object docked by the backup plug-in comprises:
and scanning the configuration file mounted by the backup plug-in to acquire the address and the authorization information stored in the object connected with the backup plug-in.
The method comprises the steps of storing configuration information stored in a veloro object in a configuration file, scanning the configuration file mounted by the veloro, and acquiring an address and authorization information stored in the object from the configuration file, wherein the authorization information refers to information required for accessing the object storage, such as a user name, a password and the like.
In some embodiments, the associated resources include one or more of cluster resources, object storage resources, backup restore resources.
In fig. 2, the volume backup resource, the restore resource, and the schedule backup resource are backup and restore resources of velero in the backup and restore process, and the k8s native resource is a cluster resource.
In some embodiments, deleting the associated resource based on the information of the associated resource and the information of the object store comprises:
and accessing the object storage based on the address and the authorization information of the object storage, and deleting the data of the corresponding associated resource in the object storage based on the information of the associated resource.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
if the associated resource is a cluster resource, a container cluster interface is called based on the information of the associated resource to delete the associated resource.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resources are backup restoration resources, accessing the object storage based on the address and the authorization information of the object storage, and calling corresponding associated resource interfaces in the object storage based on the information of the associated resources to delete the associated resources.
In some embodiments, deleting the associated resource based on information of the associated resource and/or information of the object store comprises:
and if the associated resource is an object storage resource, accessing the object storage based on the address and the authorization information of the object storage to delete the associated resource.
The following describes a plurality of embodiments of the present invention.
Based on the whole life cycle of listening to the backup resource by the k8s cluster, when the listening mechanism of the k8s cluster will listen to the backup resource deletion event, deleting the associated resource based on the resource type of the associated resource to be deleted.
More specifically, for the veloro resources of various resource types created in the veloro backup and restoration process, such as volume backup resources, restore resources and the like, object storage is accessed based on the address and authorization information of the object storage, and corresponding veloro interfaces are called for unified deletion based on the corresponding information recorded in the backup resources; for k8s native resources created in a velero backup and restoration process, creating a set of client (client) interacting with a k8s container cluster, calling a k8s interface based on k8s container cluster information in the client, and deleting k8s native resources generated in the velero backup process, such as pv (persistent volume, a storage resource), pvc (persistent volume class, a statement of the storage resource) of k8s, storage volume snapshot resources, and the like; for object storage resources used by the velero storage metadata, the object storage is accessed based on the address and the authorization information of the object storage, and the related data of the object storage resources are deleted, so that when it is monitored that backup resources are deleted, the related velero resources, k8s resources and storage data are deleted in a cascade mode, the generation of redundant data is effectively avoided, and the storage space is saved.
In some embodiments, the associated resources include any one or more of cluster resources, object storage resources, periodically triggered backup resources, volume backup resources, and restore resources.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 3, an embodiment of the present invention further provides an apparatus for deleting backup resources of a container cluster, and also provides an apparatus for deleting backup resources of a container cluster, including:
a scanning module 110, where the scanning module 110 is configured to scan a resource type created in a container cluster by a backup plug-in response to the backup plug-in starting of the container cluster, and record the resource type;
the scanning module 110 is further configured to scan the configuration file mounted by the backup plug-in to obtain information stored in the object to which the backup plug-in is docked;
a monitoring recording module 120, where the monitoring recording module 120 is configured to respond to the backup plug-in to backup the container cluster, and monitor and record information of an associated resource triggered by a backup resource in a life cycle of the backup resource;
a monitoring and deleting module 130, wherein the monitoring and deleting module 130 is configured to monitor a backup resource deleting event, and delete the associated resource based on the information of the associated resource and/or the information stored in the object after monitoring the backup resource deleting event.
Scanning a resource type created in a container cluster by a backup plug-in response to the starting of the backup plug-in of the container cluster, and recording the resource type, wherein the resource type comprises backup resources; scanning the configuration file mounted by the backup plug-in to acquire information stored by an object butted by the backup plug-in; responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources; and monitoring a backup resource deletion event, and deleting the associated resources based on the information of the associated resources and/or the information stored by the object after monitoring the backup resource deletion event, without deleting a plurality of backup resources created by the container cluster one by one, thereby realizing the uniform deletion of the plurality of backup resources created by the container cluster.
In some embodiments, the scanning module is further configured to scan the configuration file mounted by the backup plug-in to obtain the address and the authorization information stored in the object connected to the backup plug-in.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 4, the embodiment of the present invention further provides a computer device 30, in which the computer device 30 comprises a processor 310 and a memory 320, the memory 320 stores a computer program 321 that can run on the processor, and the processor 310 executes the program to perform the steps of the above method.
The memory, which is a non-volatile computer-readable storage medium, may be used to store non-volatile software programs, non-volatile computer-executable programs, and modules, such as program instructions/modules corresponding to the method for deleting backup resources for a container cluster in this embodiment of the present application. The processor executes various functional applications and data processing of the device by running the nonvolatile software programs, instructions and modules stored in the memory, namely, the method for deleting backup resources for a container cluster of the above method embodiment is realized.
The memory may include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function; the storage data area may store data created according to the use of the device, and the like. Further, the memory may include high speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid state storage device. In some embodiments, the memory optionally includes memory located remotely from the processor, and such remote memory may be coupled to the local module via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
Based on the same inventive concept, according to another aspect of the present invention, as shown in fig. 5, an embodiment of the present invention further provides a computer-readable storage medium 40, where the computer-readable storage medium 40 stores a computer program 410, which when executed by a processor, performs the above method.
Finally, it should be noted that, as will be understood by those skilled in the art, all or part of the processes of the methods of the above embodiments may be implemented by a computer program, which may be stored in a computer-readable storage medium, and when executed, may include the processes of the embodiments of the methods described above. The storage medium of the program may be a magnetic disk, an optical disk, a Read Only Memory (ROM), a Random Access Memory (RAM), or the like. The embodiments of the computer program may achieve the same or similar effects as any of the above-described method embodiments.
Those of skill would further appreciate that the various illustrative logical blocks, modules, circuits, and algorithm steps described in connection with the disclosure herein may be implemented as electronic hardware, computer software, or combinations of both. To clearly illustrate this interchangeability of hardware and software, various illustrative components, blocks, modules, circuits, and steps have been described above generally in terms of their functionality. Whether such functionality is implemented as software or hardware depends upon the particular application and design constraints imposed on the overall system. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the disclosed embodiments of the present invention.
The foregoing is an exemplary embodiment of the present disclosure, but it should be noted that various changes and modifications could be made herein without departing from the scope of the present disclosure as defined by the appended claims. The functions, steps and/or actions of the method claims in accordance with the disclosed embodiments described herein need not be performed in any particular order. The numbers of the embodiments disclosed in the embodiments of the present invention are merely for description, and do not represent the merits of the embodiments. Furthermore, although elements of the disclosed embodiments of the invention may be described or claimed in the singular, the plural is contemplated unless limitation to the singular is explicitly stated.
It should be understood that, as used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly supports the exception. It should also be understood that "and/or" as used herein is meant to include any and all possible combinations of one or more of the associated listed items.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, of embodiments of the invention is limited to these examples; within the idea of an embodiment of the invention, also technical features in the above embodiment or in different embodiments may be combined and there are many other variations of the different aspects of the embodiments of the invention as described above, which are not provided in detail for the sake of brevity. Therefore, any omissions, modifications, substitutions, improvements, and the like that may be made without departing from the spirit and principles of the embodiments of the present invention are intended to be included within the scope of the embodiments of the present invention.

Claims (9)

1. A method for deleting backup resources for a container cluster, comprising:
responding to starting of a backup plug-in of a container cluster, scanning a resource type created in the container cluster by the backup plug-in, and recording the resource type, wherein the resource type comprises a backup up resource, the container cluster is Kubernets, and the backup plug-in is velero;
scanning a configuration file mounted by a backup plug-in to acquire information stored by an object butted by the backup plug-in;
responding to the backup plug-in to backup the container cluster, and monitoring and recording information of associated resources triggered by the backup resources in the life cycle of the backup resources;
monitoring a backup resource deletion event, calling a container cluster interface based on information of the cluster resource to delete the associated resource if the associated resource triggered by the backup resource is the cluster resource after monitoring the backup resource deletion event, accessing the object storage based on the information of the object storage if the associated resource triggered by the backup resource is the backup restoration resource, and calling a corresponding backup restoration resource interface based on the information of the backup restoration resource in the object storage to delete the backup restoration resource.
2. The method of claim 1, wherein the associated resources comprise one or more of cluster resources, object storage resources, and backup restore resources.
3. The method of claim 2, wherein scanning the configuration file of the backup plug-in mount to obtain information stored by the object to which the backup plug-in interfaces comprises:
and scanning the configuration file mounted by the backup plug-in to acquire the address and the authorization information stored in the object connected with the backup plug-in.
4. The method of claim 3, wherein accessing the object store based on information of the object store comprises:
accessing the object store based on the address and authorization information of the object store.
5. The method of claim 3, wherein after listening for a backup resource deletion event and after listening for the backup resource deletion event, further comprising:
and if the associated resource is the object storage resource, accessing the object storage based on the address and the authorization information of the object storage to delete the object storage resource.
6. An apparatus for deleting backup resources for a container cluster, comprising:
the scanning module is configured to respond to the starting of a backup plug-in of a container cluster, scan a resource type created in the container cluster by the backup plug-in, and record the resource type, wherein the resource type comprises a backup resource, the container cluster is Kubernets, and the backup plug-in is velero;
the scanning module is also configured to scan the configuration file mounted by the backup plug-in to acquire information stored by an object to which the backup plug-in is docked;
the monitoring and recording module is configured to respond to the backup plug-in to backup the container cluster, and monitor and record information of the associated resources triggered by the backup resources in the life cycle of the backup resources;
and the monitoring and deleting module is configured to monitor a backup resource deleting event, after the backup resource deleting event is monitored, if the associated resource triggered by the backup resource is a cluster resource, a container cluster interface is called based on the information of the cluster resource to delete the associated resource, if the associated resource triggered by the backup resource is a backup restoring resource, the object storage is accessed based on the address and the authorization information of the object storage, and a corresponding backup restoring resource interface is called in the object storage based on the information of the backup restoring resource to delete the backup restoring resource.
7. The apparatus of claim 6, wherein the scanning module is further configured to scan the configuration file mounted by the backup plug-in to obtain an address and authorization information stored by an object to which the backup plug-in is connected.
8. A computer device, comprising:
at least one processor; and
memory storing a computer program operable on the processor, wherein the processor executes the program to perform the steps of the method according to any of claims 1 to 5.
9. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 5.
CN202210058574.9A 2022-01-19 2022-01-19 Method, device, equipment and medium for deleting backup resources of container cluster Active CN114090344B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210058574.9A CN114090344B (en) 2022-01-19 2022-01-19 Method, device, equipment and medium for deleting backup resources of container cluster

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210058574.9A CN114090344B (en) 2022-01-19 2022-01-19 Method, device, equipment and medium for deleting backup resources of container cluster

Publications (2)

Publication Number Publication Date
CN114090344A CN114090344A (en) 2022-02-25
CN114090344B true CN114090344B (en) 2022-04-29

Family

ID=80308539

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210058574.9A Active CN114090344B (en) 2022-01-19 2022-01-19 Method, device, equipment and medium for deleting backup resources of container cluster

Country Status (1)

Country Link
CN (1) CN114090344B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114328029B (en) * 2022-03-02 2022-06-03 苏州浪潮智能科技有限公司 Backup method and device of application resources, electronic equipment and storage medium
CN114661420B (en) * 2022-03-28 2023-08-11 安超云软件有限公司 Application protection method, device and system based on Kubernetes container platform

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106055424A (en) * 2016-05-19 2016-10-26 青岛海信移动通信技术股份有限公司 Method and device for exception handling of information database
CN110489273A (en) * 2019-07-05 2019-11-22 苏州浪潮智能科技有限公司 A kind of storage backup method, system, terminal and storage medium based on SAN
CN111124755A (en) * 2019-12-06 2020-05-08 中国联合网络通信集团有限公司 Cluster node fault recovery method and device, electronic equipment and storage medium
CN112214351A (en) * 2020-10-12 2021-01-12 珠海格力电器股份有限公司 Backup data recovery method and device, electronic equipment and storage medium
US20210011812A1 (en) * 2019-07-10 2021-01-14 Commvault Systems, Inc. Preparing containerized applications for backup using a backup services container and a backup services container-orchestration pod
CN112698990A (en) * 2021-01-04 2021-04-23 浪潮云信息技术股份公司 Method for deleting repeated data online during data backup

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106055424A (en) * 2016-05-19 2016-10-26 青岛海信移动通信技术股份有限公司 Method and device for exception handling of information database
CN110489273A (en) * 2019-07-05 2019-11-22 苏州浪潮智能科技有限公司 A kind of storage backup method, system, terminal and storage medium based on SAN
US20210011812A1 (en) * 2019-07-10 2021-01-14 Commvault Systems, Inc. Preparing containerized applications for backup using a backup services container and a backup services container-orchestration pod
CN111124755A (en) * 2019-12-06 2020-05-08 中国联合网络通信集团有限公司 Cluster node fault recovery method and device, electronic equipment and storage medium
CN112214351A (en) * 2020-10-12 2021-01-12 珠海格力电器股份有限公司 Backup data recovery method and device, electronic equipment and storage medium
CN112698990A (en) * 2021-01-04 2021-04-23 浪潮云信息技术股份公司 Method for deleting repeated data online during data backup

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
K8S备份、恢复、迁移神器 Velero;YP小站;《https://blog.csdn.net/qq_24794401/article/details/106953722》;20200624;全文 *

Also Published As

Publication number Publication date
CN114090344A (en) 2022-02-25

Similar Documents

Publication Publication Date Title
CN114090344B (en) Method, device, equipment and medium for deleting backup resources of container cluster
JP5976221B2 (en) Information backup method and apparatus
CN101997884B (en) Distributed storage system and method
CN110309218B (en) Data exchange system and data writing method
CN111752799A (en) Service link tracking method, device, equipment and storage medium
EP2461615A1 (en) Method for backing up terminal data and system thereof
CN112000741A (en) Intranet and extranet data exchange system, method, device, computer equipment and medium
CN103761165A (en) Log backup method and log backup device
CN111930703A (en) Automatic log file capturing method and device and computer equipment
CN110972497A (en) Disaster recovery method and device for virtualization platform
CN114356650A (en) Data backup method, device, equipment, system and storage medium
CN110620798A (en) Control method, system, equipment and storage medium for FTP connection
CN106649000A (en) Fault recovery method for real-time processing engine, and corresponding server
CN110928885B (en) Method and device for updating data of Mysql database to Es database
US11709749B1 (en) Diagnostic data collection for kubernetes
CN114661420B (en) Application protection method, device and system based on Kubernetes container platform
CN112732280B (en) Personal habit data management system for computer users
CN115080309A (en) Data backup system, method, storage medium, and electronic device
CN114020565A (en) Intelligent log collection processing method and device, electronic equipment and storage medium
CN106686035B (en) Method and device for realizing customized FTP server based on Apache FtpServer
CN114443580A (en) Data cleaning method, device, medium and computing equipment
CN108595500B (en) Recording management and control method, system, computer equipment and storage medium
CN116975166A (en) Method and device for processing archiving space of Oracle database
CN103488930A (en) Method and device for processing file/application program on mobile communication terminal
CN111722801B (en) Label-based storage volume attribute management method, device, equipment and medium

Legal Events

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