Data update method and apparatus for stock pod in kubernetes, and device and medium

By using the in-place upgrade controller in Kubernetes to monitor data update events of the VPA component and dynamically adjust the resource configuration of the target Pod, the problem of inconvenient resource configuration adjustment in the existing technology is solved, and resource consistency and business continuity are achieved.

WO2024187919A1PCT designated stage expired Publication Date: 2024-09-19CHINA TELECOM CLOUD TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2023/143263
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-12-12
Filing Date
2023-12-29
Publication Date
2024-09-19

AI Technical Summary

Technical Problem

It is difficult to achieve dynamic adjustment convenience when adjusting container resource configuration with existing technology, and existing methods such as evicting, rebuilding and modifying cgroups files will lead to resource configuration inconsistency and business impact, and modifying Kubernetes source code involves risks and complexity.

Method used

By upgrading the controller in situ, it listens to the data update event of the VPA component, obtains the resource recommendation value and current data storage information of the target Pod, determines the current configuration parameters in the resource database, and overwrites the resource recommendation value with the current configuration parameters to realize the target Pod. Data updates to avoid reconstruction and resource inconsistencies.

Benefits of technology

It realizes the convenience of dynamic adjustment of container resource configuration, ensures the consistency of Pod running resources and storage resources, avoids business impact, and simplifies container resource management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2023143263_19092024_PF_FP_ABST
    Figure CN2023143263_19092024_PF_FP_ABST
Patent Text Reader

Abstract

Provided in the present application are a data update method and apparatus for a stock pod in Kubernetes, and a device and a medium. In the method, VPA components are monitored by means of an update-inplace-controller, and when it is monitored that there are data update events of a target pod in the VPA components, the current configuration parameter of the target pod that is stored in a resource database is determined according to data update information of the target pod. Therefore, the interference of multi-version information can be prevented, the consistency between operation resources and storage resources of a pod is determined, and it is ensured that an effective data update is executed on the current configuration parameter of the target pod; a resource recommendation value covers the current configuration parameter of the target pod, such that an inplace update in the resource database is realized; and there is no need to reconstruct a stock pod, such that a container service in the pod is not affected. Therefore, the dynamic adjustment convenience of container resource configuration is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Data update method, device, equipment and medium for existing Pod in Kubernetes [Corrected 31.01.2024 in accordance with Regulation 91] Technical field

[0001] [Corrected 31.01.2024 according to Rule 91] The present application relates to the field of data processing technology, and in particular to a method, apparatus, device and medium for updating data of existing Pods in Kubernetes. [Corrected 31.01.2024 according to Regulation 91] Background

[0002] [Corrected 31 January 2024, per Rule 91] Compared to the complex deployment and weak migration capabilities of traditional virtual machines, an increasing number of applications and middleware are choosing Kubernetes as their deployment and operations platform. In an environment focused on cost reduction and efficiency improvement, efficient resource utilization has become a major research topic.

[0003] [Corrected 31.01.2024 according to Rule 91] In some scenarios, it is often found that the container resources (CPU, memory) requested by the business are unreasonable. On the one hand, in order to improve performance, the business blindly sets a quota for the container that is larger than the actual demand, resulting in a waste of resources and making it impossible for the node to schedule more new containers. On the other hand, there may be a sudden increase in traffic, and the container resources are insufficiently configured, leading to performance bottlenecks or Out of Memory, frequent restarts, and service unavailability. However, it is actually difficult to determine the configuration that both meets business needs and saves resources during the container configuration stage.

[0004] [Corrected 31.01.2024 in accordance with Rule 91] For resource allocation, existing solutions based on VPA (Vertical Pod Autoscaler) technology calculate recommended resource values ​​based on historical business usage and automatically adjust pod resource quotas. However, while this existing technology can achieve this, it can also cause existing pods to be evicted, resulting in container restarts and impacting business operations.

[0005] [Corrected 31.01.2024 in accordance with Rule 91] To address the issue of dynamically adjusting container resource configuration, existing technologies typically evict existing pods and rebuild them. This rebuild process requires rescheduling, network allocation for Sanbox containers, disk mounting, and image pulling, impacting both service recovery time and the lifecycle of other containers within the same pod. While the CRI (Container Runtime Interface) currently defines methods for modifying container resources without rebuilding the pod, the API Server (the API server, which provides the cluster's external communication interface) restricts modifications to container resources for existing pods. Therefore, existing technologies implement resource restrictions directly through the CRI or by modifying the cgroups file corresponding to the container on the node. However, this approach fails to reflect the updated values ​​in the pod configuration, resulting in inconsistencies between the actual configuration and the displayed data. Alternatively, these features can be implemented by modifying the Kubernetes source code, which is tightly coupled to the source code and requires developers to have a deep understanding of the source code. This is not only difficult to implement and carries significant potential risks, but also hinders subsequent version upgrades.

[0006] [Corrected 31.01.2024 according to Rule 91] Therefore, how to solve the current poor convenience of dynamic adjustment of container resource configuration has become a technical problem that needs to be solved urgently.

[0007] [Corrected 31.01.2024 in accordance with Rule 91] Summary of the invention

[0008] [Corrected 31.01.2024 according to Rule 91] This application provides a method, device, equipment and storage medium for updating data of existing Pods in Kubernetes, aiming to improve the convenience of dynamic adjustment of container resource configuration.

[0009] [Corrected 31.01.2024 according to Rule 91] In a first aspect, the present application provides a method for updating data of existing Pods in Kubernetes, the method comprising:

[0010] [Corrected 31.01.2024 in accordance with Rule 91] When the in-place upgrade controller monitors a data update event of a target Pod of a pre-configured VPA component, obtains data update information of the target Pod, wherein the data update data includes resource recommendation values ​​and current data storage information of the target Pod;

[0011] [Corrected 31.01.2024 in accordance with Rule 91] determining, based on the current data storage information, current configuration parameters of the target Pod stored in a resource database;

[0012] [Corrected 31.01.2024 according to Rule 91] Based on the recommended resource values, the current configuration parameters are overwritten to complete the data update of the target Pod.

[0013] [Corrected 31.01.2024 according to Rule 91] In a second aspect, the present application further provides a data update device for existing Pods in Kubernetes, the data update device for existing Pods in Kubernetes comprising:

[0014] [Corrected 31.01.2024 according to Rule 91] A data update information acquisition module, configured to acquire data update information of a target Pod when the in-place upgrade controller monitors a data update event of a pre-configured VPA component, wherein the data update data includes recommended resource values ​​and current data storage information of the target Pod;

[0015] [Corrected 31.01.2024 according to Rule 91] a current configuration parameter determination module, configured to determine the current configuration parameters of the target Pod stored in a resource database based on the current data storage information;

[0016] [Corrected 31.01.2024 according to Rule 91] A data update module is used to overwrite the current configuration parameters based on the resource recommendation values ​​to complete the data update of the target Pod.

[0017] [Corrected 31.01.2024 according to Rule 91] In a third aspect, the present application also provides a computer device, comprising a processor, a memory, and a computer program stored on the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the method for updating the data of the existing Pods in Kubernetes as described above are implemented.

[0018] [Corrected 31.01.2024 according to Rule 91] In a fourth aspect, the present application also provides a computer-readable storage medium, on which a computer program is stored, wherein when the computer program is executed by a processor, the steps of the method for updating the data of the existing Pods in Kubernetes as described above are implemented.

[0019] [Corrected 31.01.2024 according to Rule 91] The present application provides a method, apparatus, device and storage medium for updating the data of existing Pods in Kubernetes. The method of the present application includes obtaining data update information of the target Pod when the in-situ upgrade controller monitors the data update event of the target Pod in the pre-configured VPA component, wherein the data update data includes the resource recommendation value and current data storage information of the target Pod; based on the current data storage information, determining the current configuration parameters of the target Pod stored in the resource database; based on the resource recommendation value, overwriting the current configuration parameters to complete the data update of the target Pod. Through the above method, the present application monitors the VPA component through the in-place upgrade controller, and when it monitors the data update event of the target Pod in the VPA component, it determines the current configuration parameters of the target Pod stored in the resource database based on the data update information of the target Pod. In this way, the interference of multiple versions of information can be avoided, the consistency of the Pod running resources and storage resources can be determined, and effective data updates can be performed on the current configuration parameters of the target Pod; the resource recommended values ​​are used to overwrite the current configuration parameters of the target Pod to realize in-place upgrades in the resource database, without the need to rebuild the existing Pod, and without affecting the container business in the Pod, thereby improving the convenience of dynamic adjustment of container resource configuration. [Corrected 31.01.2024 in accordance with Rule 91] Description of the drawings

[0020] [Corrected 31.01.2024 according to Rule 91] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0021] [Corrected 31.01.2024 according to Rule 91] FIG1 is a flowchart of a first embodiment of a method for updating data of existing Pods in Kubernetes provided by this application;

[0022] [Corrected 31.01.2024 according to Rule 91] FIG2 is a flowchart of a second embodiment of a method for updating data of existing Pods in Kubernetes provided by this application;

[0023] [Corrected 31.01.2024 according to Rule 91] FIG3 is a flowchart of a third embodiment of a method for updating data of existing Pods in Kubernetes provided by this application;

[0024] [Corrected 31.01.2024 according to Rule 91] FIG4 is a schematic diagram of the structure and data interaction of each component in a method for updating data of existing Pods in Kubernetes provided in an embodiment of the present application;

[0025] [Corrected 31.01.2024 according to Rule 91] FIG5 is a schematic structural diagram of a first embodiment of a data update device for existing Pods in Kubernetes provided by the present application;

[0026] [Corrected 31.01.2024 according to Rule 91] Figure 6 is a structural schematic block diagram of a computer device provided in an embodiment of the present application.

[0027] [Corrected 31.01.2024 according to Rule 91] The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. [Corrected 31.01.2024 according to Rule 91] Specific implementation method

[0028] [Corrected 31.01.2024 in accordance with Rule 91] The following will clearly and completely describe the technical solutions in the embodiments of this application in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments of this application, all other embodiments obtained by ordinary technicians in this field without making any creative efforts are within the scope of protection of this application.

[0029] [Corrected 31.01.2024 in accordance with Rule 91] The flowcharts shown in the accompanying drawings are illustrative only and do not necessarily include all contents and operations / steps, nor do they necessarily require execution in the order described. For example, some operations / steps may be decomposed, combined, or partially merged, so the actual execution order may vary depending on the actual situation.

[0030] [Corrected 31.01.2024 according to Rule 91] The following describes some embodiments of the present application in detail with reference to the accompanying drawings. The following embodiments and features thereof may be combined with each other unless there is a conflict.

[0031] [Corrected 31.01.2024 according to Rule 91] Please refer to Figure 1, which is a flow chart of the first embodiment of a method for updating data of existing Pods in Kubernetes provided by this application.

[0032] [Corrected 31.01.2024 according to Rule 91] As shown in FIG1 , the method for updating data of existing Pods in Kubernetes includes steps S101 to S103.

[0033] [Corrected 31.01.2024 according to Rule 91] S101. When the in-place upgrade controller monitors a data update event of a target Pod of a pre-configured VPA component, obtain data update information of the target Pod, wherein the data update data includes resource recommendation values ​​and current data storage information of the target Pod;

[0034] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the in-place upgrade controller is developed in the controller operator mode, following the Kubernetes specification, and realizes the connection with VPA and etcd.

[0035] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the update-inplace controller is primarily responsible for monitoring changes to custom objects in the VPA and maintaining the associated existing Pod data in etcd. If there is an update to the recommended values ​​and the Pod's container configuration values ​​are outside the new recommended range, the Pod's resource configuration in etcd will be modified to the recommended values.

[0036] [Corrected 31 January 2024, per Rule 91] Optionally, both VPA components and the in-place upgrade controller can be deployed using Deploymnet and started in master-elective multi-replica mode, ensuring both high availability and concurrency control. Plugin templates can be created using Helmchart for easy installation and uninstallation. Additionally, a values.yaml file can be configured to simplify configuration.

[0037] [Corrected 31 January 2024 in accordance with Rule 91] It is understood that in a Kubernetes cluster, a pod is the foundation of all business types and the smallest unit of Kubernetes management. It is a combination of one or more containers. These containers share storage, networking, and namespaces, as well as operational specifications. Within a pod, all containers are uniformly scheduled and run in a shared context. For specific applications, a pod is their logical host, containing multiple application containers related to the business.

[0038] [Corrected 31.01.2024 according to Rule 91] In one embodiment, an event filter is added to the startup manager of the controller to add only modification events of the VPA custom object (i.e., the target Pod) to the tuning queue; in the tuning method, an informer is used to monitor and cache the VPA custom object (i.e., the target Pod), and when a new update event needs to be processed, the target Pod and the data update information of the target Pod are obtained from the cache.

[0039] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.

[0040] [Corrected 31.01.2024 in accordance with Rule 91] In one embodiment, when configuring a VPA component, there is generally a one-to-one correspondence between the VPA component and the monitored object (i.e., the target Pod). That is, one VPA component monitors the resource data of one Pod, and the basis for establishing this correspondence is data such as the Pod's configuration parameters (such as the Pod's name, number, and data version number). After the VPA component is configured, the VPA component itself only monitors the target Pod's data and does not perform data modifications on the target Pod. Instead, it relies on the in-place upgrade controller to perform such operations. Therefore, after the VPA component is configured, the target Pod's data update information is synchronously sent to the in-place upgrade controller and cached on the in-place upgrade controller, allowing the in-place upgrade controller to centrally manage all VPA components and Pods.

[0041] [Corrected as of 31 January 2024 according to Rule 91] Furthermore, after obtaining the data update information of the target Pod, determine whether the target Pod's spec.updatePolicy.updateMode is Initial or Off. If not, return directly without processing; if so, determine whether there is a mapped elastically scalable load application, whether there are recommended values, etc., to deal with different situations; if there is a mapped load application, obtain the load selector based on the load mapped by the VPA, and thereby obtain all Pods associated with the load.

[0042] [Corrected 31.01.2024 according to Rule 91] S102. Determine, based on the current data storage information, current configuration parameters of the target Pod stored in a resource database;

[0043] [Corrected 31.01.2024 in accordance with Rule 91] In one embodiment, an informer can be used to monitor and cache Pods within the cluster. To avoid directly accessing etcd through the API server, the ResourceVersion value of the query condition is specified as 0, causing it to be retrieved from the API server's cache. After retrieving all Pods associated with the workload from the cache, Pods in the deleted state are filtered out. For all surviving Pods, the Pod data in etcd is updated using the recommended values.

[0044] [Corrected 31.01.2024 according to Rule 91] The API Server is a key management API layer in Kubernetes. It provides RESTful API access endpoints and persists data to the etcd server. In a Kubernetes cluster, the API Server serves as the entry point for interaction. The API Server not only interacts with etcd (other components don't directly interact with etcd; only the API Server does), but also provides a unified API call entry point.

[0045] [Corrected 31.01.2024 according to Rule 91] Further, as shown in FIG2 , step S102 specifically includes:

[0046] [Corrected 31.01.2024 according to Rule 91] S1021. Based on a preset query condition, access the resource database to obtain the storage data of the target Pod and the storage data version number corresponding to the storage data;

[0047] [Corrected 31.01.2024 according to Rule 91] In one embodiment, there are also cached Pod configuration parameters in the APIServer. When the in-place upgrade controller accesses etcd through the APIServer, the returned result may also be the Pod configuration parameters cached in the APIServer. At this time, the queried Pod configuration parameters may not be the latest configuration parameters currently used by the Pod. Therefore, before executing the configuration parameter modification of the target Pod, it is necessary to compare the data version number of the configuration parameters that need to be modified.

[0048] [Corrected 31.01.2024 according to Rule 91] S1022. Compare the stored data version number with the current data version number;

[0049] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the storage data version number is the version number of the configuration data stored by the Pod in etcd. etcd can save all configuration parameter data used by the Pod and the data version number of each configuration parameter.

[0050] [Corrected 31.01.2024 according to Rule 91] Generally, the configuration parameters currently being used by the Pod are consistent with the latest version of the Pod stored in etcd. Therefore, when the current configuration parameters of the target Pod are updated, the latest version of the target Pod stored in etcd is updated.

[0051] [Corrected 31.01.2024 according to Rule 91] However, the APIServer that etcd uses to communicate with the external environment may also cache other versions of configuration data of the target Pod. When the in-place upgrade controller accesses etcd and queries the current configuration parameters of the target Pod, the returned result may also be other versions of data cached in the APIServer. Updating this data will not affect the current configuration parameters of the target Pod. Therefore, after obtaining the query result, it is necessary to compare the stored data version number and the current data version number to ensure that the updated data object is the current configuration parameters of the target Pod that is currently running.

[0052] [Corrected 31.01.2024 according to Rule 91] S1023. When the stored data version number and the current data version number are consistent, determine that the stored data is the current configuration parameters of the target Pod.

[0053] [Corrected 31.01.2024 according to Rule 91] In one embodiment, when the stored data version number and the current data version number are consistent, the stored data corresponding to the stored data version number is the configuration parameter currently being used by the target Pod, that is, the configuration parameter that needs to be modified.

[0054] [Corrected 31.01.2024 according to Rule 91] In one embodiment, when the stored data version number and the current data version number are inconsistent, the stored data version number is not the configuration parameter currently being used by the target Pod. At this time, continue to query the current configuration parameters corresponding to the target Pod from etcd.

[0055] [Corrected 31.01.2024 according to Rule 91] S103. Based on the recommended resource values, overwrite the current configuration parameters to complete the data update of the target Pod.

[0056] [Corrected 31.01.2024 in accordance with Rule 91] In one embodiment, after obtaining all Pods associated with a load from the cache, Pods in the deleted state are filtered out. For all surviving Pods, the Pod data in etcd is updated using recommended values. First, a mutex is applied, and the Pod data in etcd is queried using the etcdClient. The ResourceVersion of the data is compared with the PodResourceVersion in the cache to ensure that the latest version in etcd is updated. The recommended value is then overwritten with the original Pod data, and the data in etcd is updated to complete the Pod data update. Finally, the lock is unlocked to complete the data update.

[0057] [Corrected 31.01.2024 according to Rule 91] A mutex is a simple locking method to control access to shared resources. A mutex has only two states: locked and unlocked. Locking a mutex as an atomic operation means that the operating system (or the pthread library) guarantees that if a thread locks a mutex, no other thread can successfully lock the mutex at the same time; if a thread locks a mutex, no other thread can lock the mutex before it unlocks it; if a thread has already locked a mutex and a second thread attempts to lock it, the second thread will be suspended (not occupying any CPU resources) until the first thread unlocks the mutex, at which point the second thread will be awakened and continue execution, while locking the mutex.

[0058] [Corrected 31.01.2024 according to Rule 91] Further, each Pod in the cluster and the VPA component corresponding to each Pod are obtained; when the in-place upgrade controller monitors that at least two VPA components trigger data update events of the corresponding Pod, based on the message queue, each data update event is cached in sequence according to the order of occurrence of the data update events; when the in-place upgrade controller obtains the data update event of the target Pod from the message queue, the data update information corresponding to the target Pod is read from the preset data cache.

[0059] [Corrected 31.01.2024 according to Rule 91] In one embodiment, a cluster includes multiple Pods, and each Pod can monitor resource data through a VPA component. Therefore, when there are multiple Pods running in the cluster at the same time, multiple VPA components can also be created to monitor the resource data of each Pod respectively. As a result, there may be multiple Pod configuration parameters that need to be adjusted, that is, there are multiple VPA components triggering Pod data update events at the same time. At this time, to ensure the orderly update of Pod data, the data update events of each Pod can be stored in a message queue according to the triggering order of each data update event. The data update events are managed through the message queue, and the in-place upgrade controller can pull the data update events in the message queue and perform data update operations on each Pod in turn.

[0060] [Corrected 31.01.2024 according to Rule 91] A message queue is a first-in, first-out queue-type data structure, effectively an internal linked list within the system kernel. Messages are inserted into the queue sequentially, with the sending process adding messages to the end of the queue and the receiving process reading messages from the head of the queue. Multiple processes can simultaneously send and receive messages from a message queue. The sending process sends messages to the end of the queue, and the receiving process reads messages from the head of the queue. Once a message is read, it is removed from the queue.

[0061] [Corrected 31.01.2024 according to Rule 91] This embodiment provides a method for updating data of existing Pods in Kubernetes. The method monitors the VPA component through an in-place upgrade controller, and when it monitors that there is a data update event of the target Pod in the VPA component, the method determines the current configuration parameters of the target Pod stored in the resource database based on the data update information of the target Pod. In this way, the interference of multiple versions of information can be avoided, the consistency of the Pod running resources and storage resources can be determined, and effective data updates can be performed on the current configuration parameters of the target Pod; the resource recommended values ​​are used to overwrite the current configuration parameters of the target Pod, so as to realize in-place upgrades in the resource database without rebuilding the existing Pods and without affecting the container business in the Pods. Therefore, the convenience of dynamic adjustment of container resource configuration is improved.

[0062] [Corrected 31.01.2024 according to Rule 91] Please refer to Figure 3, which is a flow chart of the third embodiment of the data update method for existing Pods in Kubernetes provided by this application.

[0063] [Corrected 31.01.2024 according to Rule 91] In this embodiment, based on the embodiment shown in FIG1 , the method further includes:

[0064] [Corrected 31.01.2024 according to Rule 91] S201. Obtain configuration information of the target Pod, wherein the configuration information includes a data name, a data version number, and a data storage address of the target Pod;

[0065] [Corrected 31.01.2024 according to Rule 91] In one embodiment, when configuring a VPA component, the VPA component and the monitoring object (i.e., the target Pod) generally correspond one to one, that is, one VPA component monitors the resource data of one Pod, and the basis for establishing the correspondence is based on data such as the configuration parameters of the Pod (such as the name, number, and data version number of the Pod).

[0066] [Corrected 31.01.2024 according to Rule 91] S202. Based on the configuration information, configure the VPA component, wherein the VPA component is used to monitor resource data of the target Pod.

[0067] [Corrected 31 January 2024 in accordance with Rule 91] VPA stands for Vertical Pod Autoscaler, which automatically sets CPU and memory requests based on container resource usage, allowing for proper scheduling on nodes to provide each pod with the appropriate resources. It can scale down containers that are over-requesting resources and increase capacity where resources are insufficient based on their usage.

[0068] [Corrected 31.01.2024 according to Rule 91] In one embodiment, as shown in FIG4 , the VPA components include a VPARecommender (recommendation module), a VPAupdater (update module), and a VPAAdmissionController (admission controller).

[0069] [Corrected 31.01.2024 according to Rule 91] Among them, VPARecommender is mainly responsible for obtaining historical usage from storage databases such as Prometheus (system monitoring and alarm tool) inside or outside the cluster, using relevant algorithms to calculate more reasonable recommended values ​​and recommended ranges, and updating them to the custom objects of VPA.

[0070] [Corrected 31.01.2024 according to Rule 91] The VPA updater monitors the VPA's custom resource objects and evicts pods. If the container configuration in a pod is above or below the recommended range, the pod is evicted. This step usually results in the deletion and reconstruction of existing pods. Therefore, in this solution, parameter configuration will be used to prevent the updater from performing eviction actions.

[0071] [Corrected 31.01.2024 according to Rule 91] VPAAdmissionController is responsible for checking the VPA custom resource object in the cache when a new Pod is created to see if the recommended value has been calculated for the Pod and the current container configuration is outside the recommended range. If so, the recommended value will be overwritten to overwrite the resource configuration of the original Pod.

[0072] [Corrected as of 31.01.2024 according to Rule 91] For example, the VPA component configuration process may include: creating a template in the form of a helm chart for the three parts of the VPA component and related information such as crd, webhook, rbac, and certificate; mapping key configuration items such as container startup parameters, image repository, image name, and version as variables to the chart's values.yaml file; specifying default values ​​for the above variables in the values.yaml file. For example, in order to query historical container resource usage, "---storage=prometheus" and "---prometheus-address=http: / / prometheus.default.svc.cluster.local:9090" are configured to specify the query of Prometheus and its address, and "--min-replicas=2" is configured to only evict loads with more than two replicas; when creating a custom object for VPA, configure spec.updatePolicy.updateMode to Initial or Off to achieve the purpose of only giving recommended values ​​and not evicting Pods.

[0073] [Corrected as of 31.01.2024 according to Rule 91] Furthermore, after configuring the VPA component based on the current data storage information, the method further includes: obtaining historical resource data of the target Pod, wherein the historical resource data includes resource data of the target Pod within a preset historical period; calculating the resource recommendation value and data monitoring threshold range corresponding to the target Pod based on the historical resource data; and sending the resource recommendation value and the data monitoring threshold range to the in-place upgrade controller, so as to monitor whether the VPA component has a data update event for the target Pod through the in-place upgrade controller.

[0074] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the VPA component calculates the current resource recommendation value and the data monitoring threshold range based on the historical resource data of the target Pod, and uses the data monitoring threshold range as the basis for monitoring the resource data of the target Pod.

[0075] [Corrected as of 31.01.2024 according to Rule 91] For example, historical resource data can be selected based on the calculation requirements of the resource recommendation value and the data monitoring threshold range. For example, historical resource data for seven days can be selected, and the average value of the historical resource data for the seven days can be calculated as the resource recommendation value, while the lowest value and the highest value of the resource data corresponding to the seven days can be selected, and the average value of the lowest value of the resource data for the seven days can be calculated as the lowest value of the data monitoring threshold range, and the average value of the highest value of the resource data for the seven days can be calculated as the highest value of the data monitoring threshold range.

[0076] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the resource recommendation value and the data monitoring threshold range can also be formulated according to special needs. For example, if the historical resource data shows that the load of the target Pod is significantly different on weekends and during the week, the corresponding resource recommendation value and data monitoring threshold range can be calculated separately for the mid-week and weekends.

[0077] [Corrected as of 31.01.2024 according to Rule 91] Further, based on the VPA component, the current resource data of the target Pod is monitored; when the current resource data exceeds the data monitoring threshold range, a data update event of the target Pod is triggered.

[0078] [Corrected 31.01.2024 according to Rule 91] In one embodiment, after the VPA component is configured, the current resource data of the target Pod can be monitored in real time through the VPA component. When it is monitored that the current resource data of the target Pod exceeds the data monitoring threshold range, that is, is less than the lowest value of the data monitoring threshold range or is greater than the highest value of the data monitoring threshold range, a data update event of the target Pod can be triggered.

[0079] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the detection of the target Pod's current resource data exceeding the data monitoring threshold may be occasional, and therefore, a duration or frequency of the exceedance may be set. A timer starts when the target Pod's current resource data exceeds the data monitoring threshold, and when the timer reaches a preset duration, a target Pod data update event is triggered; or when the target Pod's current resource data exceeds the data monitoring threshold a preset frequency is reached, a target Pod data update event is triggered.

[0080] [Corrected 31.01.2024 in accordance with Rule 91] Please refer to Figure 5, which is a schematic diagram of the structure of a first embodiment of a device for updating data of existing Pods in Kubernetes provided by this application. The device for updating data of existing Pods in Kubernetes is used to execute the aforementioned method for updating data of existing Pods in Kubernetes. The device for updating data of existing Pods in Kubernetes can be configured in a server.

[0081] [Corrected 31.01.2024 according to Rule 91] As shown in Figure 5, the data update device 300 for existing Pods in Kubernetes includes: a data update information acquisition module 301, a current configuration parameter determination module 302 and a data update module 303.

[0082] [Corrected 31.01.2024 according to Rule 91] A data update information acquisition module 301 is configured to acquire data update information of a target Pod when the in-place upgrade controller monitors a data update event of a pre-configured VPA component, wherein the data update data includes resource recommendation values ​​and current data storage information of the target Pod;

[0083] [Corrected 31.01.2024 according to Rule 91] A current configuration parameter determination module 302 is configured to determine the current configuration parameters of the target Pod stored in a resource database based on the current data storage information;

[0084] [Corrected 31.01.2024 according to Rule 91] The data update module 303 is used to overwrite the data of the current configuration parameters based on the resource recommendation value to complete the data update of the target Pod.

[0085] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the data updating device 300 for the existing Pod in Kubernetes also includes a VPA component configuration module, which is used to obtain configuration information of the target Pod, wherein the configuration information includes the data name, data version number and data storage address of the target Pod; based on the configuration information, the VPA component is configured, wherein the VPA component is used to monitor the resource data of the target Pod.

[0086] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the VPA component configuration module is further used to obtain historical resource data of the target Pod, wherein the historical resource data includes resource data of the target Pod within a preset historical period; based on the historical resource data, calculate the resource recommendation value and data monitoring threshold range corresponding to the target Pod; send the resource recommendation value and the data monitoring threshold range to the in-place upgrade controller, so that the VPA component can monitor whether there is a data update event of the target Pod through the in-place upgrade controller.

[0087] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the data update device 300 for the existing Pod in Kubernetes also includes a data monitoring module for monitoring the current resource data of the target Pod based on the VPA component; when the current resource data exceeds the data monitoring threshold range, triggering a data update event of the target Pod.

[0088] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.

[0089] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the current configuration parameter determination module 302 is further used to access the resource database based on preset query conditions, obtain the storage data of the target Pod and the storage data version number corresponding to the storage data; compare the storage data version number with the current data version number; and when the storage data version number and the current data version number are consistent, determine that the storage data is the current configuration parameter of the target Pod.

[0090] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the data update information acquisition module 301 is further used to obtain each Pod in the cluster and the VPA component corresponding to each Pod; when the in-place upgrade controller monitors at least two of the VPA components triggering the data update events of the corresponding Pod, based on the message queue, each of the data update events is cached in sequence according to the order of occurrence of the data update events; when the in-place upgrade controller obtains the data update event of the target Pod from the message queue, it reads the data update information corresponding to the target Pod from a preset data cache.

[0091] [Corrected 31.01.2024 according to Rule 91] It should be noted that, those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described devices and modules can refer to the corresponding processes in the aforementioned embodiment of the method for updating the data of existing Pods in Kubernetes, and will not be repeated here.

[0092] [Corrected 31.01.2024 according to Rule 91] The apparatus provided in the above embodiment may be implemented in the form of a computer program, which may be run on a computer device as shown in FIG6 .

[0093] [Corrected 31.01.2024 according to Rule 91] Please refer to Figure 6, which is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application. The computer device may be a server.

[0094] [Corrected 31.01.2024 according to Rule 91] Referring to FIG6 , the computer device includes a processor, a memory, and a network interface connected via a system bus, wherein the memory may include a non-volatile storage medium and an internal memory.

[0095] [Corrected as of January 31, 2024, in accordance with Rule 91] The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any method for updating data of existing Pods in Kubernetes.

[0096] [Corrected 31.01.2024 according to Rule 91] The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.

[0097] [Corrected 31.01.2024 in accordance with Rule 91] The internal memory provides an environment for the operation of a computer program in a non-volatile storage medium, which, when executed by a processor, enables the processor to execute any method for updating data of existing Pods in Kubernetes.

[0098] [Corrected 31.01.2024 according to Rule 91] The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will understand that the structure shown in FIG6 is merely a block diagram of a portion of the structure related to the present application solution, and does not constitute a limitation on the computer device to which the present application solution is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.

[0099] [Corrected 31.01.2024 according to Rule 91] It should be understood that the processor may be a central processing unit (CPU), and the processor may also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.

[0100] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the processor is configured to execute a computer program stored in the memory to implement the following steps:

[0101] [Corrected 31.01.2024 in accordance with Rule 91] When the in-place upgrade controller monitors a data update event of a target Pod of a pre-configured VPA component, obtains data update information of the target Pod, wherein the data update data includes resource recommendation values ​​and current data storage information of the target Pod;

[0102] [Corrected 31.01.2024 in accordance with Rule 91] determining, based on the current data storage information, current configuration parameters of the target Pod stored in a resource database;

[0103] [Corrected 31.01.2024 according to Rule 91] Based on the recommended resource values, the current configuration parameters are overwritten to complete the data update of the target Pod.

[0104] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the processor is configured to execute a computer program stored in the memory and further implement the following steps:

[0105] [Corrected 31.01.2024 in accordance with Rule 91] Obtain configuration information of the target Pod, wherein the configuration information includes a data name, a data version number, and a data storage address of the target Pod;

[0106] [Corrected 31.01.2024 in accordance with Rule 91] Based on the configuration information, configure the VPA component, wherein the VPA component is used to monitor resource data of the target Pod.

[0107] [Corrected 31.01.2024 according to Rule 91] In one embodiment, after configuring the VPA component based on the current data storage information, the processor is further configured to:

[0108] [Corrected 31.01.2024 in accordance with Rule 91] obtaining historical resource data of the target Pod, wherein the historical resource data includes resource data of the target Pod within a preset historical period;

[0109] [Corrected 31.01.2024 in accordance with Rule 91] Calculate the resource recommendation value and data monitoring threshold range corresponding to the target Pod based on the historical resource data;

[0110] [Corrected 31.01.2024 in accordance with Rule 91] The resource recommendation value and the data monitoring threshold range are sent to the in-place upgrade controller, so that the VPA component can monitor whether there is a data update event of the target Pod through the in-place upgrade controller.

[0111] [Corrected 31.01.2024 according to Rule 91] In one embodiment, after calculating the resource recommendation value and data monitoring threshold range corresponding to the target Pod based on the historical resource data, the processor is further configured to:

[0112] [Corrected 31.01.2024 according to Rule 91] Based on the VPA component, monitor the current resource data of the target Pod;

[0113] [Corrected 31.01.2024 according to Rule 91] When the current resource data exceeds the data monitoring threshold range, a data update event of the target Pod is triggered.

[0114] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.

[0115] [Corrected 31.01.2024 according to Rule 91] In one embodiment, the processor, when implementing the determining the current configuration parameters of the target Pod stored in the resource database based on the current data storage information, is configured to implement:

[0116] [Corrected 31.01.2024 in accordance with Rule 91] Based on a preset query condition, access the resource database to obtain the storage data of the target Pod and a storage data version number corresponding to the storage data;

[0117] [Corrected 31.01.2024 in accordance with Rule 91] compare the version number of the stored data with the version number of the current data;

[0118] [Corrected 31.01.2024 according to Rule 91] When the stored data version number and the current data version number are consistent, it is determined that the stored data is the current configuration parameters of the target Pod.

[0119] [Corrected 31.01.2024 according to Rule 91] In one embodiment, when the in-place upgrade controller monitors the data update event of the target Pod of the pre-configured VPA component, the processor obtains the data update information of the target Pod, and is configured to implement:

[0120] [Corrected 31.01.2024 in accordance with Rule 91] Obtain each Pod in the cluster and the VPA component corresponding to each Pod;

[0121] [Corrected 31.01.2024 according to Rule 91] When the in-place upgrade controller monitors data update events of the corresponding Pods triggered by at least two of the VPA components, the in-place upgrade controller sequentially caches the data update events in the order in which the data update events occur based on the message queue;

[0122] [Corrected 31.01.2024 according to Rule 91] When the in-place upgrade controller obtains the data update event of the target Pod from the message queue, it reads the data update information corresponding to the target Pod from the preset data buffer.

[0123] [Corrected 31.01.2024 according to Rule 91] A computer-readable storage medium is also provided in an embodiment of the present application, wherein the computer-readable storage medium stores a computer program, wherein the computer program includes program instructions, and the processor executes the program instructions to implement any method for updating data of existing Pods in Kubernetes provided in the embodiments of the present application.

[0124] [Corrected 31.01.2024 in accordance with Rule 91] The computer-readable storage medium may be an internal storage unit of the computer device described in the preceding embodiments, such as a hard disk or memory of the computer device. The computer-readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, or a Flash Card equipped with the computer device.

[0125] [Corrected 31.01.2024 in accordance with Rule 91] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in this application, and such modifications or substitutions should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for updating data of existing Pods in Kubernetes, characterized in that: The method comprises: When the in-place upgrade controller monitors the data update event of the target Pod of the pre-configured VPA component, the data update information of the target Pod is obtained, wherein the data update data includes the resource recommendation value and current data storage information of the target Pod; Based on the current data storage information, determine the current configuration parameters of the target Pod stored in the resource database; Based on the resource recommendation value, the current configuration parameter is overwritten to complete the data update of the target Pod.

2. The method for updating the data of existing Pods in Kubernetes according to claim 1, characterized in that: The method further comprises: Obtain configuration information of the target Pod, wherein the configuration information includes a data name, a data version number, and a data storage address of the target Pod; Based on the configuration information, the VPA component is configured, wherein the VPA component is used to monitor resource data of the target Pod.

3. The method for updating the data of existing Pods in Kubernetes according to claim 2, characterized in that: After configuring the VPA component based on the current data storage information, the method further includes: Obtaining historical resource data of the target Pod, wherein the historical resource data includes resource data of the target Pod within a preset historical period; Based on the historical resource data, calculate the resource recommendation value and data monitoring threshold range corresponding to the target Pod; The resource recommendation value and the data monitoring threshold range are sent to the in-place upgrade controller, so that the in-place upgrade controller monitors whether the VPA component has a data update event of the target Pod.

4. The method for updating the data of the existing Pod in Kubernetes according to claim 3 is characterized in that: After calculating the resource recommendation value and data monitoring threshold range corresponding to the target Pod based on the historical resource data, the method further includes: Based on the VPA component, monitor the current resource data of the target Pod; When the current resource data exceeds the data monitoring threshold range, a data update event of the target Pod is triggered.

5. The method for updating the data of existing Pods in Kubernetes according to claim 1, characterized in that: The current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.

6. The method for updating the data of the existing Pod in Kubernetes according to claim 5, characterized in that: The determining, based on the current data storage information, current configuration parameters of the target Pod stored in the resource database includes: Based on the preset query conditions, access the resource database to obtain the storage data of the target Pod and the storage data version number corresponding to the storage data; Comparing the stored data version number with the current data version number; When the stored data version number is consistent with the current data version number, it is determined that the stored data is the current configuration parameter of the target Pod.

7. The method for updating the data of existing Pods in Kubernetes according to any one of claims 1 to 6, characterized in that: When the in-place upgrade controller monitors the data update event of the target Pod of the pre-configured VPA component, the data update information of the target Pod is obtained, including: Obtain each Pod in the cluster and the VPA component corresponding to each Pod; When the in-place upgrade controller monitors data update events of the corresponding Pods triggered by at least two of the VPA components, the data update events are cached in sequence based on the message queue and in the order in which the data update events occur; When the in-place upgrade controller obtains the data update event of the target Pod from the message queue, it reads the data update information corresponding to the target Pod from a preset data buffer.

8. A data update device for existing Pods in Kubernetes, characterized in that: The data updating device of the existing Pod in the Kubernetes includes: A data update information acquisition module is used to acquire data update information of a target Pod when the in-place upgrade controller monitors a data update event of a pre-configured VPA component, wherein the data update data includes a resource recommendation value and current data storage information of the target Pod; A current configuration parameter determination module, used to determine the current configuration parameters of the target Pod stored in the resource database based on the current data storage information; A data update module is used to overwrite the current configuration parameters based on the resource recommendation value to complete the data update of the target Pod.

9. A computer device, characterized in that: The computer device includes a processor, a memory, and a computer program stored in the memory and executable by the processor, wherein when the computer program is executed by the processor, the steps of the method for updating data of existing Pods in Kubernetes according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, wherein when the computer program is executed by the processor, the steps of the method for updating data of existing Pods in Kubernetes according to any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Business data processing method and system, server and readable storage medium

    CN112100152A

  • Kubernetes cluster resource dynamic adjustment method and electronic equipment

    CN113971066A

  • CPU resource scaling control method and device, equipment and storage medium

    CN114461394A

  • Method for dynamic resources allocation and apparatus for implementing the same

    US20220357995A1

  • Edge node with datapath split between pods

    US20230028922A1