Resource scheduling method and apparatus for kubernetes cluster, storage medium, and electronic device

By introducing a second persistent volume declaration of a custom resource type in the Kubernetes platform, the expansion and contraction of storage volumes are supported, solving the problem of automatic contraction in existing technologies and enabling flexible scheduling of storage resources.

WO2026108276A1PCT designated stage Publication Date: 2026-05-28JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
JD DIGITS HAIYI INFORMATION TECHNOLOGY CO LTD
Filing Date
2025-08-20
Publication Date
2026-05-28

Smart Images

  • Figure CN2025115773_28052026_PF_FP_ABST
    Figure CN2025115773_28052026_PF_FP_ABST
Patent Text Reader

Abstract

The present application discloses a resource scheduling method and apparatus for a kubernetes cluster, a storage medium, and an electronic device. The method comprises: in response to a resource scheduling request, creating a first persistent volume claim and a second persistent volume claim of a predefined type, and respectively associating the first persistent volume claim and the second persistent volume claim with a storage pool, wherein the first persistent volume claim is a native persistent volume claim of a kubernetes cluster, capacity configuration information is respectively set in the first persistent volume claim and the second persistent volume claim, and the second persistent volume claim supports the increase and decrease of the capacity configuration information; associating a pre-created pod node with the first persistent volume claim; and creating a storage volume on the basis of the first persistent volume claim, and mounting the storage volume to the pod node. By introducing a new kubernetes custom resource type, a second persistent volume claim of a predefined type is created, and the second persistent volume claim supports the increase and decrease of capacity configuration information, thereby further supporting capacity expansion and capacity reduction of a created storage volume.
Need to check novelty before this filing date? Find Prior Art

Description

A resource scheduling method, apparatus, storage medium, and electronic device for a Kubernetes cluster.

[0001] Cross-references to related applications

[0002] This application claims priority to Chinese Patent Application No. 202411688840.1, filed on November 22, 2024, the entire contents of which are incorporated herein by reference. Technical Field

[0003] This disclosure relates to the field of computer technology, and in particular to a resource scheduling method, apparatus, storage medium, and electronic device for a Kubernetes cluster. Background Technology

[0004] In practical applications, many Kubernetes users utilize persistent storage volumes to store application data or logs. The Kubernetes platform provides a general container storage interface that enables dynamic provisioning and configuration of storage, and automates storage request processing.

[0005] In the process of implementing this disclosure, it was found that the prior art has at least the following technical problems: users apply for persistent storage volumes by creating persistent volume declarations, and during use, the storage volume can be automatically expanded by increasing the storage request size in the persistent volume declaration. However, the automatic shrinking of the storage volume is not supported. Summary of the Invention

[0006] This disclosure provides a resource scheduling method for a Kubernetes cluster to create persistent storage volumes and supports scaling up and down persistent storage volumes.

[0007] According to one aspect of this disclosure, a resource scheduling method for a Kubernetes cluster is provided, comprising:

[0008] In response to a resource scheduling request, a first persistent volume declaration and a second persistent volume declaration of a predefined type are created. The first persistent volume declaration and the second persistent volume declaration are associated with storage pools respectively. The first persistent volume declaration is a native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information.

[0009] Associate the pre-created pod node with the first persistent volume declaration;

[0010] A storage volume is created based on the first persistent volume declaration, and the storage volume is mounted to the pod node.

[0011] Optionally, creating the first persistent volume declaration and the second persistent volume declaration of a predefined type includes: creating the second persistent volume declaration of the predefined type; and, upon detecting the second persistent volume declaration, creating the first persistent volume declaration based on the second persistent volume declaration, wherein the first persistent volume declaration and the second persistent volume declaration correspond to the same identifier.

[0012] Optionally, the method further includes: updating the capacity configuration information in the second persistent volume declaration in response to a capacity update request for the second persistent volume declaration; the capacity update request includes a capacity increase request and a capacity decrease request; and performing capacity change processing on the storage volume when a change is detected in the second persistent volume declaration.

[0013] Optionally, the method further includes: updating the capacity configuration information in the second persistent volume declaration in response to a capacity update request for the first persistent volume declaration; the capacity update request includes a capacity increase request; and performing capacity change processing on the storage volume when a change is detected in the first persistent volume declaration.

[0014] Optionally, the process of changing the capacity of the storage volume includes: updating the storage resource limit of the storage volume according to the capacity configuration information in the capacity update request.

[0015] Optionally, the method further includes: sending capacity update information to the storage pool to update the available resources of the storage pool.

[0016] Optionally, the method further includes: in response to a query request, displaying resource information corresponding to the storage volume mounted on the created pod node, wherein the resource information includes resource quantity and resource utilization.

[0017] According to another aspect of this disclosure, a resource scheduling apparatus for a Kubernetes cluster is provided, comprising:

[0018] The persistent volume declaration creation module is used to create a first persistent volume declaration and a second persistent volume declaration of a predefined type in response to a resource scheduling request, and associate the first persistent volume declaration and the second persistent volume declaration with a storage pool respectively. The first persistent volume declaration is the native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information.

[0019] The storage volume creation module is used to associate a pre-created pod node with the first persistent volume declaration; create a storage volume based on the first persistent volume declaration; and mount the storage volume to the pod node.

[0020] According to another aspect of this disclosure, an electronic device is provided, the electronic device comprising:

[0021] At least one processor; and

[0022] A memory communicatively connected to the at least one processor; wherein,

[0023] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the resource scheduling method for a Kubernetes cluster as described in any embodiment of this disclosure.

[0024] According to another aspect of this disclosure, a computer-readable storage medium is provided that stores computer instructions for causing a processor to execute and implement the resource scheduling method for a Kubernetes cluster as described in any embodiment of this disclosure.

[0025] The technical solution of this disclosure introduces a new Kubernetes custom resource type. During the storage volume creation process, a predefined type of second persistent volume declaration is created. This second persistent volume declaration supports increasing and decreasing capacity configuration information, further supporting the expansion and contraction of the created storage volume. By creating a corresponding first persistent volume declaration based on the second persistent volume declaration, and then creating a storage volume based on the first persistent volume declaration, storage resource scheduling for pod nodes is achieved.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description

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

[0028] Figure 1 is a schematic diagram of the storage volume creation process;

[0029] Figure 2 is a flowchart of a resource scheduling method for a Kubernetes cluster provided in an embodiment of this disclosure;

[0030] Figure 3 is a schematic diagram of the resource scheduling method provided in an embodiment of this disclosure;

[0031] Figure 4 is a flowchart illustrating a resource scheduling method provided in an embodiment of this disclosure;

[0032] Figure 5 is a schematic diagram of the structure of a resource scheduling device for a Kubernetes cluster provided in an embodiment of this disclosure.

[0033] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0034] To enable those skilled in the art to better understand the present disclosure, the technical solutions of the present disclosure will be clearly and completely described below with reference to the accompanying drawings of the embodiments. Obviously, the described embodiments are only some embodiments of the present disclosure, and not all embodiments. Based on the embodiments of the present disclosure, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present disclosure.

[0035] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this disclosure are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this disclosure described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0036] The technical field and related terms of the embodiments of this application are briefly described below.

[0037] Kubernetes is a container-based cluster management system built on top of container runtime environments such as Docker and containers. It is used to manage containerized workloads and services. It is a portable, scalable, open-source platform with a large and rapidly growing ecosystem, and its services, support, and tools are widely available.

[0038] A Pod node is the smallest deployable unit of computing created and managed in Kubernetes. It contains one or more containers that share storage, networking, and declarations of how to run them. A Pod node models an application-specific "logical host" containing one or more application containers that are relatively tightly coupled together.

[0039] A PV (Persistent Volume) is a block of storage in a cluster that can be provisioned in advance by the administrator or dynamically provisioned using a storage class. Persistent volumes are cluster resources, just as nodes are cluster resources. Like regular volumes, PVs are implemented using volume plugins, but they have a lifecycle independent of any Pod using the PV.

[0040] A PVC (Persistent Volume Claim) represents a user's request for storage. Conceptually, it's similar to a Pod. A Pod consumes node resources, while a PVC claim consumes PV resources. A Pod can request a specific amount of resources (CPU and memory); similarly, a PVC claim can request a specific size and access mode.

[0041] StorageClass provides administrators with a way to describe storage "classes". Different types may map to different quality of service levels or backup policies, or any policy defined by the cluster administrator.

[0042] Referring to Figure 1, which is a schematic diagram of a storage volume creation process, on the storage pool side, the administrator describes the storage pool by setting a storage class. The storage pool is used to provide storage resources; that is, the storage class is the descriptive information of the storage pool. Optionally, there can be multiple storage pools, and each storage pool can correspond to one storage class. For example, the storage class can be the StorageClass class.

[0043] In a Kubernetes cluster, in response to a user-input resource scheduling request, a persistent volume declaration (PVC) is created. This PVC is a native persistent volume declaration for the Kubernetes cluster. In response to a request to create a pod node, the pod node is created and associated with the persistent volume declaration PVC. The Kubernetes cluster controller creates a storage volume (PV) based on the persistent volume declaration PVC and mounts the storage volume onto the pod node.

[0044] Understandably, a persistent volume declaration (PVC) can include capacity configuration information. The controller, based on this information and the associated storage class, schedules resources within the storage pool corresponding to that storage class to create the storage volume corresponding to the capacity configuration. For example, with a capacity configuration of 50GB, the storage volume's maximum storage resource is 50GB. The storage volume is then mounted on a pod node, allowing the pod node to use its storage resources for data storage. Correspondingly, the storage pool allocates storage resources corresponding to the capacity configuration as the storage resource for the storage volume.

[0045] Optionally, the above resource scheduling process can be executed by the persistent volume management module of the Kubernetes cluster. In Figure 1, when the storage volume resources corresponding to a pod node are insufficient, the capacity configuration information of the storage volume can be increased to expand the storage volume. The system receives user requests to adjust the capacity configuration information in the persistent volume declaration (PVC), verifies the target capacity configuration information in the adjustment request, and if the target capacity configuration information is greater than the original capacity configuration information in the persistent volume declaration PVC, the verification is completed, and the persistent volume declaration PVC is updated. When the controller detects a change in the persistent volume declaration PVC, it expands the storage volume based on the updated persistent volume declaration PVC.

[0046] It should be noted that the verification process for the capacity configuration information in the persistent volume declaration PVC is as follows: if the target capacity configuration information is greater than the original capacity configuration information in the persistent volume declaration PVC, the verification is successful; if the target capacity configuration information is less than the original capacity configuration information in the persistent volume declaration PVC, the verification fails. Therefore, the storage volume in Figure 1 can only be expanded, not reduced.

[0047] To address the aforementioned technical problems, this disclosure provides a resource scheduling method for a Kubernetes cluster, enabling the expansion and contraction of storage volumes. Figure 2 is a flowchart of a resource scheduling method for a Kubernetes cluster provided in this disclosure. This embodiment is applicable to situations where storage volumes are created and their capacity can be increased or decreased. This method can be executed by a Kubernetes cluster resource scheduling device, which can be implemented in hardware and / or software and can be configured in a computer or server. As shown in Figure 2, the method includes:

[0048] S110. In response to a resource scheduling request, create a first persistent volume declaration and a second persistent volume declaration of a predefined type, and associate the first persistent volume declaration and the second persistent volume declaration with storage pools respectively. The first persistent volume declaration is a native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information.

[0049] S120. Associate the pre-created pod node with the first persistent volume declaration.

[0050] S130. Create a storage volume based on the first persistent volume declaration and mount the storage volume to the pod node.

[0051] In this embodiment, a resource scheduling request can be understood as a request to schedule storage resources for a pod node. Optionally, an interactive page is displayed, and a resource scheduling request is generated in response to a preset request on the interactive page. The interactive page may include information collection controls and resource scheduling controls. The information collection controls can obtain configuration information input by the user. This configuration information may include, but is not limited to, capacity configuration information and storage pool information. The storage pool information may be attribute information of the target storage pool, such as, but not limited to, storage type. In response to a click on the resource scheduling controls, a resource scheduling request carrying the configuration information is generated.

[0052] Optionally, the persistent volume management module of the Kubernetes cluster receives and executes resource scheduling requests to achieve storage resource scheduling and schedule storage resources for pod nodes.

[0053] In this embodiment, a new Kubernetes Custom Resources (CR) type, which can be labeled BenVolume, is introduced into the Kubernetes cluster. Accordingly, in response to a resource scheduling request, a first persistent volume declaration and a second persistent volume declaration are created. The first persistent volume declaration is a native persistent volume declaration (PVC) of the Kubernetes cluster, and the second persistent volume declaration is a persistent volume declaration of a predefined type, BenVolume.

[0054] The first and second persistent volume declarations each contain capacity configuration information. The first persistent volume declaration supports increasing the capacity configuration, while the second persistent volume declaration supports both increasing and decreasing the capacity configuration. In other words, increasing the capacity configuration allows for expanding the storage volume, while decreasing it allows for shrinking the storage volume. Since the native persistent volume declarations in the Kubernetes cluster (i.e., the first persistent volume declaration) do not support shrinking the storage volume, the introduction of a predefined type of second persistent volume declaration enables the shrinking of storage volumes in the Kubernetes cluster.

[0055] Optionally, the first persistent volume declaration and the second persistent volume declaration can be created as follows: create a second persistent volume declaration of the predefined type; and, upon detecting the second persistent volume declaration, create the first persistent volume declaration based on the second persistent volume declaration, wherein the first persistent volume declaration and the second persistent volume declaration correspond to the same identifier.

[0056] In this embodiment, the Kubernetes cluster or its persistent volume management module includes a controller that can listen to the first and second persistent volume declarations. For example, this listening can be achieved through a watch listener.

[0057] The resource scheduling request includes configuration information, which can be understood as the information required to create a persistent volume declaration, such as, but not limited to, capacity configuration information and storage pool information. A second persistent volume declaration of a predefined type is created based on the configuration information. When the controller detects a new second persistent volume declaration, it creates a corresponding first persistent volume declaration based on that second persistent volume declaration. Specifically, the first persistent volume declaration is created based on the identifier of the second persistent volume declaration and the configuration information within it. The identifier of the first persistent volume declaration is the same as that of the second persistent volume declaration. By setting the same identifier, it is easy to identify the corresponding first and second persistent volume declarations.

[0058] Associate the first persistent volume declaration and the second persistent volume declaration with the storage pool respectively. Specifically, associate the first persistent volume declaration and the second persistent volume declaration with the storage class of the storage pool respectively.

[0059] The controller creates storage volumes based on the native logic of the Kubernetes cluster and mounts these volumes to pod nodes. Specifically, the controller creates a storage volume in the storage pool corresponding to the first persistent volume based on the capacity configuration information in the first persistent volume declaration and the storage class associated with the first persistent volume. The storage resource limit of this storage volume is determined based on the capacity configuration information.

[0060] The pod nodes can be pre-created or created based on the pod node creation request; this is not limited here.

[0061] For example, see Figure 3, which is a schematic diagram of the resource scheduling method provided in this embodiment. On the storage system side, storage pools are described by storage classes. In a Kubernetes cluster, in response to a user-input resource scheduling request, a second persistent volume declaration (BenVolume) is created. When the controller detects a newly added second persistent volume declaration (BenVolume), a first persistent volume declaration (PVC) with the same identifier as the second persistent volume declaration (BenVolume) is created. In response to a pod node creation request, a pod node is created and associated with the first persistent volume declaration (PVC) with the same identifier as the second persistent volume declaration (BenVolume). The controller includes native logic that creates storage volumes based on the first persistent volume declaration (PVC) and mounts the storage volumes to the aforementioned pod nodes, thereby scheduling storage resources for the pod nodes.

[0062] The technical solution provided in this embodiment introduces a new Kubernetes custom resource type. During the storage volume creation process, a predefined type of second persistent volume declaration is created. This second persistent volume declaration supports increasing and decreasing capacity configuration information, further supporting the expansion and contraction of the created storage volume. By creating a corresponding first persistent volume declaration based on the second persistent volume declaration, and then creating a storage volume based on the first persistent volume declaration, storage resource scheduling for pod nodes is achieved.

[0063] Figure 4 is a flowchart illustrating a resource scheduling method provided in an embodiment of this disclosure. It is optimized based on the above embodiments to achieve storage volume scaling and / or expansion. Specifically, the method includes:

[0064] S210. In response to a resource scheduling request, create a first persistent volume declaration and a second persistent volume declaration of a predefined type, and associate the first persistent volume declaration and the second persistent volume declaration with storage pools respectively. The first persistent volume declaration is a native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information.

[0065] S220. Associate the pre-created pod node with the first persistent volume declaration; create a storage volume based on the first persistent volume declaration, and mount the storage volume to the pod node.

[0066] S230. In response to a capacity update request for the second persistent volume declaration, update the capacity configuration information in the second persistent volume declaration; the capacity update request includes a capacity increase request and a capacity decrease request; when a change is detected in the second persistent volume declaration, perform capacity change processing on the storage volume.

[0067] A capacity update request can be understood as a request to update the capacity configuration information in the second persistent volume declaration. The capacity update request can include a capacity increase request and a capacity decrease request. The capacity increase request is used to increase the capacity configuration information in the second persistent volume declaration to expand the storage volume, and the capacity decrease request is used to decrease the capacity configuration information in the second persistent volume declaration to shrink the storage volume.

[0068] Capacity update requests can be generated based on user capacity update operations. Specifically, they can be generated based on updates to the capacity configuration information of an existing storage volume. For example, they may be generated when the storage resources of an existing storage volume are insufficient, or when the storage resources of an existing storage volume are excessive.

[0069] Optionally, in response to a query request, the resource information corresponding to the storage volume mounted on the created pod node is displayed. This resource information includes resource quantity and resource utilization. Resource quantity can be the storage resource limit corresponding to the storage volume, i.e., the total resource quantity. Resource utilization can be the ratio of used resource quantity to the total resource quantity. Optionally, the resource utilization corresponding to the storage volume can be one or more of the following: historical maximum resource utilization, historical average resource utilization, and current resource utilization.

[0070] By displaying the resource quantity and utilization rate of each storage volume, users can obtain information on the resource usage of each storage volume and thus expand or shrink it. For example, if the resource utilization rate of a storage volume exceeds a first threshold (e.g., it could be a certain threshold), it indicates that the storage volume has insufficient storage resources; if the resource utilization rate is less than a second threshold, it indicates that the storage volume has excess storage resources, where the first threshold is greater than the second threshold. For example, the available resource quantity of a storage volume is determined based on the resource quantity and utilization rate. If the available resource quantity of a storage volume is less than a third threshold, it indicates that the storage volume has insufficient storage resources; if the available resource quantity of a storage volume is greater than a fourth threshold, it indicates that the storage volume has excess storage resources, where the fourth threshold is greater than the third threshold.

[0071] It can expand storage volumes with insufficient storage resources and shrink storage volumes with excessive storage resources.

[0072] In some embodiments, the above query request can be executed based on a preset time period to periodically query the resource information of each storage volume, so as to facilitate timely expansion or contraction of each storage volume.

[0073] In some embodiments, during the resource scheduling process of adding a new pod node, if there are insufficient resources in the storage pool, a query request can be triggered to query the resource information of each storage volume. By scaling down one or more storage volumes, the invalid occupation of storage resources can be avoided.

[0074] In some embodiments, a scheduled task can be set to query and determine the resource information of the storage volume, and generate a capacity update prompt. If insufficient storage resources are detected in any storage volume, an expansion prompt is generated for that storage volume; if excessive storage resources are detected in any storage volume, a reduction prompt is generated for that storage volume.

[0075] A capacity update request can be generated based on the aforementioned capacity update prompt information, or a capacity update prompt information can be displayed and a capacity update request can be generated based on the user's capacity update operation. The capacity update request here can be a capacity update request for a second persistent volume declaration, which supports increasing and decreasing the capacity configuration information.

[0076] The second persistent volume claim includes a capacity configuration field, the content of which is capacity configuration information. A capacity update request for the second persistent volume claim can be an update request for the content of the capacity configuration field in the second persistent volume claim, updating the value of the capacity configuration information, for example, updating the capacity configuration information from 500G to 100G, or from 100G to 500G, etc.

[0077] When the controller detects a change in the declaration of the second persistent volume, it performs capacity change processing on the storage volume, such as expansion or reduction. In some embodiments, the controller may include a storage plug-in scaler to expand or reduce the storage volume.

[0078] In one embodiment, the method further includes: updating the capacity configuration information in the second persistent volume declaration in response to a capacity update request for the first persistent volume declaration; the capacity update request includes a capacity increase request; and performing capacity change processing on the storage volume when a change is detected in the first persistent volume declaration. The first persistent volume declaration supports increasing the capacity configuration information to expand the storage volume. The capacity configuration information carried in the capacity update request is verified, and if the capacity configuration information carried in the capacity update request is greater than the original capacity configuration information in the first persistent volume declaration, the original capacity configuration information in the first persistent volume declaration is updated to the capacity configuration information carried in the capacity update request. When the controller detects a change in the first persistent volume declaration, it performs capacity change processing on the storage volume.

[0079] Optionally, the storage volume is processed for capacity change, including updating the storage resource limit of the storage volume according to the capacity configuration information in the capacity update request. For example, if the capacity configuration information in the capacity update request is 100G, the storage resource limit of the storage volume is updated to 100G accordingly.

[0080] Optionally, the control storage volume sends capacity update information to the storage pool to update the available resources of the storage pool. The storage pool adjusts the storage space corresponding to the storage volume based on the capacity update information. Taking a capacity reduction request as an example, the capacity update information sent by the control storage volume to the storage pool may include updated storage resource limits (or capacity configuration information). The storage pool adjusts the storage space corresponding to the storage volume based on the storage resource limits and releases excess storage resources to update the available resources of the storage pool. Taking a capacity increase request as an example, the storage pool adjusts the storage space corresponding to the storage volume based on the storage resource limits, increasing the storage space corresponding to the storage volume, that is, scheduling the corresponding storage resources from the available resources of the storage pool to meet the resource scheduling requirements of the storage volume, thus updating the available resources of the storage pool.

[0081] The technical solution of this embodiment uses a second persistent volume declaration to expand or shrink the storage volume, thereby meeting different scheduling requirements for the storage resources of the storage volume.

[0082] Figure 5 is a schematic diagram of a resource scheduling device for a Kubernetes cluster provided in an embodiment of this disclosure. As shown in Figure 5, the device includes:

[0083] The persistent volume declaration creation module 210 is used to create a first persistent volume declaration and a second persistent volume declaration of a predefined type in response to a resource scheduling request, and associate the first persistent volume declaration and the second persistent volume declaration with a storage pool respectively. The first persistent volume declaration is the native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information.

[0084] The storage volume creation module 220 is used to associate a pre-created pod node with the first persistent volume declaration; create a storage volume based on the first persistent volume declaration; and mount the storage volume to the pod node.

[0085] The technical solution of this embodiment.

[0086] Based on the above embodiments, optionally, the persistent volume declaration creation module 210 is used to create a second persistent volume declaration of the predefined type; and to create a first persistent volume declaration based on the second persistent volume declaration when the second persistent volume declaration is detected, wherein the first persistent volume declaration and the second persistent volume declaration correspond to the same identifier.

[0087] Optionally, based on the above embodiments, the device further includes:

[0088] The capacity update module is used to update the capacity configuration information in the second persistent volume declaration in response to a capacity update request for the second persistent volume declaration; the capacity update request includes a capacity increase request and a capacity decrease request; when a change is detected in the second persistent volume declaration, the storage volume is processed for capacity change.

[0089] Optionally, the capacity update module is further configured to update the capacity configuration information in the second persistent volume declaration in response to a capacity update request for the first persistent volume declaration; the capacity update request includes a capacity increase request; and when a change is detected in the first persistent volume declaration, the storage volume is processed to change its capacity.

[0090] Optionally, the capacity update module is also used to update the storage resource limit of the storage volume according to the capacity configuration information in the capacity update request.

[0091] Optionally, the capacity update module is also used to send capacity update information to the storage pool to update the available resources of the storage pool.

[0092] Optionally, the capacity update module is also used to respond to query requests by displaying the resource information corresponding to the storage volume mounted on the created pod node, wherein the resource information includes resource quantity and resource utilization.

[0093] The Kubernetes cluster resource scheduling device provided in this disclosure can execute the Kubernetes cluster resource scheduling method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects of the method execution.

[0094] Figure 6 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. The electronic device 10 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or claimed herein.

[0095] As shown in Figure 6, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data requested by the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0096] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0097] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as resource scheduling methods for a Kubernetes cluster.

[0098] In some embodiments, the Kubernetes cluster resource scheduling method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the Kubernetes cluster resource scheduling method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to execute the Kubernetes cluster resource scheduling method by any other suitable means (e.g., by means of firmware).

[0099] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a memory pool, at least one input device, and at least one output device, and transferring data and instructions to the memory pool, the at least one input device, and the at least one output device.

[0100] Computer programs used to implement the resource scheduling method for Kubernetes clusters disclosed herein can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / requests specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on the machine, partially on the machine, or as a standalone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0101] This disclosure also provides a computer-readable storage medium storing computer instructions for causing a processor to execute a resource scheduling method for a Kubernetes cluster, the method comprising:

[0102] In response to a resource scheduling request, a first persistent volume declaration and a second persistent volume declaration of a predefined type are created. The first persistent volume declaration and the second persistent volume declaration are associated with storage pools respectively. The first persistent volume declaration is a native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information. The pre-created pod node is associated with the first persistent volume declaration. A storage volume is created based on the first persistent volume declaration and mounted on the pod node.

[0103] In the context of this disclosure, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium can be a machine-readable storage medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0104] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0105] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0106] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0107] It should be understood that the various forms of processes shown above can be used to rearrange, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this disclosure can be achieved, and this is not limited herein.

[0108] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.

Claims

1. A resource scheduling method for a Kubernetes cluster, comprising: In response to a resource scheduling request, a first persistent volume declaration and a second persistent volume declaration of a predefined type are created. The first persistent volume declaration and the second persistent volume declaration are associated with storage pools respectively. The first persistent volume declaration is a native persistent volume declaration of the Kubernetes cluster. The first persistent volume declaration and the second persistent volume declaration are respectively set with capacity configuration information. The second persistent volume declaration supports increasing and decreasing the capacity configuration information. Associate the pre-created pod node with the first persistent volume declaration; and A storage volume is created based on the first persistent volume declaration, and the storage volume is mounted to the pod node.

2. The method according to claim 1, wherein, The creation of the first persistent volume declaration and the second persistent volume declaration of the predefined type includes: Create a second persistent volume declaration of the predefined type; and Upon detecting the second persistent volume declaration, the first persistent volume declaration is created based on the second persistent volume declaration, wherein the first persistent volume declaration and the second persistent volume declaration correspond to the same identifier.

3. The method according to claim 1, further comprising: In response to a capacity update request for the second persistent volume claim, update the capacity configuration information in the second persistent volume claim; The capacity update request includes a capacity increase request and a capacity decrease request; as well as When a change is detected in the second persistent volume declaration, the storage volume is modified to change its capacity.

4. The method according to claim 1, further comprising: In response to a capacity update request for the first persistent volume claim, update the capacity configuration information in the second persistent volume claim; The capacity update request includes a capacity increase request; as well as When a change is detected in the first persistent volume declaration, the storage volume is processed to change its capacity.

5. The method according to claim 3 or 4, wherein, The process of changing the capacity of the storage volume includes: Update the storage resource limit of the storage volume according to the capacity configuration information in the capacity update request.

6. The method according to claim 3 or 4, further comprising: Send capacity update information to the storage pool to update the available resources of the storage pool.

7. The method according to claim 3 or 4, further comprising: In response to a query request, the system displays the resource information corresponding to the storage volume mounted on the created pod node. The resource information includes the resource quantity and resource utilization rate.

8. A resource scheduling device for a Kubernetes cluster, comprising: A persistent volume declaration creation module is used to create a first persistent volume declaration and a second persistent volume declaration of a predefined type in response to a resource scheduling request. The first and second persistent volume declarations are associated with storage pools, respectively. The first persistent volume declaration is a native persistent volume declaration of the Kubernetes cluster. Both the first and second persistent volume declarations contain capacity configuration information, and the second persistent volume declaration supports increasing and decreasing the capacity configuration information. The storage volume creation module is used to associate a pre-created pod node with the first persistent volume declaration; create a storage volume based on the first persistent volume declaration; and mount the storage volume to the pod node.

9. An electronic device, the electronic device comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the resource scheduling method for the Kubernetes cluster according to any one of claims 1-7.

10. A computer-readable storage medium, wherein, The computer-readable storage medium stores computer instructions that cause a processor to execute the resource scheduling method for the Kubernetes cluster according to any one of claims 1-7.