Container scheduling method and device in cloud environment, electronic equipment and storage medium

By introducing subcluster managers and resource cluster objects in the cloud data center, real-time resource awareness and resource migration of Kubernetes subclusters are realized, which solves the problems of subcluster management difficulties and low resource utilization in cloud data centers, and improves the availability and resource utilization of containers.

CN119668797APending Publication Date: 2025-03-21CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411683856.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-22
Publication Date
2025-03-21

AI Technical Summary

Technical Problem

The management of Kubernetes subclusters in cloud data centers faces performance bottlenecks, and due to factors such as remote disaster recovery and cost budget, Kubernetes subclusters are scattered and management is becoming increasingly difficult.

Method used

Introduce subcluster manager and resource cluster objects to monitor the scheduling status of containers in real time in the subcluster, and store container and node information when system resources are not successfully allocated. Listen to the subcluster's rescheduling field information in real time in the main cluster, obtain target container and node information, and migrate the container to other subclusters with sufficient system resources.

Benefits of technology

Real-time resource awareness and resource balance capabilities of each subcluster in the cloud data center in the federated scenario are realized, container availability and comprehensive resource utilization of subclusters are improved, and container unavailability time is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119668797A_ABST
    Figure CN119668797A_ABST
Patent Text Reader

Abstract

The invention provides a container scheduling method and device in a cloud environment, electronic equipment and a storage medium. According to the application, the sub-cluster manager and the resource cluster object are introduced into the sub-cluster, the main cluster manager is introduced into the main cluster, and the sub-cluster manager, the resource cluster object and the main cluster manager cooperate with one another. The real-time resource sensing and resource balancing capabilities of each sub-cluster in the cloud data center in a federated scene are realized, the real-time performance of detecting whether the container is normal or available is improved, the container can be immediately scheduled to other nodes or clusters under the condition that the container cannot obtain actually required system resources, and the resource utilization rate is improved. The unavailable duration of the container is reduced, the influence on the quality of the cloud service provided by the container to the outside is avoided, and the container availability of each sub-cluster in the cloud data center in the federated scene and the comprehensive resource utilization rate of the sub-clusters are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of cloud computing technology, and in particular to a container scheduling method, device, electronic device and storage medium in a cloud environment. Background Art

[0002] With the rapid development of cloud computing technology, the scale of cloud data centers of cloud service providers is getting larger and larger. For example, the number of Kubernetes subclusters in cloud data centers is increasing, and the scale of nodes and containers on a single Kubernetes subcluster is growing.

[0003] This will lead to increasingly prominent performance bottlenecks in the management of Kubernetes subclusters. At the same time, due to factors such as remote disaster recovery, cost budget, hybrid cloud, multi-cloud and local traffic access, cloud service providers choose to deploy each Kubernetes sub-cluster in the cloud data center in different geographical locations and computer rooms of different cloud vendors, resulting in the dispersion of Kubernetes sub-clusters, the increasing number of Kubernetes sub-clusters, and increasingly difficult management. Summary of the invention

[0004] The present application illustrates a container scheduling method, device, electronic device and storage medium in a cloud environment.

[0005] In a first aspect, the present application shows a container scheduling method in a cloud environment, which is applied to a subcluster manager in a subcluster in a cloud data center, and the method includes:

[0006] Monitor the scheduling status of containers on each node in the subcluster in real time. The scheduling status of containers is used to indicate whether system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container.

[0007] When the scheduling state indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to actual needs of the target container, in the rescheduling field in the resource cluster object in the sub-cluster, at least container information of the target container and node information of the first node are stored, and the first node is located in the sub-cluster.

[0008] In a second aspect, the present application shows a container scheduling method in a cloud environment, which is applied to a main cluster manager in a main cluster in a cloud data center, and the method includes:

[0009] Monitor in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes;

[0010] When information in a rescheduling field in a resource cluster object in a first subcluster in a cloud data center changes, container information of a target container in the rescheduling field and node information of a first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when a subcluster manager in the first subcluster monitors that system resources on the first node where the target container is located are not successfully allocated to the target container according to actual needs of the target container, the rescheduling field in the resource cluster object in the first subcluster is stored, and the first node is located in the first subcluster;

[0011] The target container is migrated to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0012] In a third aspect, the present application shows a container scheduling device in a cloud environment, which is applied to a subcluster manager in a subcluster in a cloud data center, and the device includes:

[0013] The first monitoring module is used to monitor the scheduling status of the container on each node in the sub-cluster in real time. The scheduling status of the container is used to indicate whether the system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container;

[0014] The first storage module is used to store at least container information of the target container and node information of the first node in a rescheduling field in a resource cluster object in the sub-cluster when the scheduling state indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to actual needs of the target container, and the first node is located in the sub-cluster.

[0015] In a fourth aspect, the present application shows a container scheduling device in a cloud environment, which is applied to a main cluster manager in a main cluster in a cloud data center, and the device includes:

[0016] The second monitoring module is used to monitor in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes;

[0017] A third acquisition module is used to acquire the container information of the target container in the rescheduling field and the node information of the first node where the target container is located when the information in the rescheduling field in the resource cluster object in the first subcluster in the cloud data center changes; the container information of the target container and the node information of the first node are: when the subcluster manager in the first subcluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual demand of the target container, the rescheduling field in the resource cluster object in the first subcluster is stored, and the first node is located in the first subcluster;

[0018] A migration module is used to migrate the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0019] In a fifth aspect, the present application illustrates an electronic device, comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute the method described in any of the above aspects.

[0020] In a sixth aspect, the present application illustrates a non-temporary computer-readable storage medium, which, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute a method as described in any of the above aspects.

[0021] In a seventh aspect, the present application illustrates a computer program product. When instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the method described in any of the above aspects.

[0022] The technical solution provided by this application may have the following beneficial effects:

[0023] In the present application, a subcluster manager in a subcluster in a cloud data center monitors the scheduling status of containers on each node in the subcluster in real time, and the scheduling status of the container is used to indicate whether system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container; when the scheduling status indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, in the rescheduling field in the resource cluster object in the subcluster, at least container information of the target container and node information of the first node are stored, and the first node is located in the subcluster.

[0024] Thereby, the main cluster manager in the main cluster in the cloud data center monitors in real time whether the information in the rescheduling field in the resource cluster objects in each sub-cluster in the cloud data center changes; when the information in the rescheduling field in the resource cluster object in the first sub-cluster in the cloud data center changes, the container information of the target container in the rescheduling field and the node information of the first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when the sub-cluster manager in the first sub-cluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, the first node is stored in the rescheduling field in the resource cluster object in the first sub-cluster, and the first node is located in the first sub-cluster; according to the container information of the target container and the node information of the first node, the target container is migrated to the node in the second sub-cluster in the cloud data center.

[0025] Through this application, a subcluster manager and a resource cluster object are introduced in the subcluster, and a main cluster manager is introduced in the main cluster. The subcluster manager, resource cluster object and main cluster manager cooperate with each other to realize the real-time resource perception and resource balancing capabilities of each subcluster in the cloud data center in the federation scenario, improve the real-time performance of detecting whether the container is normal / available, and ensure that the container can be immediately scheduled to other nodes or clusters when the actual required system resources cannot be obtained, thereby reducing the unavailability time of the container, avoiding affecting the quality of the container providing cloud services to the outside world, and improving the container availability of each subcluster in the cloud data center in the federation scenario and the comprehensive resource utilization of the subcluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a structural block diagram of a cloud data center of the present application.

[0027] Figure 2 This is a flowchart of the steps of a container scheduling method in a cloud environment of the present application.

[0028] Figure 3 This is a flowchart of the steps of a container scheduling method in a cloud environment of the present application.

[0029] Figure 4 This is a structural block diagram of a container scheduling device in a cloud environment of the present application.

[0030] Figure 5 This is a structural block diagram of a container scheduling device in a cloud environment of the present application.

[0031] Figure 6 It is a block diagram of an electronic device of the present application.

[0032] Figure 7 It is a block diagram of an electronic device of the present application. DETAILED DESCRIPTION

[0033] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0034] In order to uniformly manage these Kubernetes subclusters in cloud data centers, the Kubernetes community launched cluster federation technology, which aims to uniformly manage Kubernetes subclusters distributed in various locations through the management interface of cluster federation.

[0035] In the Kubernetes subcluster federation technology, cross-cluster scheduling of containers is provided. When a container needs to be created, the scheduler in the cloud data center can identify the system resource margin of each Kubernetes subcluster in the cloud data center, and schedule the container to the Kubernetes subcluster with a larger system resource margin, so that the container can be created on the Kubernetes subcluster with a larger system resource margin, and then the Kubernetes subcluster with a larger system resource margin can allocate the system resources required by the container for the container to use.

[0036] However, the system resources in the subsequent Kubernetes sub-clusters may change, for example, a node in the Kubernetes sub-cluster may crash, a network failure may occur in a node in the Kubernetes sub-cluster, a storage failure may occur in a node in the Kubernetes sub-cluster, or a node in the Kubernetes sub-cluster may be overloaded.

[0037] If the system resources in a Kubernetes subcluster subsequently change as described above, the containers hosted on the Kubernetes subcluster may not have enough system resources to use, resulting in abnormal container status. Therefore, the containers need to be scheduled to other Kubernetes subclusters in the cloud data center with sufficient system resources.

[0038] To do this, you need to check the status of the containers hosted on each Kubernetes sub-cluster.

[0039] The current Kubernetes cluster federation technology periodically checks the status of containers carried on each Kubernetes sub-cluster every 5 minutes, and triggers cross-cluster scheduling of containers when container abnormalities are found.

[0040] However, if the check interval is too long, it will be difficult to schedule abnormal containers across clusters in a timely manner. The container may be unavailable for up to 5 minutes. If the container is unavailable for too long, the container availability will be poor, affecting the quality of the cloud services provided by the container.

[0041] To this end, this application is proposed, referring to Figure 1 , showing a structural block diagram of a cloud data center of the present application.

[0042] The cloud data center consists of a main cluster and multiple sub-clusters. Figure 1 A main cluster and two sub-clusters are used as an example for illustration, but this is not intended to limit the protection scope of this application.

[0043] The two subclusters are subcluster 1 and subcluster 2.

[0044] Each subcluster has a subcluster manager.

[0045] Subclusters include Kubernetes subclusters, etc.

[0046] For example, you can deploy subcluster managers in each subcluster using Kubernetes' Deployment workload.

[0047] The subcluster manager may include: resource-cluster-manager components, etc. A subcluster may have a subcluster manager, and a subcluster manager may not be deployed on each node in a subcluster. The subcluster managers in the subcluster may communicate and connect with each node in the subcluster, and interact with each other, so that the subcluster managers in the subcluster can monitor the status of containers on each node in the subcluster.

[0048] Each subcluster also has a resource cluster object. The resource cluster object in the subcluster may include: Kubernetes custom resource ResourceCluster, etc., to indicate the abnormal situation of the subcluster.

[0049] Each subcluster also has its own node, which can be a physical node or a virtual node. The physical node can be a physical machine, such as a server, and the virtual node can be a virtual machine installed on the physical machine. The nodes can also communicate with each other.

[0050] Each subcluster also has a cluster federation agent service, which is used to connect to the cluster federation management plane service in the main cluster.

[0051] The master cluster manager can be deployed in the master cluster through the Kubernetes Deployment workload.

[0052] The main cluster manager may include: resource-hub-manager components, etc. The main cluster may have one main cluster manager, and the main cluster manager may not be deployed on every node in the main cluster. The main cluster manager in the main cluster may communicate and connect with each node in the main cluster and interact with each other.

[0053] The master cluster includes the Kubernetes master cluster.

[0054] The main cluster manager may monitor each resource cluster object in each sub-cluster manager, for example, monitor whether the content in each resource cluster object in each sub-cluster manager changes.

[0055] The main cluster also has a cluster federation management plane service, and the cluster federation management plane service and the main cluster manager can interact with each other.

[0056] Reference Figure 2 , showing a flow chart of the steps of a container scheduling method in a cloud environment of the present application, which is applied to a sub-cluster manager in a sub-cluster in a cloud data center.

[0057] Among them, the method includes:

[0058] In step S101, the scheduling status of the container on each node in the sub-cluster is monitored in real time. The scheduling status of the container is used to indicate whether the system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container.

[0059] System resources include ports, IP (Internet Protocol) addresses, CPU (Central Processing Unit), memory, bandwidth, disk, etc.

[0060] The subcluster manager has a Kubernetes Client with a built-in watch function. The subcluster manager can monitor the scheduling status of containers on each node in the subcluster in real time through HTTPWatch, thereby realizing real-time monitoring of whether the system resources on any node in the subcluster are successfully allocated to any container according to the actual needs of the container.

[0061] For any node in the subcluster, after the node attempts to allocate system resources of the node to a container on the node, if multiple attempts fail to successfully allocate system resources on the node to the container according to the actual needs of the container, the node can store the container information of the container in a specific field in the node, and the container information of the container may include metadata information of the container. The metadata information of the container may include the name of the container and the namespace where the name of the container is located. In the present application, different containers have different names.

[0062] In this way, for any node in the subcluster, the subcluster manager in the subcluster can access the specific field in the node in real time, extract the container information of the container in the specific field, and through the container information of this container, it can be determined whether the system resources on the node where the container is located have not been successfully allocated to the container according to the actual needs of the container.

[0063] In step S102, when the scheduling state indicates that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, at least the container information of the target container and the node information of the first node are stored in the rescheduling field in the resource cluster object in the sub-cluster, and the first node is located in the sub-cluster.

[0064] The node information of a node may include an IP address of the node, etc., and the node information of different nodes is different.

[0065] In the present application, a subcluster manager in a subcluster in a cloud data center monitors the scheduling status of containers on each node in the subcluster in real time, and the scheduling status of the container is used to indicate whether system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container; when the scheduling status indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, in the rescheduling field in the resource cluster object in the subcluster, at least container information of the target container and node information of the first node are stored, and the first node is located in the subcluster.

[0066] Thereby, the main cluster manager in the main cluster in the cloud data center monitors in real time whether the information in the rescheduling field in the resource cluster objects in each sub-cluster in the cloud data center changes; when the information in the rescheduling field in the resource cluster object in the first sub-cluster in the cloud data center changes, the container information of the target container in the rescheduling field and the node information of the first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when the sub-cluster manager in the first sub-cluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, the first node is stored in the rescheduling field in the resource cluster object in the first sub-cluster, and the first node is located in the first sub-cluster; according to the container information of the target container and the node information of the first node, the target container is migrated to the node in the second sub-cluster in the cloud data center.

[0067] Through this application, a subcluster manager and a resource cluster object are introduced in the subcluster, and a main cluster manager is introduced in the main cluster. The subcluster manager, resource cluster object and main cluster manager cooperate with each other to realize the real-time resource perception and resource balancing capabilities of each subcluster in the cloud data center in the federation scenario, improve the real-time performance of detecting whether the container is normal / available, and ensure that the container can be immediately scheduled to other nodes or clusters when the actual required system resources cannot be obtained, thereby reducing the unavailability time of the container, avoiding affecting the quality of the container providing cloud services to the outside world, and improving the container availability of each subcluster in the cloud data center in the federation scenario and the comprehensive resource utilization of the subcluster.

[0068] In the present application, according to statistics, there are many reasons why the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, including: the IP network of the first node where the target container is located is not connected, the port of the first node where the target container is located is not connected, the idle CPU resources of the first node where the target container is located cannot meet the actual needs of the target container, the idle memory resources of the first node where the target container is located cannot meet the actual needs of the target container, the idle disk resources of the first node where the target container is located cannot meet the actual needs of the target container, and the first node where the target container is located is down, etc.

[0069] In order to subsequently enable the main cluster manager in the main cluster in the cloud data center to perceive the reason why the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, in another embodiment of the present application, the rescheduling field in the resource cluster object in the sub-cluster includes at least an information field.

[0070] Thus, when at least the container information of the target container and the node information of the first node are stored in the rescheduling field in the resource cluster object in the subcluster in step S102, the container information of the target container and the node information of the first node may be stored in the information field in the rescheduling field.

[0071] Secondly, the rescheduling field in the resource cluster object in the subcluster also includes a reason field.

[0072] In this way, further, the reason why the system resources on the first node are not successfully allocated to the target container according to the actual demand of the target container can also be obtained, and the reason is stored in the reason field in the rescheduling field.

[0073] In one embodiment of the present application, when the subcluster manager monitors that system resources on the first node are not successfully allocated to the target container according to the actual needs of the target container, it can detect whether the IP network of the first node where the target container is located is connected. If the IP network of the first node where the target container is located is not connected, the lack of connectivity of the IP network of the first node where the target container is located can be determined as one of the reasons for the failure to successfully allocate system resources on the first node to the target container according to the actual needs of the target container.

[0074] In one embodiment of the present application, when the subcluster manager monitors that the system resources on the first node are not successfully allocated to the target container according to the actual needs of the target container, it can detect whether the port of the first node where the target container is located is connected. If the port of the first node where the target container is located is not connected, the port disconnection of the first node where the target container is located can be determined as one of the reasons for the failure to successfully allocate the system resources on the first node to the target container according to the actual needs of the target container. The ports of the first node can be all ports in the first node, or part of the ports in the first node, for example, Kubernetes kubelet port 10250, etc.

[0075] In one embodiment of the present application, when the subcluster manager monitors that system resources on the first node are not successfully allocated to the target container according to the actual demand of the target container, it can detect whether the idle CPU resources of the first node where the target container is located meet the actual demand of the target container for the CPU. When the idle CPU resources of the first node where the target container is located cannot meet the actual demand of the target container for the CPU, the inability of the idle CPU resources of the first node where the target container is located to meet the actual demand of the target container for the CPU can be determined as one of the reasons for the failure to successfully allocate system resources on the first node to the target container according to the actual demand of the target container.

[0076] In one embodiment of the present application, when the subcluster manager detects that system resources on the first node are not successfully allocated to the target container according to the actual needs of the target container, it can detect whether the free memory resources of the first node where the target container is located meet the actual memory needs of the target container. When the free memory resources of the first node where the target container is located cannot meet the actual memory needs of the target container, the failure of the free memory resources of the first node where the target container is located to meet the actual memory needs of the target container can be determined as one of the reasons for the failure to successfully allocate system resources on the first node to the target container according to the actual needs of the target container.

[0077] In one embodiment of the present application, when the subcluster manager detects that system resources on the first node are not successfully allocated to the target container according to the actual needs of the target container, it can detect whether the free disk resources of the first node where the target container is located meet the actual needs of the target container for the disk. When the free disk resources of the first node where the target container is located cannot meet the actual needs of the target container for the disk, the failure of the free disk resources of the first node where the target container is located to meet the actual needs of the target container for the disk can be determined as one of the reasons for the failure to successfully allocate system resources on the first node to the target container according to the actual needs of the target container.

[0078] In one embodiment of the present application, when the subcluster manager monitors that system resources on the first node are not successfully allocated to the target container according to the actual needs of the target container, it can detect whether the first node where the target container is located is down. When the first node where the target container is located is down, the downtime of the first node where the target container is located can be determined as one of the reasons for the failure to successfully allocate system resources on the first node to the target container according to the actual needs of the target container.

[0079] In order to subsequently enable the main cluster manager in the main cluster in the cloud data center to perceive the duration of failure to successfully allocate system resources on the first node where the target container is located to the target container according to the actual needs of the target container, in another embodiment of the present application, the rescheduling field in the resource cluster object in the sub-cluster includes at least an information field.

[0080] Thus, when at least the container information of the target container and the node information of the first node are stored in the rescheduling field in the resource cluster object in the subcluster in step S102, the container information of the target container and the node information of the first node may be stored in the information field in the rescheduling field.

[0081] Secondly, the rescheduling field in the resource cluster object in the subcluster also includes a duration field.

[0082] In this way, further, the duration of the failure to successfully allocate the system resources on the first node to the target container according to the actual demand of the target container can also be obtained.

[0083] When the duration exceeds the preset tolerance duration of the sub-cluster manager, the duration is stored in the duration field in the rescheduling field in the resource cluster object in the sub-cluster.

[0084] The preset tolerance time of the sub-cluster manager may be set in advance in the sub-cluster manager by a technician according to actual conditions. The specific value of the preset tolerance time of the sub-cluster manager may be determined according to actual conditions, and this application does not limit this.

[0085] The preset tolerance time of the sub-cluster manager may include, for example, 4 seconds, 5 seconds, or 6 seconds.

[0086] When the duration of the failure to successfully allocate the system resources on the first node to the target container according to the actual demand of the target container is obtained, the current time of the subcluster can be obtained. The creation time when the metadata information of the target container is created in the memory of the first node in the scenario of allocating the system resources on the first node to the target container is obtained.

[0087] Among them, in the process that the first node needs to allocate system resources on the first node to the target container, the first node needs to first establish metadata information of the target container in the memory of the first node, and then execute other steps related to "allocating system resources on the first node to the target container". Secondly, the first node can also store the establishment time when the metadata information of the target container is established in the memory.

[0088] For example, a binding relationship between metadata information of a target container and a creation time when the metadata information of the target container is created is stored in a memory.

[0089] After the first node reclaims the system resources on the first node allocated for the target container, the binding relationship between the metadata information of the target container and the establishment time when the metadata information of the target container is established is deleted in the memory of the first node.

[0090] In this way, the subcluster manager in the subcluster can obtain in memory, based on the metadata information of the target container and the binding relationship, the creation time of the metadata information of the target container in the memory of the first node in the scenario of allocating system resources on the first node to the target container.

[0091] Afterwards, the difference between the current moment and the establishment moment may be calculated, and the duration may be obtained according to the difference, for example, the difference may be used as the duration.

[0092] In another embodiment of the present application, the subcluster manager in the subcluster may also store the creation time when the metadata information of the target container is created in the memory of the first node in the duration field in the rescheduling field in the resource cluster object in the subcluster.

[0093] Reference Figure 3 , shows a flow chart of the steps of a container scheduling method in a cloud environment of the present application, which is applied to a main cluster manager in a main cluster in a cloud data center. The method includes:

[0094] In step S201, it is monitored in real time whether information in a rescheduling field in a resource cluster object in each sub-cluster in a cloud data center changes.

[0095] The main cluster manager has a Kubernetes Client with a built-in watch function. The main cluster manager can monitor in real time through HTTP Watch whether the information in the rescheduling field of the resource cluster object in each sub-cluster in the cloud data center has changed.

[0096] When the information in the rescheduling field in the resource cluster object in the first subcluster in the cloud data center changes, in step S202, the container information of the target container in the rescheduling field and the node information of the first node where the target container is located are obtained.

[0097] The container information of the target container and the node information of the first node are: when the subcluster manager in the first subcluster detects that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, the rescheduling field in the resource cluster object in the first subcluster is stored, and the first node is located in the first subcluster.

[0098] Alternatively, when the information in the rescheduling field in the resource cluster objects in each sub-cluster in the cloud data center has not changed, return to execute step S201 in real time: monitor whether the information in the rescheduling field in the resource cluster objects in each sub-cluster in the cloud data center has changed.

[0099] In step S203, the target container is migrated to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0100] In the present application, the main cluster manager in the main cluster in the cloud data center monitors in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes; when the information in the rescheduling field in the resource cluster object in the first sub-cluster in the cloud data center changes, the container information of the target container in the rescheduling field and the node information of the first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when the sub-cluster manager in the first sub-cluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, the first node is stored in the rescheduling field in the resource cluster object in the first sub-cluster, and the first node is located in the first sub-cluster; according to the container information of the target container and the node information of the first node, the target container is migrated to a node in the second sub-cluster in the cloud data center.

[0101] Through this application, a subcluster manager and a resource cluster object are introduced in the subcluster, and a main cluster manager is introduced in the main cluster. The subcluster manager, resource cluster object and main cluster manager cooperate with each other to realize the real-time resource perception and resource balancing capabilities of each subcluster in the cloud data center in the federation scenario, improve the real-time performance of detecting whether the container is normal / available, and ensure that the container can be immediately scheduled to other nodes or clusters when the actual required system resources cannot be obtained, thereby reducing the unavailability time of the container, avoiding affecting the quality of the container providing cloud services to the outside world, and improving the container availability of each subcluster in the cloud data center in the federation scenario and the comprehensive resource utilization of the subcluster.

[0102] In this application, the main cluster has cluster federation management plane services, and the cluster federation management plane services include Kubernetes cluster federation management plane services, etc.

[0103] Among them, when the cluster federation management plane service in the main cluster allocates the target container to a node in the subcluster in the cloud data in advance, it can first select a subcluster in the subcluster in the cloud data center according to the status of each node in each subcluster in the cloud data center, and select a node in the subcluster. For example, select the first subcluster in the subcluster in the cloud data center, and select the first node in the first subcluster. Then, in the cluster federation management plane service in the main cluster, store the first binding relationship between the container information of the target container, the node information of the first node and the subcluster information of the first subcluster, and then allocate the target container to the first node in the first subcluster according to the first binding relationship, so that the first node can allocate system resources on the first node where the target container is located to the target container according to the actual needs of the target container.

[0104] Thus, in step S203, the first binding relationship between the container information of the target container, the node information of the first node, and the subcluster information of the first subcluster can be deleted in the cluster federation management plane service in the main cluster, and a cross-cluster scheduling request can be sent to the cluster federation management plane service, so that the cluster federation management plane service selects a subcluster in the subcluster other than the first subcluster in the cloud data center according to the cross-cluster scheduling request and the status of each node in the subcluster other than the first subcluster in the cloud data center, and selects a node in the subcluster. For example, in the subcluster other than the first subcluster in the cloud data center, a second subcluster is selected, and a second node in the second subcluster is selected. Then, in the cluster federation management plane service in the main cluster, the second binding relationship between the container information of the target container, the node information of the second node, and the subcluster information of the second subcluster is stored. Then, according to the second binding relationship, the target container is migrated to the second node in the second subcluster in the cloud data center, so that the second node can allocate system resources on the second node where the target container is located to the target container according to the actual needs of the target container.

[0105] The system resource margin of the second node in the selected second subcluster can meet the actual demand of the target container, for example, can meet the actual demand for starting and running the target container, so that the target container can normally provide cloud services to the outside.

[0106] The present application does not limit the specific selection method of "selecting the second node in the second subcluster from the subclusters other than the first subcluster in the cloud data center", and the currently existing selection method may also be used.

[0107] In another embodiment of the present application, the rescheduling field in the resource cluster object in the first subcluster includes at least an information field. The container information of the target container and the node information of the first node are located in the information field in the rescheduling field in the resource cluster object in the first subcluster.

[0108] The rescheduling field in the resource cluster object in the first sub-cluster also includes a reason field.

[0109] The reason field is used to store the reason why the system resources on the node where the container is located are not successfully allocated to the container according to the actual needs of the container.

[0110] Thus, before executing step S203, the method further includes:

[0111] Determines whether the Reason field has content.

[0112] When there is content in the reason field, step S203 is performed again: the target container is migrated to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0113] Among them, since the reason field is used to store the reason why the system resources on the node where the container is located are not successfully allocated to the container according to the actual needs of the container, when there is content in the reason field, it means that the reason why the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container is stored in the reason field, which further means that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container.

[0114] Therefore, in order to successfully allocate system resources on a node to the target container according to the actual needs of the target container so that the target container can start and run, and then enable the target container to provide cloud services to the outside world normally, step S203 can be directly executed: according to the container information of the target container and the node information of the first node, the target container is migrated to a node in the second subcluster in the cloud data center.

[0115] In another embodiment of the present application, the rescheduling field in the resource cluster object in the first subcluster includes at least an information field. The container information of the target container and the node information of the first node are located in the information field in the rescheduling field in the resource cluster object in the first subcluster.

[0116] The rescheduling field in the resource cluster object in the first sub-cluster also includes a duration field.

[0117] The duration field is used to store the duration during which the system resources on the node where the container is located are not successfully allocated to the container according to the actual demand of the container.

[0118] Thus, before executing step S203, the method further includes:

[0119] Determines whether the Duration field has content.

[0120] If the Duration field has content, determine whether the timeout check policy of the primary cluster manager is turned on.

[0121] Since the duration field is used to store the duration of the failure to successfully allocate the system resources on the node where the container is located to the container according to the actual needs of the container, when there is content in the duration field, the explanation reason field stores the duration of the failure to successfully allocate the system resources on the first node where the target container is located to the target container according to the actual needs of the target container, thereby indicating that the failure to successfully allocate the system resources on the first node where the target container is located to the target container according to the actual needs of the target container has continued for a period of time.

[0122] Therefore, in order to successfully allocate system resources on a node to the target container according to the actual needs of the target container so that the target container can start and run, and then enable the target container to provide cloud services to the outside world normally, it can be determined whether the timeout check policy of the main cluster manager has been enabled.

[0123] Whether the timeout check policy of the main cluster manager is enabled can be set by the technician in advance according to the situation. The timeout check policy of the main cluster manager can be enabled or disabled. If the timeout check policy of the main cluster manager is enabled, the technician also needs to set the preset tolerance time of the main cluster manager.

[0124] The preset tolerance time of the main cluster manager may be set in advance in the main cluster manager by a technician according to actual conditions. The specific value of the preset tolerance time of the main cluster manager may be determined according to actual conditions, and this application does not limit this.

[0125] The preset tolerance time of the master cluster manager may include, for example, 9 seconds, 10 seconds, or 11 seconds.

[0126] The preset tolerance time of the main cluster manager and the preset tolerance time of each sub-cluster manager may be the same in value or may be different in value.

[0127] If the timeout check policy of the main cluster manager is not enabled, step S203 may be directly executed: migrating the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0128] Alternatively, when the timeout check policy of the main cluster manager is enabled, the duration of failure to successfully allocate the system resources on the first node to the target container according to the actual demand of the target container may be obtained.

[0129] When the duration exceeds the preset tolerance duration of the main cluster manager, step S203 is performed: the target container is migrated to a node in the second sub-cluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0130] Alternatively, when the duration does not exceed the preset tolerance duration of the primary cluster manager, step S203 may not be performed first.

[0131] When the duration of the failure to successfully allocate the system resources on the first node to the target container according to the actual demand of the target container is obtained, the current time of the main cluster can be obtained. The establishment time when the first node in the first sub-cluster establishes the metadata information of the target container in the memory of the first node in the scenario of allocating the system resources on the first node to the target container is obtained.

[0132] In one embodiment of the present application, the subcluster manager in the first subcluster stores the creation time when the metadata information of the target container is created in the memory of the first node in the duration field in the rescheduling field in the resource cluster object in the first subcluster. In this way, the main cluster manager can extract the creation time when the metadata information of the target container is created in the memory of the first node from the duration field in the rescheduling field in the resource cluster object in the first subcluster.

[0133] Afterwards, the difference between the current moment and the establishment moment may be calculated, and the duration may be obtained according to the difference, for example, the difference may be used as the duration.

[0134] In one embodiment, the preset tolerance time of the main cluster manager in the main cluster has a higher priority than the preset tolerance time of the sub-cluster managers in each sub-cluster. For example, if the preset tolerance time of the main cluster manager in the main cluster is 10 seconds, and the preset tolerance time of the sub-cluster managers in each sub-cluster is 5 seconds, then whether the main cluster manager executes step S203 needs to be determined based on the preset tolerance time of the main cluster manager, which is 10 seconds. This ensures that when there are too many sub-clusters and the preset tolerance time of each sub-cluster is inconsistent, the main cluster manager in the main cluster can decide whether to schedule the container across clusters based on the unified preset tolerance time.

[0135] It should be noted that, for the method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the present application.

[0136] Reference Figure 4 , shows a container scheduling device in a cloud environment of the present application, which is applied to a subcluster manager in a subcluster in a cloud data center, and the device includes:

[0137] The first monitoring module 11 is used to monitor the scheduling status of the container on each node in the sub-cluster in real time. The scheduling status of the container is used to indicate whether the system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container;

[0138] The first storage module 12 is used to store at least container information of the target container and node information of the first node in the rescheduling field of the resource cluster object in the sub-cluster when the scheduling state indicates that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container. The first node is located in the sub-cluster.

[0139] Wherein, the rescheduling field includes at least an information field;

[0140] The first storage module comprises:

[0141] A first storage unit, configured to store container information of a target container and node information of a first node in the information field in the rescheduling field;

[0142] Secondly, the rescheduling field also includes a reason field;

[0143] Accordingly, the device further comprises:

[0144] A first acquisition module, used to acquire a reason why the system resources on the first node are not successfully allocated to the target container according to the actual demand of the target container;

[0145] The second storage module is used to store the reason in the reason field in the rescheduling field.

[0146] Wherein, the rescheduling field includes at least an information field;

[0147] The first storage module comprises:

[0148] A first storage unit, configured to store container information of a target container and node information of a first node in the information field in the rescheduling field;

[0149] Secondly, the rescheduling field also includes a duration field;

[0150] Accordingly, the device further comprises:

[0151] A second acquisition module is used to acquire a duration of failure to successfully allocate system resources on the first node to the target container according to actual requirements of the target container;

[0152] The third storage module is configured to store the duration in the duration field in the rescheduling field when the duration exceeds a preset tolerance duration of the sub-cluster manager.

[0153] In the present application, a subcluster manager in a subcluster in a cloud data center monitors the scheduling status of containers on each node in the subcluster in real time, and the scheduling status of the container is used to indicate whether system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container; when the scheduling status indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, in the rescheduling field in the resource cluster object in the subcluster, at least container information of the target container and node information of the first node are stored, and the first node is located in the subcluster.

[0154] Thereby, the main cluster manager in the main cluster in the cloud data center monitors in real time whether the information in the rescheduling field in the resource cluster objects in each sub-cluster in the cloud data center changes; when the information in the rescheduling field in the resource cluster object in the first sub-cluster in the cloud data center changes, the container information of the target container in the rescheduling field and the node information of the first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when the sub-cluster manager in the first sub-cluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, the first node is stored in the rescheduling field in the resource cluster object in the first sub-cluster, and the first node is located in the first sub-cluster; according to the container information of the target container and the node information of the first node, the target container is migrated to the node in the second sub-cluster in the cloud data center.

[0155] Through this application, a subcluster manager and a resource cluster object are introduced in the subcluster, and a main cluster manager is introduced in the main cluster. The subcluster manager, resource cluster object and main cluster manager cooperate with each other to realize the real-time resource perception and resource balancing capabilities of each subcluster in the cloud data center in the federation scenario, improve the real-time performance of detecting whether the container is normal / available, and ensure that the container can be immediately scheduled to other nodes or clusters when the actual required system resources cannot be obtained, thereby reducing the unavailability time of the container, avoiding affecting the quality of the container providing cloud services to the outside world, and improving the container availability of each subcluster in the cloud data center in the federation scenario and the comprehensive resource utilization of the subcluster.

[0156] Reference Figure 5 , shows a container scheduling device in a cloud environment of the present application, which is applied to a main cluster manager in a main cluster in a cloud data center, and the device includes:

[0157] The second monitoring module 21 is used to monitor in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes;

[0158] The third acquisition module 22 is used to acquire the container information of the target container in the rescheduling field and the node information of the first node where the target container is located when the information in the rescheduling field in the resource cluster object in the first subcluster in the cloud data center changes; the container information of the target container and the node information of the first node are: when the subcluster manager in the first subcluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual demand of the target container, the rescheduling field in the resource cluster object in the first subcluster is stored, and the first node is located in the first subcluster;

[0159] The migration module 23 is used to migrate the target container to a node in the second sub-cluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0160] The rescheduling field at least includes an information field; the container information of the target container and the node information of the first node are located in the information field in the rescheduling field;

[0161] The rescheduling field also includes a reason field;

[0162] The reason field is used to store the reason why the system resources on the node where the container is located are not successfully allocated to the container according to the actual needs of the container;

[0163] The device also includes:

[0164] A first determination module, used to determine whether the reason field has content;

[0165] The migration module is further configured to: when there is content in the reason field, migrate the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0166] The rescheduling field at least includes an information field; the container information of the target container and the node information of the first node are located in the information field in the rescheduling field;

[0167] The rescheduling field also includes a duration field;

[0168] The duration field is used to store the duration of failure to successfully allocate system resources on the node where the container is located to the container according to the actual needs of the container;

[0169] The device also includes:

[0170] A second determination module, used to determine whether the duration field has content;

[0171] A third determination module, configured to determine whether a timeout check policy of the primary cluster manager has been enabled if there is content in the duration field;

[0172] The migration module is further used to: migrate the target container to a node in the second sub-cluster in the cloud data center according to the container information of the target container and the node information of the first node when the timeout check policy of the main cluster manager is not enabled;

[0173] or,

[0174] A fourth acquisition module is used to acquire a duration of failure to successfully allocate system resources on the first node to the target container according to actual needs of the target container when the timeout check policy of the main cluster manager is enabled;

[0175] The migration module is also used to: when the duration exceeds the preset tolerance duration of the main cluster manager, migrate the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

[0176] In the present application, the main cluster manager in the main cluster in the cloud data center monitors in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes; when the information in the rescheduling field in the resource cluster object in the first sub-cluster in the cloud data center changes, the container information of the target container in the rescheduling field and the node information of the first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when the sub-cluster manager in the first sub-cluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual needs of the target container, the first node is stored in the rescheduling field in the resource cluster object in the first sub-cluster, and the first node is located in the first sub-cluster; according to the container information of the target container and the node information of the first node, the target container is migrated to a node in the second sub-cluster in the cloud data center.

[0177] Through this application, a subcluster manager and a resource cluster object are introduced in the subcluster, and a main cluster manager is introduced in the main cluster. The subcluster manager, resource cluster object and main cluster manager cooperate with each other to realize the real-time resource perception and resource balancing capabilities of each subcluster in the cloud data center in the federation scenario, improve the real-time performance of detecting whether the container is normal / available, and ensure that the container can be immediately scheduled to other nodes or clusters when the actual required system resources cannot be obtained, thereby reducing the unavailability time of the container, avoiding affecting the quality of the container providing cloud services to the outside world, and improving the container availability of each subcluster in the cloud data center in the federation scenario and the comprehensive resource utilization of the subcluster.

[0178] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.

[0179] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0180] Figure 6 800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0181] Reference Figure 6 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .

[0182] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.

[0183] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.

[0184] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.

[0185] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also monitor the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.

[0186] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.

[0187] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.

[0188] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can monitor the open / closed state of the device 800, the relative positioning of the components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also monitor the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to monitor the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.

[0189] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 5G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.

[0190] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.

[0191] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0192] Figure 7 1 is a block diagram of an electronic device 1900 shown in the present application. For example, the electronic device 1900 may be provided as a server.

[0193] Reference Figure 7 , the electronic device 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions executable by the processing component 1922, such as an application. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.

[0194] The electronic device 1900 may also include a power supply component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input / output (I / O) interface 1958. The electronic device 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.

[0195] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0196] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.

[0197] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.

[0198] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0199] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0200] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0201] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0202] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0203] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.

[0204] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A container scheduling method in a cloud environment, characterized in that: Applied to a subcluster manager in a subcluster in a cloud data center, the method comprises: Monitor the scheduling status of containers on each node in the subcluster in real time. The scheduling status of containers is used to indicate whether system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container. When the scheduling state indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to actual needs of the target container, in the rescheduling field in the resource cluster object in the sub-cluster, at least container information of the target container and node information of the first node are stored, and the first node is located in the sub-cluster.

2. The method according to claim 1, characterized in that The rescheduling field at least includes an information field; The rescheduling field in the resource cluster object in the sub-cluster stores at least container information of the target container and node information of the first node, including: storing container information of a target container and node information of a first node in the information field in the rescheduling field; Secondly, the rescheduling field also includes a reason field; Accordingly, the method further comprises: Obtaining a reason why system resources on the first node are not successfully allocated to the target container according to actual requirements of the target container; The reason is stored in the reason field in the reschedule field.

3. The method according to claim 1, characterized in that The rescheduling field at least includes an information field; The rescheduling field in the resource cluster object in the sub-cluster stores at least container information of the target container and node information of the first node, including: storing container information of a target container and node information of a first node in the information field in the rescheduling field; Secondly, the rescheduling field also includes a duration field; Accordingly, the method further comprises: Obtaining a duration during which system resources on the first node are not successfully allocated to the target container according to actual needs of the target container; In a case where the duration exceeds a preset tolerance duration of the sub-cluster manager, the duration is stored in the duration field in the rescheduling field.

4. A container scheduling method in a cloud environment, characterized in that: Applied to a master cluster manager in a master cluster in a cloud data center, the method comprises: Monitor in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes; When information in a rescheduling field in a resource cluster object in a first subcluster in a cloud data center changes, container information of a target container in the rescheduling field and node information of a first node where the target container is located are obtained; the container information of the target container and the node information of the first node are: when a subcluster manager in the first subcluster monitors that system resources on the first node where the target container is located are not successfully allocated to the target container according to actual needs of the target container, the rescheduling field in the resource cluster object in the first subcluster is stored, and the first node is located in the first subcluster; The target container is migrated to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

5. The method according to claim 4, characterized in that The rescheduling field at least includes an information field; the container information of the target container and the node information of the first node are located in the information field in the rescheduling field; The rescheduling field also includes a reason field; The reason field is used to store the reason why the system resources on the node where the container is located are not successfully allocated to the container according to the actual needs of the container; The method further comprises: Determine whether the reason field has content; In a case where the reason field has content, the step of migrating the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node is performed.

6. The method according to claim 4, characterized in that The rescheduling field at least includes an information field; the container information of the target container and the node information of the first node are located in the information field in the rescheduling field; The rescheduling field also includes a duration field; The duration field is used to store the duration of failure to successfully allocate system resources on the node where the container is located to the container according to the actual needs of the container; The method further comprises: Determine whether the duration field has content; In the case where the duration field has content, determining whether a timeout check policy of the main cluster manager has been enabled; When the timeout check policy of the main cluster manager is not enabled, performing the step of migrating the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node; or, When the timeout check policy of the main cluster manager is enabled, obtaining a duration of failure to successfully allocate system resources on the first node to the target container according to actual needs of the target container; When the duration exceeds the preset tolerance duration of the main cluster manager, the step of migrating the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node is performed.

7. A container scheduling device in a cloud environment, characterized in that: A subcluster manager applied to a subcluster in a cloud data center, the device comprising: The first monitoring module is used to monitor the scheduling status of the container on each node in the sub-cluster in real time. The scheduling status of the container is used to indicate whether the system resources on the node where the container is located are successfully allocated to the container according to the actual needs of the container; The first storage module is used to store at least container information of the target container and node information of the first node in a rescheduling field in a resource cluster object in the sub-cluster when the scheduling state indicates that system resources on the first node where the target container is located are not successfully allocated to the target container according to actual needs of the target container, and the first node is located in the sub-cluster.

8. A container scheduling device in a cloud environment, characterized in that: A main cluster manager applied to a main cluster in a cloud data center, the device comprising: The second monitoring module is used to monitor in real time whether the information in the rescheduling field in the resource cluster object in each sub-cluster in the cloud data center changes; A third acquisition module is used to acquire the container information of the target container in the rescheduling field and the node information of the first node where the target container is located when the information in the rescheduling field in the resource cluster object in the first subcluster in the cloud data center changes; the container information of the target container and the node information of the first node are: when the subcluster manager in the first subcluster monitors that the system resources on the first node where the target container is located are not successfully allocated to the target container according to the actual demand of the target container, the rescheduling field in the resource cluster object in the first subcluster is stored, and the first node is located in the first subcluster; A migration module is used to migrate the target container to a node in the second subcluster in the cloud data center according to the container information of the target container and the node information of the first node.

9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the computer program, when executed by the processor, implements the container scheduling method in a cloud environment as described in any one of claims 1 to 6.

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

Citation Information

Cited By

  • Container scheduling method and apparatus in cloud environment, electronic device, and storage medium

    WO2026108923A1