[go: up one dir, main page]

WO2024187919A1 - Data update method and apparatus for stock pod in kubernetes, and device and medium - Google Patents

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

Info

Publication number
WO2024187919A1
WO2024187919A1 PCT/CN2023/143263 CN2023143263W WO2024187919A1 WO 2024187919 A1 WO2024187919 A1 WO 2024187919A1 CN 2023143263 W CN2023143263 W CN 2023143263W WO 2024187919 A1 WO2024187919 A1 WO 2024187919A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
pod
target pod
resource
current
Prior art date
Application number
PCT/CN2023/143263
Other languages
French (fr)
Chinese (zh)
Inventor
望世杰
Original Assignee
天翼云科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 天翼云科技有限公司 filed Critical 天翼云科技有限公司
Publication of WO2024187919A1 publication Critical patent/WO2024187919A1/en

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3003Monitoring arrangements specially adapted to the computing system or computing system component being monitored
    • G06F11/302Monitoring arrangements specially adapted to the computing system or computing system component being monitored where the computing system component is a software system
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Definitions

  • the present application relates to the field of data processing technology, and in particular to a method, device, equipment and medium for updating data of existing Pods in Kubernetes.
  • the existing technology is a solution based on VPA (Vertical Pod Autoscaler) technology, which calculates the recommended resource value based on the resources actually used in the business history and automatically adjusts the Pod resource quota.
  • VPA Very Pod Autoscaler
  • the existing technology can achieve the above functions, it will evict the existing Pods and cause the containers to restart, which will affect the business.
  • the present 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.
  • the present application provides a method for updating data of existing Pods in Kubernetes, the method comprising:
  • 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;
  • the present application further provides a data updating device for existing Pods in Kubernetes, wherein the data updating device for existing Pods in Kubernetes comprises:
  • 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.
  • the present application also provides a computer device, comprising 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 as described above are implemented.
  • 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 data of existing Pods in Kubernetes as described above are implemented.
  • the present application provides a method, device, equipment and storage medium for updating the data of the existing Pod in Kubernetes.
  • the method of the present application includes obtaining the data update information of the target Pod when the in-place 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, the current configuration parameters of the target Pod stored in the resource database are determined; based on the resource recommendation value, the current configuration parameters are overwritten to complete the data update of the target Pod.
  • the present application monitors the VPA component through the in-place upgrade controller, and when the VPA component monitors the data update event of the target Pod, the current configuration parameters of the target Pod stored in the resource database are determined according to the data update information of the target Pod, thereby avoiding the interference of multiple versions of information, determining the consistency of the Pod running resources and storage resources, and ensuring the effective data update of the current configuration parameters of the target Pod; the resource recommendation value is overwritten with the current configuration parameters of the target Pod, realizing the in-place upgrade in the resource database, and there is no need to rebuild the existing Pod, and does not affect the container business in the Pod, thereby improving the convenience of dynamic adjustment of container resource configuration.
  • FIG1 is a flow chart of a first embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application;
  • FIG2 is a flow chart of a second embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application;
  • FIG3 is a flow chart of a third embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application;
  • 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;
  • FIG5 is a schematic diagram of the structure of a first embodiment of a device for updating data of existing Pods in Kubernetes provided by the present application;
  • FIG6 is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
  • Figure 1 is a flow chart of a first embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application.
  • the method for updating data of existing Pods in Kubernetes includes steps S101 to S103 .
  • the in-place upgrade controller is developed in the mode of controller operator, following the Kubernetes specification, and realizes the connection with VPA and etcd.
  • the update-inplace-controller is mainly responsible for monitoring the custom object changes of the VPA and maintaining the data of the associated stock Pod in etcd. If there is an update to the recommended value and the container configuration value of the Pod is outside the new recommended range, the resource configuration of the Pod in etcd will be modified to the recommended value.
  • both the VPA component and the in-place upgrade controller can be deployed in Deploymnet mode and started in master-select mode with multiple copies, which can ensure high availability and achieve concurrency control.
  • Pod is the basis of all business types and the smallest unit level of K8S management. It is a combination of one or more containers. These containers share storage, network, and namespace, as well as specifications for how to run. In a Pod, all containers are arranged and scheduled in the same way and run in a shared context. For specific applications, Pod is their logical host, and Pod contains multiple application containers related to the business.
  • an event filter is added to the startup manager of the controller, and only the modification events of the VPA custom object (i.e., the target Pod) are added 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 there is a new update event that needs to be processed, the target Pod and the data update information of the target Pod are obtained from the cache.
  • the current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.
  • the VPA component and the monitoring object are generally one-to-one corresponding, that is, one VPA component monitors the resource data of one Pod, and the basis for establishing the corresponding relationship is based on the configuration parameters of the Pod (such as the name, number, and data version number of the Pod).
  • the VPA component itself only monitors the data of the target Pod, but does not perform data modification operations on the target Pod, but relies on the in-place upgrade controller to perform the operation. Therefore, after the VPA component is configured, the data update information of the target Pod is synchronously sent to the in-place upgrade controller and cached on the in-place upgrade controller side, so that the in-place upgrade controller can uniformly manage each VPA component and Pod.
  • informer can be used to monitor and cache Pods in the cluster.
  • the ResourceVersion value of the query condition is specified to be 0, so that it is obtained from the cache of APIServer.
  • filter out Pods in the deleted state After all surviving Pods, use the recommended value to update the Pod data in etcd.
  • APIServer is an important management API layer of K8s. It is responsible for providing restfulapi access endpoints and persisting data to etcdserver. In the Kubernetes cluster, APIServer plays the role of interaction entry. APIServer is not only responsible for interacting with etcd (other components will not directly operate etcd, only APIServer does so), but also provides a unified API call entry to the outside world.
  • the step S102 specifically includes:
  • the returned result may also be the Pod configuration parameters cached in the APIServer.
  • 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 numbers of the configuration parameters that need to be modified.
  • 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.
  • the APIServer that etcd uses to communicate with the external environment may also cache other versions of configuration data of the target Pod.
  • 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 results, it is necessary to compare the stored data version number with the current data version number to ensure that the updated data object is the current configuration parameters that the target Pod is currently running.
  • 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.
  • the Pods in the deleted state are filtered out.
  • the recommended values are used to update the Pod data in etcd; first, a mutex is added, and the Pod data in etcd is queried through etcdClient, and the ResourceVersion of the data is compared with the PodResourceVersion in the cache to ensure that the latest version in etcd is updated, and then the recommended value is used to overwrite the original Pod data, and the Pod data is updated in etcd to complete the update, and finally the lock is unlocked to complete the data update.
  • a mutex is a simple locking method to control access to shared resources.
  • a mutex has only two states, namely locked and unlocked.
  • Locking a mutex as an atomic operation means that the operating system (or 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 tries to lock the mutex, the second thread will be suspended (without occupying any CPU resources) until the first thread unlocks the mutex, and the second thread is awakened and continues to execute, while locking the mutex.
  • each Pod in the cluster and the VPA component corresponding to each Pod are obtained; when the in-place upgrade controller monitors data update events of the corresponding Pod triggered by at least two of the VPA components, based on the message queue, each of the data update events is cached in sequence according to 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, the data update information corresponding to the target Pod is read from a preset data buffer.
  • 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 be created to monitor the resource data of each Pod respectively. Therefore, 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.
  • the data update events of each Pod can be stored in a message queue according to the triggering order of each data update event, and the data update events can be managed through the message queue.
  • 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.
  • the message queue is a first-in-first-out queue data structure, which is actually an internal linked list in the system kernel. Messages are inserted into the queue sequentially, where the sending process adds the message to the end of the queue and the receiving process reads the message from the head of the queue. Multiple processes can send messages to a message queue at the same time, and can also receive messages from a message queue at the same time. The sending process sends the message to the end of the queue, and the receiving process reads the message from the head of the message queue. Once the message is read out, it is deleted from the queue.
  • 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 a data update event of a target Pod is detected in the VPA component, the current configuration parameters of the target Pod stored in the resource database are determined according to the data update information of the target Pod.
  • Figure 3 is a flowchart of a third embodiment of a method for updating data of existing Pods in Kubernetes provided by this application.
  • the method further includes:
  • the VPA component and the monitoring object are generally in one-to-one correspondence, that is, one VPA component monitors the resource data of one Pod, and the basis for establishing the corresponding relationship is based on the configuration parameters of the Pod (such as the name, number, and data version number of the Pod) and other data.
  • VPA VerticalPodAutoscaler, which means vertical Pod auto-scaling. It can automatically set the CPU and memory request values according to the container resource usage, allowing proper scheduling on the node to provide appropriate resources for each Pod. It can reduce the size of containers that request excessive resources, and can also increase the capacity of insufficient resources at any time according to their usage.
  • the VPA components include a VPARecommender (recommendation module), a VPAupdater (update module), and a VPAAdmissionController (admission controller).
  • 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 VPA's custom objects.
  • VPAupdater is responsible for monitoring VPA's custom resource objects and evicting Pods. If the container configuration in the Pod is higher or lower than the recommended range, the Pod will be evicted. Usually this step will lead to the deletion and reconstruction of the existing Pods. Therefore, in this solution, the updater will not perform the evicting action through parameter configuration.
  • VPAAdmissionController is responsible for querying the VPA custom resource object in the cache when a new Pod is created to see whether 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.
  • the VPA component configuration process may include: creating a template in the form of helmchart for the three parts of the VPA component and related information such as crd, webhook, rbac, certificate, etc.; mapping key configuration items such as container startup parameters, image warehouse, image name and version as variables to the values.yaml file of the chart; specifying default values for the above variables in the values.yaml file.
  • 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 recommended resource value and data monitoring threshold range corresponding to the target Pod based on the historical resource data; and sending the recommended resource 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 of the target Pod through the in-place upgrade controller.
  • 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 a basis for monitoring the resource data of the target Pod.
  • 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 seven-day historical resource data can be calculated as the resource recommendation value, and the minimum value and maximum value of the resource data corresponding to the seven days can be selected, and the average value of the minimum value of the seven-day resource data can be calculated as the minimum value of the data monitoring threshold range, and the average value of the maximum value of the seven-day resource data can be calculated as the maximum value of the data monitoring threshold range.
  • 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 greatly different on weekends and midweek, then the corresponding resource recommendation value and data monitoring threshold range can be calculated for midweek and weekends respectively.
  • the current resource data of the target Pod can be monitored in real time through the VPA component.
  • the data monitoring threshold range that is, it is less than the lowest value of the data monitoring threshold range or greater than the highest value of the data monitoring threshold range
  • a data update event of the target Pod can be triggered.
  • the current resource data of the target Pod that is monitored to exceed the data monitoring threshold range may be occasional, so the duration or frequency of the excess can be set.
  • the timing starts, and when the timing reaches the preset duration, the data update event of the target Pod is triggered; or when the number of times the current resource data of the target Pod is monitored to exceed the data monitoring threshold range reaches the preset frequency, the data update event of the target Pod is triggered.
  • Figure 5 is a schematic diagram of the structure of a first embodiment of a data update device for existing Pods in Kubernetes provided by the present application, wherein the data update device for existing Pods in Kubernetes is used to execute the aforementioned data update method for existing Pods in Kubernetes.
  • the data update device for existing Pods in Kubernetes can be configured in a server.
  • the data updating 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 .
  • the data update information acquisition module 301 is used to acquire the data update information of the target Pod when the in-place upgrade controller monitors the data update event of the pre-configured VPA component, wherein the data update data includes the resource recommendation value and current data storage information of the target Pod;
  • a current configuration parameter determination module 302 configured to determine the current configuration parameters of the target Pod stored in the resource database based on the current data storage information
  • the data updating module 303 is used to overwrite the current configuration parameters based on the resource recommendation value to complete the data update of the target Pod.
  • the data update device 300 for existing Pods 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.
  • 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.
  • 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 as to monitor whether the VPA component has a data update event of the target Pod through the in-place upgrade controller.
  • the data update device 300 for existing Pods in Kubernetes also includes a data monitoring module, which is used to monitor the current resource data of the target Pod based on the VPA component; when the current resource data exceeds the data monitoring threshold range, trigger a data update event of the target Pod.
  • a data monitoring module which is used to monitor the current resource data of the target Pod based on the VPA component; when the current resource data exceeds the data monitoring threshold range, trigger a data update event of the target Pod.
  • the current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.
  • the current configuration parameter determination module 302 is also 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.
  • the data update information acquisition module 301 is also 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 corresponding Pod's data update events, based on the message queue, in the order of occurrence of the data update events, each of the data update events is cached in sequence; 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 a preset data buffer.
  • the apparatus provided in the above embodiment may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in FIG. 6 .
  • Figure 6 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.
  • 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.
  • the non-volatile storage medium can store an operating system and a computer program.
  • the computer program includes program instructions, and when the program instructions are executed, the processor can execute any method for updating the data of the existing Pod in Kubernetes.
  • the processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
  • the internal memory provides an environment for the operation of the computer program in the non-volatile storage medium.
  • the processor can execute any method for updating the data of the existing Pod in Kubernetes.
  • the network interface is used for network communication, such as sending assigned tasks, etc.
  • the network interface is used for network communication, such as sending assigned tasks, etc.
  • FIG6 is only a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied.
  • the specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
  • the processor may be a central processing unit (CPU), or 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.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
  • the processor is used to run a computer program stored in the memory to implement the following steps:
  • 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;
  • the processor is used to run a computer program stored in the memory, and can also implement the following steps:
  • the VPA component is configured, wherein the VPA component is used to monitor resource data of the target Pod.
  • the processor is further configured to implement:
  • the processor calculates the resource recommendation value and the data monitoring threshold range corresponding to the target Pod based on the historical resource data, it is further configured to implement:
  • the current data storage information includes the data name, data storage address and current data version number of the current configuration parameter.
  • the processor when the processor implements the determination of the current configuration parameters of the target Pod stored in the resource database based on the current data storage information, it is configured to implement:
  • the processor acquires the data update information of the target Pod, and is used to implement:
  • 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.
  • a computer-readable storage medium is also provided in an embodiment of the present application.
  • the computer-readable storage medium stores a computer program.
  • the computer program includes program instructions.
  • the processor executes the program instructions to implement any method for updating data of existing Pods in Kubernetes provided in an embodiment of the present application.
  • the computer-readable storage medium may be an internal storage unit of the computer device described in the above embodiment, 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 memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the computer device.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Software Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Computing Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Mathematical Physics (AREA)
  • Quality & Reliability (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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.

Description

Kubernetes中存量Pod的数据更新方法、装置、设备及介质Data update method, device, equipment and medium for existing Pod in Kubernetes [根据细则91更正 31.01.2024]技术领域[Corrected 31.01.2024 in accordance with Article 91] Technical field
[根据细则91更正 31.01.2024]本申请涉及数据处理技术领域,尤其涉及一种Kubernetes中存量Pod的数据更新方法、装置、设备及介质。[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, device, equipment and medium for updating data of existing Pods in Kubernetes.
[根据细则91更正 31.01.2024]背景技术[Corrected 31.01.2024 in accordance with Article 91] Background technology
[根据细则91更正 31.01.2024]相比于传统虚拟机复杂的部署、薄弱的迁移能力等缺点,越来越多的应用和中间件选择Kubernetes作为部署、运维的平台。在强调降本增效的大环境下,如何高效利用资源成为当前研究的主题。[Corrected 31.01.2024 according to rule 91] Compared with the complex deployment and weak migration capabilities of traditional virtual machines, more and more applications and middleware choose Kubernetes as a platform for deployment and operation and maintenance. In an environment that emphasizes cost reduction and efficiency improvement, how to efficiently use resources has become a current research topic.
[根据细则91更正 31.01.2024]
在一些场景中,经常发现业务申请的容器资源(CPU、内存)存在不合理的现象,一方面是业务为了提高性能表现盲目给容器设置比实际需求偏大的配额,造成了资源的浪费,使得节点无法调度更多新的容器。另一方面,可能出现突增的流量,而容器资源配置不足,导致出现性能瓶颈或OutofMemery而频繁重启,造成服务不可用。但实际上很难在配置容器的阶段就确定既能满足业务需求又节约资源的配置。
[Corrected 31.01.2024 in accordance with Article 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 insufficient container resource configuration, resulting in performance bottlenecks or Out of Memory and frequent restarts, causing service unavailability. However, it is actually difficult to determine the configuration that can both meet business needs and save resources during the container configuration stage.
[根据细则91更正 31.01.2024]
针对资源配置,现有技术是基于VPA(VerticalPodAutoscaler,垂直Pod弹性伸缩)技术的解决方案,该方案基于业务历史真实使用的资源计算资源推荐值,并自动调整Pod资源配额。然而现有技术虽然能实现上述的功能,但会对存量Pod进行驱逐造成容器重启,进而影响业务。
[Corrected 31.01.2024 in accordance with Article 91]
For resource allocation, the existing technology is a solution based on VPA (Vertical Pod Autoscaler) technology, which calculates the recommended resource value based on the resources actually used in the business history and automatically adjusts the Pod resource quota. However, although the existing technology can achieve the above functions, it will evict the existing Pods and cause the containers to restart, which will affect the business.
[根据细则91更正 31.01.2024]
为了解决动态调整容器资源配置的问题,现有技术中,针对存量Pod,会采用驱逐的方式使其重建,而在重建过程中,需执行重新调度、Sanbox容器的网络分配、挂载磁盘、镜像拉取等操作,这会影响业务服务恢复的时间与同一Pod内其他容器的生命周期。目前虽然CRI(容器运行时接口)中有定义修改容器资源且不重建Pod的方法。但APIServer(API服务器,提供集群对外的通信接口)限制存量Pod的容器资源的修改。因此,现有技术中是直接通过CRI或修改节点上该容器对应的cgroups文件,来实现资源的限制,但这种方式无法将更新后的值体现在Pod的配置上,会造成实际使用配置跟展示数据不一致的问题。或者是基于修改Kubernetes源码实现上述功能,这将强耦合源码,也需要开发者对源码有很深的了解,不仅实现难度高、潜在风险大,还不利于后续的版本升级。
[Corrected 31.01.2024 in accordance with Article 91]
In order to solve the problem of dynamically adjusting container resource configuration, in the prior art, for existing Pods, the method of expulsion is used to rebuild them. During the reconstruction process, operations such as rescheduling, network allocation of Sanbox containers, mounting disks, and image pulling need to be performed, which will affect the time of business service recovery and the life cycle of other containers in the same Pod. Although there is a method defined in CRI (Container Runtime Interface) to modify container resources without rebuilding Pods. However, APIServer (API server, providing a communication interface for the cluster to the outside) restricts the modification of container resources of existing Pods. Therefore, in the prior art, resource restrictions are implemented directly through CRI or by modifying the cgroups file corresponding to the container on the node, but this method cannot reflect the updated value in the configuration of the Pod, which will cause the problem of inconsistency between the actual configuration and the displayed data. Or the above functions are implemented based on modifying the Kubernetes source code, which will strongly couple the source code and require developers to have a deep understanding of the source code. Not only is it difficult to implement and has great potential risks, it is also not conducive to subsequent version upgrades.
[根据细则91更正 31.01.2024]
因此,如何解决目前容器资源配置的动态调整便捷性差成为亟待解决的技术问题。
[Corrected 31.01.2024 in accordance with Article 91]
Therefore, how to solve the current problem of poor convenience in dynamic adjustment of container resource configuration has become a technical problem that needs to be solved urgently.
[根据细则91更正 31.01.2024]发明内容[Corrected 31.01.2024 in accordance with Rule 91] Summary of the invention
[根据细则91更正 31.01.2024]
本申请提供了一种Kubernetes中存量Pod的数据更新方法、装置、设备及存储介质,旨在提高容器资源配置的动态调整便捷性。
[Corrected 31.01.2024 in accordance with Article 91]
The present 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.
[根据细则91更正 31.01.2024]
第一方面,本申请提供一种Kubernetes中存量Pod的数据更新方法,所述方法包括:
[Corrected 31.01.2024 in accordance with Article 91]
In a first aspect, the present application provides a method for updating data of existing Pods in Kubernetes, the method comprising:
[根据细则91更正 31.01.2024]
在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;
[Corrected 31.01.2024 in accordance with Article 91]
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;
[根据细则91更正 31.01.2024]
基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;
[Corrected 31.01.2024 in accordance with Article 91]
Based on the current data storage information, determine the current configuration parameters of the target Pod stored in the resource database;
[根据细则91更正 31.01.2024]
基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。
[Corrected 31.01.2024 in accordance with Article 91]
Based on the resource recommendation value, the current configuration parameter is overwritten to complete the data update of the target Pod.
[根据细则91更正 31.01.2024]
第二方面,本申请还提供一种Kubernetes中存量Pod的数据更新装置,所述Kubernetes中存量Pod的数据更新装置包括:
[Corrected 31.01.2024 in accordance with Article 91]
In a second aspect, the present application further provides a data updating device for existing Pods in Kubernetes, wherein the data updating device for existing Pods in Kubernetes comprises:
[根据细则91更正 31.01.2024]
数据更新信息获取模块,用于在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;
[Corrected 31.01.2024 in accordance with Article 91]
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;
[根据细则91更正 31.01.2024]
当前配置参数确定模块,用于基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;
[Corrected 31.01.2024 in accordance with Article 91]
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;
[根据细则91更正 31.01.2024]
数据更新模块,用于基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。
[Corrected 31.01.2024 in accordance with Article 91]
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.
[根据细则91更正 31.01.2024]
第三方面,本申请还提供一种计算机设备,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如上述的Kubernetes中存量Pod的数据更新方法的步骤。
[Corrected 31.01.2024 in accordance with Article 91]
In a third aspect, the present application also provides a computer device, comprising 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 as described above are implemented.
[根据细则91更正 31.01.2024]
第四方面,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如上述的Kubernetes中存量Pod的数据更新方法的步骤。
[Corrected 31.01.2024 in accordance with Article 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 data of existing Pods in Kubernetes as described above are implemented.
[根据细则91更正 31.01.2024]
本申请提供一种Kubernetes中存量Pod的数据更新方法、装置、设备及存储介质,本申请方法包括在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。通过上述方式,本申请通过原地升级控制器监听VPA组件,并且在监听到VPA组件存在目标Pod的数据更新事件时,根据目标Pod的数据更新信息,确定资源数据库中存储的目标Pod的当前配置参数,由此,可以避免多版本信息的干扰,确定Pod运行资源和存储资源的一致性,确保对目标Pod的当前配置参数执行有效的数据更新;将资源推荐值覆盖目标Pod的当前配置参数,实现对资源数据库中的原地升级,且无需对存量Pod进行重建,不影响Pod内容器业务,由此,提高了容器资源配置的动态调整便捷性。
[Corrected 31.01.2024 in accordance with Article 91]
The present application provides a method, device, equipment and storage medium for updating the data of the existing Pod in Kubernetes. The method of the present application includes obtaining the data update information of the target Pod when the in-place 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, the current configuration parameters of the target Pod stored in the resource database are determined; based on the resource recommendation value, the current configuration parameters are overwritten 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 the VPA component monitors the data update event of the target Pod, the current configuration parameters of the target Pod stored in the resource database are determined according to the data update information of the target Pod, thereby avoiding the interference of multiple versions of information, determining the consistency of the Pod running resources and storage resources, and ensuring the effective data update of the current configuration parameters of the target Pod; the resource recommendation value is overwritten with the current configuration parameters of the target Pod, realizing the in-place upgrade in the resource database, and there is no need to rebuild the existing Pod, and does not affect the container business in the Pod, thereby improving the convenience of dynamic adjustment of container resource configuration.
[根据细则91更正 31.01.2024]附图说明[Corrected 31.01.2024 in accordance with Rule 91] Illustrations
[根据细则91更正 31.01.2024]
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
[Corrected 31.01.2024 in accordance with Article 91]
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. 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 paying any creative work.
[根据细则91更正 31.01.2024]
图1为本申请提供的一种Kubernetes中存量Pod的数据更新方法第一实施例的流程示意图;
[Corrected 31.01.2024 in accordance with Article 91]
FIG1 is a flow chart of a first embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application;
[根据细则91更正 31.01.2024]
图2为本申请提供的Kubernetes中存量Pod的数据更新方法第二实施例的流程示意图;
[Corrected 31.01.2024 in accordance with Article 91]
FIG2 is a flow chart of a second embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application;
[根据细则91更正 31.01.2024]
图3为本申请提供的Kubernetes中存量Pod的数据更新方法第三实施例的流程示意图;
[Corrected 31.01.2024 in accordance with Article 91]
FIG3 is a flow chart of a third embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application;
[根据细则91更正 31.01.2024]
图4为本申请实施例提供的一种Kubernetes中存量Pod的数据更新方法中各组件的结构和数据交互示意图;
[Corrected 31.01.2024 in accordance with Article 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;
[根据细则91更正 31.01.2024]
图5是本申请提供的一种Kubernetes中存量Pod的数据更新装置第一实施例的结构示意图;
[Corrected 31.01.2024 in accordance with Article 91]
FIG5 is a schematic diagram of the structure of a first embodiment of a device for updating data of existing Pods in Kubernetes provided by the present application;
[根据细则91更正 31.01.2024]
图6是本申请实施例提供的一种计算机设备的结构示意性框图。
[Corrected 31.01.2024 in accordance with Article 91]
FIG6 is a schematic block diagram of the structure of a computer device provided in an embodiment of the present application.
[根据细则91更正 31.01.2024]
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
[Corrected 31.01.2024 in accordance with Article 91]
The realization of the purpose, functional features and advantages of this application will be further explained in conjunction with embodiments and with reference to the accompanying drawings.
[根据细则91更正 31.01.2024]具体实施方式[Corrected 31.01.2024 in accordance with Rule 91] Specific implementation methods
[根据细则91更正 31.01.2024]
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
[Corrected 31.01.2024 in accordance with Article 91]
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.
[根据细则91更正 31.01.2024]
附图中所示的流程图仅是示例说明,不是必须包括所有的内容和操作/步骤,也不是必须按所描述的顺序执行。例如,有的操作/步骤还可以分解、组合或部分合并,因此实际执行的顺序有可能根据实际情况改变。
[Corrected 31.01.2024 in accordance with Article 91]
The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations/steps, nor must they be executed in the order described. For example, some operations/steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.
[根据细则91更正 31.01.2024]
下面结合附图,对本申请的一些实施方式作详细说明。在不冲突的情况下,下述的实施例及实施例中的特征可以相互组合。
[Corrected 31.01.2024 in accordance with Article 91]
In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[根据细则91更正 31.01.2024]
请参照图1,图1为本申请提供的一种Kubernetes中存量Pod的数据更新方法第一实施例的流程示意图。
[Corrected 31.01.2024 in accordance with Article 91]
Please refer to Figure 1, which is a flow chart of a first embodiment of a method for updating data of existing Pods in Kubernetes provided by the present application.
[根据细则91更正 31.01.2024]
如图1所示,该Kubernetes中存量Pod的数据更新方法包括步骤S101至步骤S103。
[Corrected 31.01.2024 in accordance with Article 91]
As shown in FIG. 1 , the method for updating data of existing Pods in Kubernetes includes steps S101 to S103 .
[根据细则91更正 31.01.2024]
S101、在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;
[Corrected 31.01.2024 in accordance with Article 91]
S101. When the in-place upgrade controller monitors a data update event of a target Pod in a pre-configured VPA component, the data update information of the target Pod is obtained, wherein the data update data includes a resource recommendation value and current data storage information of the target Pod;
[根据细则91更正 31.01.2024]
在一实施例中,原地升级控制器以控制器operator的模式开发,遵循Kubernetes规范,实现跟VPA、etcd的对接。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the in-place upgrade controller is developed in the mode of controller operator, following the Kubernetes specification, and realizes the connection with VPA and etcd.
[根据细则91更正 31.01.2024]
在一实施例中,原地升级控制器(Update-inplace-controller)主要负责监听VPA的自定义对象变化,维护关联的存量Pod在etcd中数据。若有推荐值的更新,并且Pod的容器配置值在新推荐区间外,将修改etcd中该Pod的资源配置为推荐值。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the update-inplace-controller is mainly responsible for monitoring the custom object changes of the VPA and maintaining the data of the associated stock Pod in etcd. If there is an update to the recommended value and the container configuration value of the Pod is outside the new recommended range, the resource configuration of the Pod in etcd will be modified to the recommended value.
[根据细则91更正 31.01.2024]
可选地,VPA组件与原地升级控制器都可以以Deploymnet的方式部署,以选主模式多副本方式启动,既可保障高可用,也能实现并发控制。可以通过helmchart的方式制作插件的模板,方便安装卸载。另外,还可以配置values.yaml文件达到简化配置的目的。
[Corrected 31.01.2024 in accordance with Article 91]
Optionally, both the VPA component and the in-place upgrade controller can be deployed in Deploymnet mode and started in master-select mode with multiple copies, which can ensure high availability and achieve concurrency control. You can create a template for the plugin in helmchart to facilitate installation and uninstallation. In addition, you can also configure the values.yaml file to simplify the configuration.
[根据细则91更正 31.01.2024]
可以理解地是,在Kubernetes集群中,Pod是所有业务类型的基础,也是K8S管理的最小单位级,它是一个或多个容器的组合。这些容器共享存储、网络和命名空间,以及如何运行的规范。在Pod中,所有容器都被同一安排和调度,并运行在共享的上下文中。对于具体应用而言,Pod是它们的逻辑主机,Pod包含业务相关的多个应用容器。
[Corrected 31.01.2024 in accordance with Article 91]
It is understandable that in a Kubernetes cluster, Pod is the basis of all business types and the smallest unit level of K8S management. It is a combination of one or more containers. These containers share storage, network, and namespace, as well as specifications for how to run. In a Pod, all containers are arranged and scheduled in the same way and run in a shared context. For specific applications, Pod is their logical host, and Pod contains multiple application containers related to the business.
[根据细则91更正 31.01.2024]
在一实施例中,在控制器的启动manager中增加事件过滤器,只把VPA自定义对象(即目标Pod)的修改事件加入到调谐队列;在调谐方法中,利用informer监听并缓存VPA自定义对象(即目标Pod),当有新的更新事件需要处理时,从缓存中获取该目标Pod以及该目标Pod的数据更新信息。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, an event filter is added to the startup manager of the controller, and only the modification events of the VPA custom object (i.e., the target Pod) are added 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 there is a new update event that needs to be processed, the target Pod and the data update information of the target Pod are obtained from the cache.
[根据细则91更正 31.01.2024]
在一实施例中,所述当前数据存储信息包括所述当前配置参数的数据名称、数据存储地址以及当前数据版本号。
[Corrected 31.01.2024 in accordance with Article 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.
[根据细则91更正 31.01.2024]
在一实施例中,在配置VPA组件时,VPA组件与监听对象(即目标Pod)一般是一一对应的,即一个VPA组件监听一个Pod的资源数据,而建立对应关系的基础即根据Pod的配置参数(比如该Pod的名称、编号以及数据版本号)等数据。而在配置VPA组件之后,VPA组件本身只对目标Pod进行数据监听,而不执行目标Pod的数据修改操作,而依赖于原地升级控制器执行该操作,因此在VPA组件配置完成后,将目标Pod的数据更新信息同步发送至原地升级控制器,并缓存在原地升级控制器端,以便于原地升级控制器对各VPA组件和Pod进行统一管理。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, when configuring the VPA component, the VPA component and the monitoring object (i.e., the target Pod) are generally one-to-one corresponding, that is, one VPA component monitors the resource data of one Pod, and the basis for establishing the corresponding relationship is based on the configuration parameters of the Pod (such as the name, number, and data version number of the Pod). After configuring the VPA component, the VPA component itself only monitors the data of the target Pod, but does not perform data modification operations on the target Pod, but relies on the in-place upgrade controller to perform the operation. Therefore, after the VPA component is configured, the data update information of the target Pod is synchronously sent to the in-place upgrade controller and cached on the in-place upgrade controller side, so that the in-place upgrade controller can uniformly manage each VPA component and Pod.
[根据细则91更正 31.01.2024]
进一步地,在获取目标Pod的数据更新信息之后,判断目标Pod的spec.updatePolicy.updateMode是否为Initial或Off,若不是则不做处理直接返回;若是则再判断是否有映射弹性扩缩容的负载应用、是否有推荐值等,应对不同情况的处理;如果存在映射的负载应用,则根据VPA映射的负载获取到负载的selector,以此获取该负载关联的所有Pod。
[Corrected 31.01.2024 in accordance with Article 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 load application mapped to elastic scaling, whether there is a recommended value, etc., to deal with different situations; if there is a mapped load application, obtain the load selector according to the load mapped by VPA, so as to obtain all Pods associated with the load.
[根据细则91更正 31.01.2024]
S102、基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;
[Corrected 31.01.2024 in accordance with Article 91]
S102. Determine the current configuration parameters of the target Pod stored in the resource database based on the current data storage information;
[根据细则91更正 31.01.2024]
在一实施例中,可以使用informer监听并缓存集群内Pod,为避免通过APIServer直接访问到etcd,指定查询条件的ResourceVersion值为0,使其从APIServer的缓存中获取;从缓存中获取到负载关联的所有Pod后,过滤掉处于删除状态的Pod。对于所有存活的Pod,使用推荐值进行etcd中Pod数据的更新。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, informer can be used to monitor and cache Pods in the cluster. To avoid directly accessing etcd through APIServer, the ResourceVersion value of the query condition is specified to be 0, so that it is obtained from the cache of APIServer. After obtaining all Pods associated with the load from the cache, filter out Pods in the deleted state. For all surviving Pods, use the recommended value to update the Pod data in etcd.
[根据细则91更正 31.01.2024]
其中,APIServer是K8s重要的管理API层。它负责提供restfulapi访问端点,并且将数据持久化到etcdserver中。Kubernetes集群中,APIServer扮演着交互入口的位置。APIServer不仅负责和etcd交互(其他组件不会直接操作etcd,只有APIServer这么做),并切对外提供统一的API调用入口。
[Corrected 31.01.2024 in accordance with Article 91]
Among them, APIServer is an important management API layer of K8s. It is responsible for providing restfulapi access endpoints and persisting data to etcdserver. In the Kubernetes cluster, APIServer plays the role of interaction entry. APIServer is not only responsible for interacting with etcd (other components will not directly operate etcd, only APIServer does so), but also provides a unified API call entry to the outside world.
[根据细则91更正 31.01.2024]
进一步地,如图2所示,所述步骤S102具体包括:
[Corrected 31.01.2024 in accordance with Article 91]
Further, as shown in FIG2 , the step S102 specifically includes:
[根据细则91更正 31.01.2024]
S1021、基于预设查询条件,访问所述资源数据库,获取所述目标Pod的存储数据以及所述存储数据对应的存储数据版本号;
[Corrected 31.01.2024 in accordance with Article 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;
[根据细则91更正 31.01.2024]
在一实施例中,APIServer中也存在缓存的Pod配置参数,原地升级控制器在通过APIServer访问etcd时,返回结果也可能是APIServer中缓存的Pod配置参数,此时,查询到的Pod配置参数可能不是该Pod目前正在使用的最新配置参数,因此,在执行目标Pod的配置参数修改之前,需要对比需要修改的配置参数的数据版本号。
[Corrected 31.01.2024 in accordance with Article 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 numbers of the configuration parameters that need to be modified.
[根据细则91更正 31.01.2024]
S1022、比对所述存储数据版本号和所述当前数据版本号;
[Corrected 31.01.2024 in accordance with Article 91]
S1022, comparing the stored data version number with the current data version number;
[根据细则91更正 31.01.2024]
在一实施例中,存储数据版本号是Pod存储在etcd中的配置数据的版本号,etcd中可以保存Pod使用过的所有配置参数数据以及各配置参数的数据版本号。
[Corrected 31.01.2024 in accordance with Article 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.
[根据细则91更正 31.01.2024]
一般地,Pod当前正在使用的配置参数,其与etcd中存储的Pod的最新版本数据一致,因此,在对目标Pod的当前配置参数进行数据更新时,即对etcd中存储的目标Pod的最新版本数据进行更新。
[Corrected 31.01.2024 in accordance with Article 91]
Generally, the configuration parameters currently 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.
[根据细则91更正 31.01.2024]
但是,etcd与外部环境通信的APIServer也可能缓存由目标Pod的其他版本配置数据,而原地升级控制器在访问etcd,查询目标Pod的当前配置参数时,返回结果也可能是APIServer中缓存的其他版本数据,而对该数据进行数据更新并不会影响目标Pod的当前配置参数,因此,在获得查询结果后,需要比对存储数据版本号和当前数据版本号,以确保更新的数据对象是目标Pod当前正在运行的当前配置参数。
[Corrected 31.01.2024 in accordance with Article 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 results, it is necessary to compare the stored data version number with the current data version number to ensure that the updated data object is the current configuration parameters that the target Pod is currently running.
[根据细则91更正 31.01.2024]
S1023、在所述存储数据版本号和所述当前数据版本号一致时,确定所述存储数据为所述目标Pod的当前配置参数。
[Corrected 31.01.2024 in accordance with Article 91]
S1023. When the stored data version number is consistent with the current data version number, determine that the stored data is the current configuration parameter of the target Pod.
[根据细则91更正 31.01.2024]
在一实施例中,在存储数据版本号和当前数据版本号一致时,则该存储数据版本号对应的存储数据为目标Pod当前正在使用的配置参数,也即需要进行数据修改的配置参数。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, when the stored data version number is consistent with the current data version number, 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.
[根据细则91更正 31.01.2024]
在一实施例中,在存储数据版本号和当前数据版本号不一致时,则该存储数据版本号并不是目标Pod当前正在使用的配置参数,此时,继续从etcd中查询目标Pod对应的当前配置参数。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, when the stored data version number is inconsistent with the current data version number, 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.
[根据细则91更正 31.01.2024]
S103、基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。
[Corrected 31.01.2024 in accordance with Article 91]
S103: Based on the resource recommendation value, overwrite the current configuration parameters to complete the data update of the target Pod.
[根据细则91更正 31.01.2024]
在一实施例中,从缓存中获取到负载关联的所有Pod后,过滤掉处于删除状态的Pod。对于所有存活的Pod,使用推荐值进行etcd中Pod数据的更新;先加上互斥锁,通过etcdClient查询Pod在etcd中的数据,对比该数据的ResourceVersion跟缓存中PodResourceVersion是否一致,确保更新的是etcd中最新的版本,再将推荐值覆盖原Pod数据,更新到etcd中完成Pod数据的更新,最后解锁,完成数据更新。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, after all Pods associated with the load are obtained from the cache, the Pods in the deleted state are filtered out. For all surviving Pods, the recommended values are used to update the Pod data in etcd; first, a mutex is added, and the Pod data in etcd is queried through etcdClient, and the ResourceVersion of the data is compared with the PodResourceVersion in the cache to ensure that the latest version in etcd is updated, and then the recommended value is used to overwrite the original Pod data, and the Pod data is updated in etcd to complete the update, and finally the lock is unlocked to complete the data update.
[根据细则91更正 31.01.2024]
其中,互斥锁是一种简单的加锁的方法来控制对共享资源的访问,互斥锁只有两种状态,即上锁(lock)和解锁(unlock)。把一个互斥量锁定为一个原子操作,这意味着操作系统(或pthread函数库)保证了如果一个线程锁定了一个互斥量,没有其他线程在同一时间可以成功锁定这个互斥量;如果一个线程锁定了一个互斥量,在它解除锁定之前,没有其他线程可以锁定这个互斥量;如果一个线程已经锁定了一个互斥量,第二个线程又试图去锁定这个互斥量,则第二个线程将被挂起(不占用任何cpu资源),直到第一个线程解除对这个互斥量的锁定为止,第二个线程则被唤醒并继续执行,同时锁定这个互斥量。
[Corrected 31.01.2024 in accordance with Article 91]
Among them, a mutex is a simple locking method to control access to shared resources. A mutex has only two states, namely locked and unlocked. Locking a mutex as an atomic operation means that the operating system (or 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 tries to lock the mutex, the second thread will be suspended (without occupying any CPU resources) until the first thread unlocks the mutex, and the second thread is awakened and continues to execute, while locking the mutex.
[根据细则91更正 31.01.2024]
进一步地,获取集群中各Pod以及各所述Pod对应的所述VPA组件;在所述原地升级控制器监听到至少两个所述VPA组件触发对应的所述Pod的数据更新事件时,基于消息队列,按照所述数据更新事件的发生顺序,依次对各所述数据更新事件进行缓存;所述原地升级控制器从所述消息队列中获取所述目标Pod的数据更新事件时,从预设的数据缓存器中读取所述目标Pod对应的所述数据更新信息。
[Corrected 31.01.2024 in accordance with Article 91]
Furthermore, each Pod in the cluster and the VPA component corresponding to each Pod are obtained; when the in-place upgrade controller monitors data update events of the corresponding Pod triggered by at least two of the VPA components, based on the message queue, each of the data update events is cached in sequence according to 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, the data update information corresponding to the target Pod is read from a preset data buffer.
[根据细则91更正 31.01.2024]
在一实施例中,一个集群内包括多个Pod,而每一个Pod可以通过一个VPA组件进行资源数据的监测,因此在集群中存在多个Pod同时在运行时,此时也可以创建多个VPA组件,分别对各个Pod的资源数据进行监测,由此,可能存在多个Pod的配置参数需要进行调整,也即,同时存在多个VPA组件触发Pod的数据更新事件,此时,为保证Pod数据的有序更新,可以根据各个数据更新事件的触发顺序,将各个Pod的数据更新事件存储至消息队列中,通过消息队列对数据更新事件进行管理,而原地升级控制器可以通过拉取消息队列中的数据更新事件,依次对各个Pod执行数据更新操作。
[Corrected 31.01.2024 in accordance with Article 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 be created to monitor the resource data of each Pod respectively. Therefore, 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, in order 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, and the data update events can be managed through the message queue. 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.
[根据细则91更正 31.01.2024]
其中,消息队列是一种先进先出的队列型数据结构,实际上是系统内核中的一个内部链表。消息被顺序插入队列中,其中发送进程将消息添加到队列末尾,接受进程从队列头读取消息。多个进程可同时向一个消息队列发送消息,也可以同时从一个消息队列中接收消息。发送进程把消息发送到队列尾部,接受进程从消息队列头部读取消息,消息一旦被读出就从队列中删除。
[Corrected 31.01.2024 in accordance with Article 91]
Among them, the message queue is a first-in-first-out queue data structure, which is actually an internal linked list in the system kernel. Messages are inserted into the queue sequentially, where the sending process adds the message to the end of the queue and the receiving process reads the message from the head of the queue. Multiple processes can send messages to a message queue at the same time, and can also receive messages from a message queue at the same time. The sending process sends the message to the end of the queue, and the receiving process reads the message from the head of the message queue. Once the message is read out, it is deleted from the queue.
[根据细则91更正 31.01.2024]
本实施例提供一种Kubernetes中存量Pod的数据更新方法,该方法通过原地升级控制器监听VPA组件,并且在监听到VPA组件存在目标Pod的数据更新事件时,根据目标Pod的数据更新信息,确定资源数据库中存储的目标Pod的当前配置参数,由此,可以避免多版本信息的干扰,确定Pod运行资源和存储资源的一致性,确保对目标Pod的当前配置参数执行有效的数据更新;将资源推荐值覆盖目标Pod的当前配置参数,实现对资源数据库中的原地升级,且无需对存量Pod进行重建,不影响Pod内容器业务,由此,提高了容器资源配置的动态调整便捷性。
[Corrected 31.01.2024 in accordance with Article 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 a data update event of a target Pod is detected in the VPA component, the current configuration parameters of the target Pod stored in the resource database are determined according to the data update information of the target Pod. Thus, interference of multiple versions of information can be avoided, consistency of Pod running resources and storage resources can be determined, and effective data update of the current configuration parameters of the target Pod can be ensured; the current configuration parameters of the target Pod are overwritten with the recommended resource values, so as to realize in-place upgrade in the resource database without rebuilding the existing Pod and affecting the container business in the Pod. Thus, the convenience of dynamic adjustment of container resource configuration is improved.
[根据细则91更正 31.01.2024]
请参照图3,图3为本申请提供的Kubernetes中存量Pod的数据更新方法第三实施例的流程示意图。
[Corrected 31.01.2024 in accordance with Article 91]
Please refer to Figure 3, which is a flowchart of a third embodiment of a method for updating data of existing Pods in Kubernetes provided by this application.
[根据细则91更正 31.01.2024]
本实施例中,基于上述图1所示实施例,所述方法具体还包括:
[Corrected 31.01.2024 in accordance with Article 91]
In this embodiment, based on the embodiment shown in FIG. 1 above, the method further includes:
[根据细则91更正 31.01.2024]
S201、获取所述目标Pod的配置信息,其中,所述配置信息包括所述目标Pod的数据名称、数据版本号以及数据存储地址;
[Corrected 31.01.2024 in accordance with Article 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;
[根据细则91更正 31.01.2024]
在一实施例中,在配置VPA组件时,VPA组件与监听对象(即目标Pod)一般是一一对应的,即一个VPA组件监听一个Pod的资源数据,而建立对应关系的基础即根据Pod的配置参数(比如该Pod的名称、编号以及数据版本号)等数据。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, when configuring a VPA component, the VPA component and the monitoring object (i.e., the target Pod) are generally in one-to-one correspondence, that is, one VPA component monitors the resource data of one Pod, and the basis for establishing the corresponding relationship is based on the configuration parameters of the Pod (such as the name, number, and data version number of the Pod) and other data.
[根据细则91更正 31.01.2024]
S202、基于所述配置信息,配置所述VPA组件,其中,所述VPA组件用于监听所述目标Pod的资源数据。
[Corrected 31.01.2024 in accordance with Article 91]
S202. Configure the VPA component based on the configuration information, wherein the VPA component is used to monitor resource data of the target Pod.
[根据细则91更正 31.01.2024]
VPA全称VerticalPodAutoscaler,即垂直Pod自动扩缩容,可以根据容器资源使用情况自动设置CPU和内存的请求值,从而允许在节点上进行适当的调度,以便为每个Pod提供适当的资源。它既可以缩小过度请求资源的容器,也可以根据其使用情况随时提升资源不足的容量。
[Corrected 31.01.2024 in accordance with Article 91]
VPA stands for VerticalPodAutoscaler, which means vertical Pod auto-scaling. It can automatically set the CPU and memory request values according to the container resource usage, allowing proper scheduling on the node to provide appropriate resources for each Pod. It can reduce the size of containers that request excessive resources, and can also increase the capacity of insufficient resources at any time according to their usage.
[根据细则91更正 31.01.2024]
在一实施例中,如图4所示,VPA组件包括VPARecommender(推荐模块)、VPAupdater(更新模块)、VPAAdmissionController(准入控制器)。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, as shown in FIG. 4 , the VPA components include a VPARecommender (recommendation module), a VPAupdater (update module), and a VPAAdmissionController (admission controller).
[根据细则91更正 31.01.2024]
其中,VPARecommender主要负责从存储数据库如集群内或集群外prometheus(系统监控和报警工具)获取历史的使用量,利用相关算法计算出更合理的推荐值及推荐区间,并更新到VPA的自定义对象。
[Corrected 31.01.2024 in accordance with Article 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 VPA's custom objects.
[根据细则91更正 31.01.2024]
VPAupdater负责监听VPA的自定义资源对象并驱逐Pod,若Pod中容器配置高于或低于推荐区间,则驱逐Pod,通常这一步将导致存量Pod的删除重建,因此在本方案中,将通过参数配置使updater不做驱逐动作。
[Corrected 31.01.2024 in accordance with Article 91]
VPAupdater is responsible for monitoring VPA's custom resource objects and evicting Pods. If the container configuration in the Pod is higher or lower than the recommended range, the Pod will be evicted. Usually this step will lead to the deletion and reconstruction of the existing Pods. Therefore, in this solution, the updater will not perform the evicting action through parameter configuration.
[根据细则91更正 31.01.2024]
VPAAdmissionController负责当新Pod创建时,查询缓存中VPA自定义资源对象是否已对该Pod计算推荐值并且当前容器配置处于推荐区间外,若是则将推荐值重写覆盖原Pod的资源配置。
[Corrected 31.01.2024 in accordance with Article 91]
VPAAdmissionController is responsible for querying the VPA custom resource object in the cache when a new Pod is created to see whether 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.
[根据细则91更正 31.01.2024]
示例性的,VPA组件配置过程可以包括:将VPA组件的三个部分以及相关的crd、webhook、rbac、certificate等信息以helmchart形式制作模板;将容器启动参数、镜像仓库、镜像名称及版本等关键配置项作为变量,映射到chart的values.yaml文件中;在values.yaml文件中对上述变量指定默认值,例如,为了查询历史容器资源使用量,配置了“---storage=prometheus”、“---prometheus-address=http://prometheus.default.svc.cluster.local:9090”来指定查询prometheus及其地址,配置“--min-replicas=2”来实现只对大于两个副本数的负载进行驱逐等;创建VPA的自定义对象时,配置spec.updatePolicy.updateMode为Initial或Off,达到只给出推荐值,不驱逐Pod的目的。
[Corrected 31.01.2024 in accordance with Article 91]
Exemplarily, the VPA component configuration process may include: creating a template in the form of helmchart for the three parts of the VPA component and related information such as crd, webhook, rbac, certificate, etc.; mapping key configuration items such as container startup parameters, image warehouse, image name and version as variables to the values.yaml file of the chart; specifying default values for the above variables in the values.yaml file. For example, in order to query the historical container resource usage, "---storage=prometheus", "---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 achieve the eviction of only loads with more than two copies, etc.; when creating a custom object of VPA, configure spec.updatePolicy.updateMode to Initial or Off to achieve the purpose of only giving recommended values and not evicting Pods.
[根据细则91更正 31.01.2024]
进一步地,所述基于所述当前数据存储信息,配置所述VPA组件之后,还包括:获取所述目标Pod的历史资源数据,其中所述历史资源数据包括所述目标Pod在预设历史周期内的资源数据;基于所述历史资源数据,计算所述目标Pod对应的所述资源推荐值和数据监测阈值范围;将所述资源推荐值和所述数据监测阈值范围发送至所述原地升级控制器,以通过所述原地升级控制器监听所述VPA组件是否存在所述目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 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 recommended resource value and data monitoring threshold range corresponding to the target Pod based on the historical resource data; and sending the recommended resource 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 of the target Pod through the in-place upgrade controller.
[根据细则91更正 31.01.2024]
在一实施例中,VPA组件依据目标Pod的历史资源数据,计算当前资源推荐值和数据监测阈值范围,并且将数据监测阈值范围作为监测目标Pod的资源数据的依据。
[Corrected 31.01.2024 in accordance with Article 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 a basis for monitoring the resource data of the target Pod.
[根据细则91更正 31.01.2024]
示例性的,历史资源数据可以根据资源推荐值和数据监测阈值范围的计算需求进行选择,比如,可以选取历史七天的历史资源数据,计算七天的历史资源数据的平均值作为资源推荐值,而选取七天对应的资源数据最低值和资源数据最高值,计算七天资源数据最低值的平均值作为数据监测阈值范围的最低值,计算七天资源数据最高值的平均值作为数据监测阈值范围的最高值。
[Corrected 31.01.2024 in accordance with Article 91]
Exemplarily, 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 seven-day historical resource data can be calculated as the resource recommendation value, and the minimum value and maximum value of the resource data corresponding to the seven days can be selected, and the average value of the minimum value of the seven-day resource data can be calculated as the minimum value of the data monitoring threshold range, and the average value of the maximum value of the seven-day resource data can be calculated as the maximum value of the data monitoring threshold range.
[根据细则91更正 31.01.2024]
在一实施例中,资源推荐值和数据监测阈值范围还可以根据特殊需求进行制定,比如,在历史资源数据中显示目标Pod的负载在周末与周中存在较大差异,那么可以针对周中和周末分别计算对应的资源推荐值和数据监测阈值范围。
[Corrected 31.01.2024 in accordance with Article 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 greatly different on weekends and midweek, then the corresponding resource recommendation value and data monitoring threshold range can be calculated for midweek and weekends respectively.
[根据细则91更正 31.01.2024]
进一步地,基于所述VPA组件,监听所述目标Pod的当前资源数据;在所述当前资源数据超出所述数据监测阈值范围时,触发所述目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 91]
Furthermore, based on the VPA component, 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.
[根据细则91更正 31.01.2024]
在一实施例中,在VPA组件配置完成后,即可通过VPA组件实时监测目标Pod的当前资源数据,当监测到目标Pod的当前资源数据超出数据监测阈值范围,即小于数据监测阈值范围的最低值或大于数据监测阈值范围的最高值时,即可触发目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 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, it is less than the lowest value of the data monitoring threshold range or greater than the highest value of the data monitoring threshold range, a data update event of the target Pod can be triggered.
[根据细则91更正 31.01.2024]
在一实施例中,监测到目标Pod的当前资源数据超出数据监测阈值范围,可能是偶尔性的,因此,可以设置超出时长或超出频次。在监测到目标Pod的当前资源数据超出数据监测阈值范围时开始计时,当计时达到预设时长时,触发目标Pod的数据更新事件;或者在监测到目标Pod的当前资源数据超出数据监测阈值范围的次数达到预设频次时,触发目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the current resource data of the target Pod that is monitored to exceed the data monitoring threshold range may be occasional, so the duration or frequency of the excess can be set. When the current resource data of the target Pod is monitored to exceed the data monitoring threshold range, the timing starts, and when the timing reaches the preset duration, the data update event of the target Pod is triggered; or when the number of times the current resource data of the target Pod is monitored to exceed the data monitoring threshold range reaches the preset frequency, the data update event of the target Pod is triggered.
[根据细则91更正 31.01.2024]
请参阅图5,图5是本申请提供的一种Kubernetes中存量Pod的数据更新装置第一实施例的结构示意图,该Kubernetes中存量Pod的数据更新装置用于执行前述的Kubernetes中存量Pod的数据更新方法。其中,该Kubernetes中存量Pod的数据更新装置可以配置于服务器中。
[Corrected 31.01.2024 in accordance with Article 91]
Please refer to Figure 5, which is a schematic diagram of the structure of a first embodiment of a data update device for existing Pods in Kubernetes provided by the present application, wherein the data update device for existing Pods in Kubernetes is used to execute the aforementioned data update method for existing Pods in Kubernetes. The data update device for existing Pods in Kubernetes can be configured in a server.
[根据细则91更正 31.01.2024]
如图5所示,该Kubernetes中存量Pod的数据更新装置300,包括:数据更新信息获取模块301、当前配置参数确定模块302和数据更新模块303。
[Corrected 31.01.2024 in accordance with Article 91]
As shown in FIG. 5 , the data updating 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 .
[根据细则91更正 31.01.2024]
数据更新信息获取模块301,用于在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;
[Corrected 31.01.2024 in accordance with Article 91]
The data update information acquisition module 301 is used to acquire the data update information of the target Pod when the in-place upgrade controller monitors the data update event of the pre-configured VPA component, wherein the data update data includes the resource recommendation value and current data storage information of the target Pod;
[根据细则91更正 31.01.2024]
当前配置参数确定模块302,用于基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;
[Corrected 31.01.2024 in accordance with Article 91]
A current configuration parameter determination module 302, configured to determine the current configuration parameters of the target Pod stored in the resource database based on the current data storage information;
[根据细则91更正 31.01.2024]
数据更新模块303,用于基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。
[Corrected 31.01.2024 in accordance with Article 91]
The data updating module 303 is used to overwrite the current configuration parameters based on the resource recommendation value to complete the data update of the target Pod.
[根据细则91更正 31.01.2024]
在一实施例中,所述Kubernetes中存量Pod的数据更新装置300还包括VPA组件配置模块,用于获取所述目标Pod的配置信息,其中,所述配置信息包括所述目标Pod的数据名称、数据版本号以及数据存储地址;基于所述配置信息,配置所述VPA组件,其中,所述VPA组件用于监听所述目标Pod的资源数据。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the data update device 300 for existing Pods 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.
[根据细则91更正 31.01.2024]
在一实施例中,所述VPA组件配置模块还用于获取所述目标Pod的历史资源数据,其中所述历史资源数据包括所述目标Pod在预设历史周期内的资源数据;基于所述历史资源数据,计算所述目标Pod对应的所述资源推荐值和数据监测阈值范围;将所述资源推荐值和所述数据监测阈值范围发送至所述原地升级控制器,以通过所述原地升级控制器监听所述VPA组件是否存在所述目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 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 as to monitor whether the VPA component has a data update event of the target Pod through the in-place upgrade controller.
[根据细则91更正 31.01.2024]
在一实施例中,所述Kubernetes中存量Pod的数据更新装置300还包括数据监测模块,用于基于所述VPA组件,监听所述目标Pod的当前资源数据;在所述当前资源数据超出所述数据监测阈值范围时,触发所述目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the data update device 300 for existing Pods in Kubernetes also includes a data monitoring module, which is used to monitor the current resource data of the target Pod based on the VPA component; when the current resource data exceeds the data monitoring threshold range, trigger a data update event of the target Pod.
[根据细则91更正 31.01.2024]
在一实施例中,所述当前数据存储信息包括所述当前配置参数的数据名称、数据存储地址以及当前数据版本号。
[Corrected 31.01.2024 in accordance with Article 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.
[根据细则91更正 31.01.2024]
在一实施例中,所述当前配置参数确定模块302还用于基于预设查询条件,访问所述资源数据库,获取所述目标Pod的存储数据以及所述存储数据对应的存储数据版本号;比对所述存储数据版本号和所述当前数据版本号;在所述存储数据版本号和所述当前数据版本号一致时,确定所述存储数据为所述目标Pod的当前配置参数。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the current configuration parameter determination module 302 is also 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.
[根据细则91更正 31.01.2024]
在一实施例中,所述数据更新信息获取模块301,还用于获取集群中各Pod以及各所述Pod对应的所述VPA组件;在所述原地升级控制器监听到至少两个所述VPA组件触发对应的所述Pod的数据更新事件时,基于消息队列,按照所述数据更新事件的发生顺序,依次对各所述数据更新事件进行缓存;所述原地升级控制器从所述消息队列中获取所述目标Pod的数据更新事件时,从预设的数据缓存器中读取所述目标Pod对应的所述数据更新信息。
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the data update information acquisition module 301 is also 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 corresponding Pod's data update events, based on the message queue, in the order of occurrence of the data update events, each of the data update events is cached in sequence; 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 a preset data buffer.
[根据细则91更正 31.01.2024]
需要说明的是,所属领域的技术人员可以清楚地了解到,为了描述的方便和简洁,上述描述的装置和各模块的具体工作过程,可以参考前述Kubernetes中存量Pod的数据更新方法实施例中的对应过程,在此不再赘述。
[Corrected 31.01.2024 in accordance with Article 91]
It should be noted that technicians in the relevant field can clearly understand that for the convenience and conciseness of description, the specific working process of the above-described device and each module can refer to the corresponding process in the aforementioned embodiment of the data update method of the existing Pod in Kubernetes, and will not be repeated here.
[根据细则91更正 31.01.2024]
上述实施例提供的装置可以实现为一种计算机程序的形式,该计算机程序可以在如图6所示的计算机设备上运行。
[Corrected 31.01.2024 in accordance with Article 91]
The apparatus provided in the above embodiment may be implemented in the form of a computer program, and the computer program may be run on a computer device as shown in FIG. 6 .
[根据细则91更正 31.01.2024]
请参阅图6,图6是本申请实施例提供的一种计算机设备的结构示意性框图。该计算机设备可以是服务器。
[Corrected 31.01.2024 in accordance with Article 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.
[根据细则91更正 31.01.2024]
参阅图6,该计算机设备包括通过系统总线连接的处理器、存储器和网络接口,其中,存储器可以包括非易失性存储介质和内存储器。
[Corrected 31.01.2024 in accordance with Article 91]
Referring to FIG. 6 , 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.
[根据细则91更正 31.01.2024]
非易失性存储介质可存储操作系统和计算机程序。该计算机程序包括程序指令,该程序指令被执行时,可使得处理器执行任意一种Kubernetes中存量Pod的数据更新方法。
[Corrected 31.01.2024 in accordance with Article 91]
The non-volatile storage medium can store an operating system and a computer program. The computer program includes program instructions, and when the program instructions are executed, the processor can execute any method for updating the data of the existing Pod in Kubernetes.
[根据细则91更正 31.01.2024]
处理器用于提供计算和控制能力,支撑整个计算机设备的运行。
[Corrected 31.01.2024 in accordance with Article 91]
The processor is used to provide computing and control capabilities and support the operation of the entire computer equipment.
[根据细则91更正 31.01.2024]
内存储器为非易失性存储介质中的计算机程序的运行提供环境,该计算机程序被处理器执行时,可使得处理器执行任意一种Kubernetes中存量Pod的数据更新方法。
[Corrected 31.01.2024 in accordance with Article 91]
The internal memory provides an environment for the operation of the computer program in the non-volatile storage medium. When the computer program is executed by the processor, the processor can execute any method for updating the data of the existing Pod in Kubernetes.
[根据细则91更正 31.01.2024]
该网络接口用于进行网络通信,如发送分配的任务等。本领域技术人员可以理解,图6中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备的限定,具体的计算机设备可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。
[Corrected 31.01.2024 in accordance with Article 91]
The network interface is used for network communication, such as sending assigned tasks, etc. Those skilled in the art will appreciate that the structure shown in FIG6 is only a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[根据细则91更正 31.01.2024]
应当理解的是,处理器可以是中央处理单元(CentralProcessingUnit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(DigitalSignalProcessor,DSP)、专用集成电路(ApplicationSpecificIntegratedCircuit,ASIC)、现场可编程门阵列(Field-ProgrammableGateArray,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
[Corrected 31.01.2024 in accordance with Article 91]
It should be understood that the processor may be a central processing unit (CPU), or 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.
[根据细则91更正 31.01.2024]
其中,在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,以实现如下步骤:
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the processor is used to run a computer program stored in the memory to implement the following steps:
[根据细则91更正 31.01.2024]
在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;
[Corrected 31.01.2024 in accordance with Article 91]
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;
[根据细则91更正 31.01.2024]
基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;
[Corrected 31.01.2024 in accordance with Article 91]
Based on the current data storage information, determine the current configuration parameters of the target Pod stored in the resource database;
[根据细则91更正 31.01.2024]
基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。
[Corrected 31.01.2024 in accordance with Article 91]
Based on the resource recommendation value, the current configuration parameter is overwritten to complete the data update of the target Pod.
[根据细则91更正 31.01.2024]
在一个实施例中,所述处理器用于运行存储在存储器中的计算机程序,还可以实现如下步骤:
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, the processor is used to run a computer program stored in the memory, and can also implement the following steps:
[根据细则91更正 31.01.2024]
获取所述目标Pod的配置信息,其中,所述配置信息包括所述目标Pod的数据名称、数据版本号以及数据存储地址;
[Corrected 31.01.2024 in accordance with Article 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;
[根据细则91更正 31.01.2024]
基于所述配置信息,配置所述VPA组件,其中,所述VPA组件用于监听所述目标Pod的资源数据。
[Corrected 31.01.2024 in accordance with Article 91]
Based on the configuration information, the VPA component is configured, wherein the VPA component is used to monitor resource data of the target Pod.
[根据细则91更正 31.01.2024]
在一个实施例中,所述处理器在实现所述基于所述当前数据存储信息,配置所述VPA组件之后,还用于实现:
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, after implementing the configuring of the VPA component based on the current data storage information, the processor is further configured to implement:
[根据细则91更正 31.01.2024]
获取所述目标Pod的历史资源数据,其中所述历史资源数据包括所述目标Pod在预设历史周期内的资源数据;
[Corrected 31.01.2024 in accordance with Article 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;
[根据细则91更正 31.01.2024]
基于所述历史资源数据,计算所述目标Pod对应的所述资源推荐值和数据监测阈值范围;
[Corrected 31.01.2024 in accordance with Article 91]
Based on the historical resource data, calculate the resource recommendation value and data monitoring threshold range corresponding to the target Pod;
[根据细则91更正 31.01.2024]
将所述资源推荐值和所述数据监测阈值范围发送至所述原地升级控制器,以通过所述原地升级控制器监听所述VPA组件是否存在所述目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 91]
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.
[根据细则91更正 31.01.2024]
在一个实施例中,所述处理器在实现所述基于所述历史资源数据,计算所述目标Pod对应的所述资源推荐值和数据监测阈值范围之后,还用于实现:
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, after the processor calculates the resource recommendation value and the data monitoring threshold range corresponding to the target Pod based on the historical resource data, it is further configured to implement:
[根据细则91更正 31.01.2024]
基于所述VPA组件,监听所述目标Pod的当前资源数据;
[Corrected 31.01.2024 in accordance with Article 91]
Based on the VPA component, monitor the current resource data of the target Pod;
[根据细则91更正 31.01.2024]
在所述当前资源数据超出所述数据监测阈值范围时,触发所述目标Pod的数据更新事件。
[Corrected 31.01.2024 in accordance with Article 91]
When the current resource data exceeds the data monitoring threshold range, a data update event of the target Pod is triggered.
[根据细则91更正 31.01.2024]
在一个实施例中,所述当前数据存储信息包括所述当前配置参数的数据名称、数据存储地址以及当前数据版本号。
[Corrected 31.01.2024 in accordance with Article 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.
[根据细则91更正 31.01.2024]
在一个实施例中,所述处理器在实现所述基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数时,用于实现:
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, when the processor implements the determination of the current configuration parameters of the target Pod stored in the resource database based on the current data storage information, it is configured to implement:
[根据细则91更正 31.01.2024]
基于预设查询条件,访问所述资源数据库,获取所述目标Pod的存储数据以及所述存储数据对应的存储数据版本号;
[Corrected 31.01.2024 in accordance with Article 91]
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;
[根据细则91更正 31.01.2024]
比对所述存储数据版本号和所述当前数据版本号;
[Corrected 31.01.2024 in accordance with Article 91]
Comparing the stored data version number with the current data version number;
[根据细则91更正 31.01.2024]
在所述存储数据版本号和所述当前数据版本号一致时,确定所述存储数据为所述目标Pod的当前配置参数。
[Corrected 31.01.2024 in accordance with Article 91]
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.
[根据细则91更正 31.01.2024]
在一个实施例中,所述处理器在实现所述在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息时,用于实现:
[Corrected 31.01.2024 in accordance with Article 91]
In one embodiment, when the in-place upgrade controller monitors the data update event of the target Pod of the preconfigured VPA component, the processor acquires the data update information of the target Pod, and is used to implement:
[根据细则91更正 31.01.2024]
获取集群中各Pod以及各所述Pod对应的所述VPA组件;
[Corrected 31.01.2024 in accordance with Article 91]
Obtain each Pod in the cluster and the VPA component corresponding to each Pod;
[根据细则91更正 31.01.2024]
在所述原地升级控制器监听到至少两个所述VPA组件触发对应的所述Pod的数据更新事件时,基于消息队列,按照所述数据更新事件的发生顺序,依次对各所述数据更新事件进行缓存;
[Corrected 31.01.2024 in accordance with Article 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 data update events are cached in sequence based on the message queue and in the order in which the data update events occur;
[根据细则91更正 31.01.2024]
所述原地升级控制器从所述消息队列中获取所述目标Pod的数据更新事件时,从预设的数据缓存器中读取所述目标Pod对应的所述数据更新信息。
[Corrected 31.01.2024 in accordance with Article 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 a preset data buffer.
[根据细则91更正 31.01.2024]
本申请的实施例中还提供一种计算机可读存储介质,所述计算机可读存储介质存储有计算机程序,所述计算机程序中包括程序指令,所述处理器执行所述程序指令,实现本申请实施例提供的任一种Kubernetes中存量Pod的数据更新方法。
[Corrected 31.01.2024 in accordance with Article 91]
A computer-readable storage medium is also provided in an embodiment of the present application. The computer-readable storage medium stores a computer program. The computer program includes program instructions. The processor executes the program instructions to implement any method for updating data of existing Pods in Kubernetes provided in an embodiment of the present application.
[根据细则91更正 31.01.2024]
其中,所述计算机可读存储介质可以是前述实施例所述的计算机设备的内部存储单元,例如所述计算机设备的硬盘或内存。所述计算机可读存储介质也可以是所述计算机设备的外部存储设备,例如所述计算机设备上配备的插接式硬盘,智能存储卡(SmartMediaCard,SMC),安全数字(SecureDigital,SD)卡,闪存卡(FlashCard)等。
[Corrected 31.01.2024 in accordance with Article 91]
The computer-readable storage medium may be an internal storage unit of the computer device described in the above embodiment, 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 memory card (SmartMediaCard, SMC), a secure digital (SecureDigital, SD) card, a flash card (FlashCard), etc. equipped on the computer device.
[根据细则91更正 31.01.2024]
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。
[Corrected 31.01.2024 in accordance with Article 91]
The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in the present application, and these modifications or replacements should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims (10)

  1. 一种Kubernetes中存量Pod的数据更新方法,其特征在于,所述方法包括:A method for updating data of existing Pods in Kubernetes, characterized in that the method comprises:
    在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;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;
    基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数;Based on the current data storage information, determine the current configuration parameters of the target Pod stored in the resource database;
    基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。Based on the resource recommendation value, the current configuration parameter is overwritten to complete the data update of the target Pod.
  2. 根据权利要求1所述的Kubernetes中存量Pod的数据更新方法,其特征在于,所述方法还包括:The method for updating data of existing Pods in Kubernetes according to claim 1, characterized in that the method further comprises:
    获取所述目标Pod的配置信息,其中,所述配置信息包括所述目标Pod的数据名称、数据版本号以及数据存储地址;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;
    基于所述配置信息,配置所述VPA组件,其中,所述VPA组件用于监听所述目标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. 根据权利要求2所述的Kubernetes中存量Pod的数据更新方法,其特征在于,所述基于所述当前数据存储信息,配置所述VPA组件之后,还包括:The method for updating data of existing Pods in Kubernetes according to claim 2 is characterized in that after configuring the VPA component based on the current data storage information, it also includes:
    获取所述目标Pod的历史资源数据,其中所述历史资源数据包括所述目标Pod在预设历史周期内的资源数据;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;
    基于所述历史资源数据,计算所述目标Pod对应的所述资源推荐值和数据监测阈值范围;Based on the historical resource data, calculate the resource recommendation value and data monitoring threshold range corresponding to the target Pod;
    将所述资源推荐值和所述数据监测阈值范围发送至所述原地升级控制器,以通过所述原地升级控制器监听所述VPA组件是否存在所述目标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. 根据权利要求3所述的Kubernetes中存量Pod的数据更新方法,其特征在于,所述基于所述历史资源数据,计算所述目标Pod对应的所述资源推荐值和数据监测阈值范围之后,还包括:The method for updating data of existing Pods 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, it also includes:
    基于所述VPA组件,监听所述目标Pod的当前资源数据;Based on the VPA component, monitor the current resource data of the target Pod;
    在所述当前资源数据超出所述数据监测阈值范围时,触发所述目标Pod的数据更新事件。When the current resource data exceeds the data monitoring threshold range, a data update event of the target Pod is triggered.
  5. 根据权利要求1所述的Kubernetes中存量Pod的数据更新方法,其特征在于,所述当前数据存储信息包括所述当前配置参数的数据名称、数据存储地址以及当前数据版本号。The method for updating data of existing Pods in Kubernetes according to claim 1 is characterized in that the current data storage information includes the data name of the current configuration parameter, the data storage address and the current data version number.
  6. 根据权利要求5所述的Kubernetes中存量Pod的数据更新方法,其特征在于,所述基于所述当前数据存储信息,确定存储于资源数据库中的所述目标Pod的当前配置参数,包括:The method for updating data of existing Pods in Kubernetes according to claim 5, characterized in that the step of determining the current configuration parameters of the target Pod stored in the resource database based on the current data storage information comprises:
    基于预设查询条件,访问所述资源数据库,获取所述目标Pod的存储数据以及所述存储数据对应的存储数据版本号;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;
    在所述存储数据版本号和所述当前数据版本号一致时,确定所述存储数据为所述目标Pod的当前配置参数。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. 根据权利要求1-6任一项所述的Kubernetes中存量Pod的数据更新方法,其特征在于,所述在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,包括:The method for updating data of existing Pods in Kubernetes according to any one of claims 1 to 6 is characterized in that when the in-place upgrade controller monitors the data update event of the target Pod of the pre-configured VPA component, obtaining the data update information of the target Pod comprises:
    获取集群中各Pod以及各所述Pod对应的所述VPA组件;Obtain each Pod in the cluster and the VPA component corresponding to each Pod;
    在所述原地升级控制器监听到至少两个所述VPA组件触发对应的所述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;
    所述原地升级控制器从所述消息队列中获取所述目标Pod的数据更新事件时,从预设的数据缓存器中读取所述目标Pod对应的所述数据更新信息。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. 一种Kubernetes中存量Pod的数据更新装置,其特征在于,所述Kubernetes中存量Pod的数据更新装置包括:A device for updating data of existing Pods in Kubernetes, characterized in that the device for updating data of existing Pods in Kubernetes comprises:
    数据更新信息获取模块,用于在原地升级控制器监听到预配置的VPA组件存在目标Pod的数据更新事件时,获取所述目标Pod的数据更新信息,其中,所述数据更新数据包括所述目标Pod的资源推荐值和当前数据存储信息;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;
    当前配置参数确定模块,用于基于所述当前数据存储信息,确定存储于资源数据库中的所述目标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;
    数据更新模块,用于基于所述资源推荐值,对所述当前配置参数进行数据覆盖,以完成对所述目标Pod的数据更新。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. 一种计算机设备,其特征在于,所述计算机设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的计算机程序,其中所述计算机程序被所述处理器执行时,实现如权利要求1至7中任一项所述的Kubernetes中存量Pod的数据更新方法的步骤。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 as described in any one of claims 1 to 7 are implemented.
  10. 一种计算机可读存储介质,其特征在于,所述计算机可读存储介质上存储有计算机程序,其中所述计算机程序被处理器执行时,实现如权利要求1至7中任一项所述的Kubernetes中存量Pod的数据更新方法的步骤。 A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, wherein when the computer program is executed by a processor, the steps of the method for updating data of existing Pods in Kubernetes as described in any one of claims 1 to 7 are implemented.
PCT/CN2023/143263 2023-12-12 2023-12-29 Data update method and apparatus for stock pod in kubernetes, and device and medium WO2024187919A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202311699090.3A CN117827240A (en) 2023-12-12 2023-12-12 Data update method, device, equipment and medium for existing Pod in Kubernetes
CN202311699090.3 2023-12-12

Publications (1)

Publication Number Publication Date
WO2024187919A1 true WO2024187919A1 (en) 2024-09-19

Family

ID=90514490

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/143263 WO2024187919A1 (en) 2023-12-12 2023-12-29 Data update method and apparatus for stock pod in kubernetes, and device and medium

Country Status (2)

Country Link
CN (1) CN117827240A (en)
WO (1) WO2024187919A1 (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112100152A (en) * 2020-09-14 2020-12-18 广州华多网络科技有限公司 Service data processing method, system, server and readable storage medium
CN113971066A (en) * 2020-07-22 2022-01-25 中国科学院深圳先进技术研究院 A Kubernetes cluster resource dynamic adjustment method and electronic device
CN114461394A (en) * 2022-01-28 2022-05-10 苏州浪潮智能科技有限公司 A CPU resource scaling control method, device, device and storage medium
US20220357995A1 (en) * 2021-05-06 2022-11-10 Ateme Method for dynamic resources allocation and apparatus for implementing the same
US20230028922A1 (en) * 2021-07-23 2023-01-26 Vmware, Inc. Edge node with datapath split between pods

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113971066A (en) * 2020-07-22 2022-01-25 中国科学院深圳先进技术研究院 A Kubernetes cluster resource dynamic adjustment method and electronic device
CN112100152A (en) * 2020-09-14 2020-12-18 广州华多网络科技有限公司 Service data processing method, system, server and readable storage medium
US20220357995A1 (en) * 2021-05-06 2022-11-10 Ateme Method for dynamic resources allocation and apparatus for implementing the same
US20230028922A1 (en) * 2021-07-23 2023-01-26 Vmware, Inc. Edge node with datapath split between pods
CN114461394A (en) * 2022-01-28 2022-05-10 苏州浪潮智能科技有限公司 A CPU resource scaling control method, device, device and storage medium

Also Published As

Publication number Publication date
CN117827240A (en) 2024-04-05

Similar Documents

Publication Publication Date Title
US10579364B2 (en) Upgrading bundled applications in a distributed computing system
US9430388B2 (en) Scheduler, multi-core processor system, and scheduling method
US6553369B1 (en) Approach for performing administrative functions in information systems
US11099937B2 (en) Implementing clone snapshots in a distributed storage system
US20190213085A1 (en) Implementing Fault Domain And Latency Requirements In A Virtualized Distributed Storage System
EP1677201B1 (en) Common cache management in a plurality of virtual machines
CN109997112B (en) data processing
CN112445598B (en) Task scheduling method and device based on quartz, electronic equipment and medium
CN109614227B (en) Task resource allocation method, apparatus, electronic device, and computer-readable medium
EP2797014A1 (en) Database update execution according to power management schemes
CN114138434A (en) Big data task scheduling system
US8954969B2 (en) File system object node management
CN112596904A (en) Quantum service resource calling optimization method based on quantum cloud platform
US20070192334A1 (en) System and Method for Heterogeneous Caching
CN117032974A (en) Dynamic scheduling method and terminal based on resource application
CN114610567A (en) Container monitoring method, network device and storage medium
CN111897643A (en) Thread pool configuration system, method, apparatus and storage medium
CN118796485B (en) MESI protocol-based parallel processing method for computing tasks
US8341368B2 (en) Automatic reallocation of structured external storage structures
WO2024187919A1 (en) Data update method and apparatus for stock pod in kubernetes, and device and medium
Morisawa et al. Flexible executor allocation without latency increase for stream processing in apache spark
CN110247801A (en) A kind of monitoring system and method for pair of cluster host
US11748203B2 (en) Multi-role application orchestration in a distributed storage system
US20090320036A1 (en) File System Object Node Management
US20050216908A1 (en) Assigning computational processes in a computer system to workload management classes

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23927259

Country of ref document: EP

Kind code of ref document: A1