Operator-based k8s resource merging management method and device
By separating the design of cluster management cr and node management cr, the K8s cluster life cycle management protocol is simplified, the maintenance cost is reduced, and efficient node resource management and state synchronization is achieved, which solves the problems of high complexity and high protocol maintenance cost in the existing technology.
Patent Information
- Application Number
- CN202411761738.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-03
- Publication Date
- 2025-04-25
AI Technical Summary
现有技术在k8s集群施工过程中,通过Operator管理iaas资源时存在复杂度高、协议维护成本高且难以判断变更操作的IaaS资源类型的问题。
The separate design of cluster management cr and node management cr is adopted. The cluster management controller and node management controller are used to manage cluster activation and node life cycles respectively. The same set of protocols is used to expand node pools, change specifications and node configurations, and the status of node management cr is monitored in real time. Finally, the full amount of node information is synchronized to cluster management cr.
The cluster life cycle management protocol is simplified, maintenance costs are reduced, fast communication between different components is realized, accurate node resource status information is obtained, and the efficiency and fault tolerance of life cycle management are improved.
Smart Images

Figure CN119883671A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of kubernetes cloud platform, and in particular to a k8s resource merging management method and device based on Operator. Background Art
[0002] In cloud-native scenarios, there are scenarios where k8s clusters are opened and delivered to customers for use. When a k8s cluster is opened, it involves the demand to open multiple iaas resources. In the cluster construction process, the better practice is to manage through user-defined resources (cr) and operators. However, due to the diversity of iaas resources, it is extremely complicated to manage k8s cr resources through operators. For example: For such a business scenario, the construction of a k8s cluster involves opening host nodes in batches according to a certain specification, but it is necessary to support changing the node specifications in a node pool after the cluster is opened (only affecting the nodes that are expanded after the change), and at the same time, it is also necessary to meet the addition / deletion of mounted data disks and the increase / decrease of cpu, memory and other specifications for a certain node after the cluster is opened. In this case, the conventional way of handling is that the construction process of cluster opening is through a unified cr as the entrance (in order to collect and manage the subsequent construction process information, because cluster opening and other construction processes such as load balancing, elastic IP and NAT are not only node construction, but also many other construction processes such as load balancing, elastic IP and NAT), and a set of protocols is defined for each node separately, and then the protocols are assembled in a cr in the form of an array. Each expansion and contraction, node configuration change and other operations need to compare the protocol data of the new version with the current version and then patch (patch) changes. When the number of nodes is large, the design of cr and k8s resource management will be very bloated; moreover, it is difficult to determine which IaaS resources (involving nodes, load balancing, elastic IP, NAT, etc.) need to be tuned for each change operation, and it needs to be specified by the upstream, resulting in excessively high protocol maintenance costs. Therefore, based on the existing conventional k8s resource management method, it is not applicable in this business scenario.
[0003] At this stage, there is an urgent need to develop a k8s resource merging management method and device based on Operator to solve the above-mentioned technical problems. Summary of the invention
[0004] This application shows a k8s resource merging management method and device based on Operator.
[0005] In the first aspect, the present application shows a k8s resource merging management method based on Operator, the method comprising:
[0006] Open a k8s cluster through the cluster management cr;
[0007] After the k8s cluster is activated, create a node management cr;
[0008] The k8s cluster is managed by the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change;
[0009] When the node management is completed, the current full node information is synchronized to the cluster management cr;
[0010] When the node information synchronization is completed, the node management cr is deleted.
[0011] According to the method of the first aspect of the present application, the node management cr is created at the moment when the user clicks on the node expansion after each node configuration change.
[0012] According to the method of the first aspect of the present application, the node management cr is used to manage the k8s cluster based on the same set of protocols. The protocol includes field one and field two. Field one is the configuration of the node pool, and field two is a list of node configurations to be expanded or changed.
[0013] According to the method of the first aspect of the present application, it also includes: managing the tuning process of the cluster management cr to open the cluster through the cluster management controller; managing the tuning process of the node management cr for node life cycle management through the node management controller, and monitoring the status of the node management cr in real time.
[0014] According to the method of the first aspect of the present application, node management of the k8s cluster is performed through the node management cr, specifically including:
[0015] For any node pool in the k8s cluster, expansion management is performed. When it is determined through the status of the node management cr that the node management cr has been created and the node can be expanded normally, the node management cr expands the corresponding node pool;
[0016] Perform specification configuration change management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created, the node management cr changes the specification configuration of the corresponding node pool;
[0017] Configuration change management is performed on any node in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the changed node exists, the node management cr performs configuration changes on the corresponding node.
[0018] According to the method of the first aspect of the present application, when the node management is completed, the current full node information is synchronized to the cluster management cr, specifically:
[0019] The current full node information in the status field of the node management cr is synchronized to the status field of the cluster management cr.
[0020] According to the method of the first aspect of the present application, the status field is an overall status list, and each element in the list is a node template and a node map.
[0021] In the second aspect, the present application shows a k8s resource merging management device based on Operator, the device comprising:
[0022] The first processing module is configured to open a k8s cluster through the cluster management cr;
[0023] The second processing module is configured to create a node management cr when the k8s cluster is opened;
[0024] The third processing module is configured to perform node management on the k8s cluster through the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change;
[0025] The fourth processing module is configured to synchronize the current full node information to the cluster management cr when the node management is completed;
[0026] The fifth processing module is configured to delete the node management cr when the node information synchronization is completed.
[0027] According to the device of the second aspect of the present application, the node management cr is created at the moment of clicking on the node expansion after each node configuration change.
[0028] According to the device of the second aspect of the present application, the node management of the k8s cluster is performed based on the same protocol through the node management cr, and the protocol includes field one and field two, the field one is the configuration of the node pool, and the field two is a list of node configurations to be expanded or changed.
[0029] According to the device of the second aspect of the present application, in the first processing module, the cluster management controller is used to manage the cluster management CR's tuning process for opening the cluster; in the second processing module, the node management controller is used to manage the node management CR's tuning process for node life cycle management and monitor the status of the node management CR in real time.
[0030] According to the device of the second aspect of the present application, the third processing module specifically includes:
[0031] The expansion unit is configured to perform expansion management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the node can be expanded normally, the node management cr expands the corresponding node pool;
[0032] The first change unit is configured to perform specification configuration change management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created, the node management cr performs specification configuration change on the corresponding node pool;
[0033] The second change unit is configured to perform configuration change management on any node in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the changed node exists, the node management cr performs configuration changes on the corresponding node.
[0034] According to the device of the second aspect of the present application, the fourth processing module is specifically configured as follows:
[0035] The current full node information in the status field of the node management cr is synchronized to the status field of the cluster management cr.
[0036] According to the device of the second aspect of the present application, the status field is an overall status list, and each element in the list is a node template and a node map.
[0037] In a third aspect, the present application shows an electronic device, comprising: a processor; a memory for storing processor executable instructions; wherein the processor is configured to execute the Operator-based k8s resource merging management method as described in any of the above aspects.
[0038] In a fourth aspect, the present application illustrates a non-temporary computer-readable storage medium. When the instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the Operator-based k8s resource merging management method as described in any of the above aspects.
[0039] In a fifth aspect, the present application illustrates a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device is enabled to execute the Operator-based k8s resource merging management method as described in any of the above aspects.
[0040] The technical solution provided by this application may have the following beneficial effects:
[0041] The Operator-based k8s resource merging management method of this application can merge and manage k8s resources, making the cr protocol of cluster lifecycle management as simple and maintainable as possible; and after the protocol is decoupled, it is necessary to realize fast communication between different components, and obtain accurate status information of node resources of the entire cluster, so that the lifecycle management of the entire cluster is more efficient and more fault-tolerant. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] Figure 1 This is a step flow chart of a k8s resource merging management method based on Operator in this application.
[0043] Figure 2 This is a sample of the spec protocol for cluster management cr in this application.
[0044] Figure 3 This is a sample of the spec protocol for node management cr in this application.
[0045] Figure 4 This is a sample of the status protocol for cluster management cr in this application.
[0046] Figure 5 This is a status protocol example of a node management cr in this application.
[0047] Figure 6 A schematic diagram of the interaction between the cluster management controller and the node management controller of this application.
[0048] Figure 7 This is a structural block diagram of a k8s resource merging management device based on Operator in this application.
[0049] Figure 8 It is a block diagram of an electronic device of the present application.
[0050] Fig. 9 It is a block diagram of a computer storage medium of the present application. DETAILED DESCRIPTION
[0051] 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.
[0052] Glossary:
[0053] Node pool: In a cluster application, it represents a collection of nodes of the same specification. Nodes of the same specification have the same CPU, memory, disk specifications, etc.
[0054] Kubernetes is a new distributed architecture solution based on container technology. It is an open source container cluster management system developed by Google, referred to as k8s.
[0055] Tuning: In a k8s application, a process of continuously trying to orchestrate a resource object to the final target state based on the current state.
[0056] IaaS: Infrastructure as a Service, a service model that provides IT facilities as a service through the Internet and charges users based on their actual usage or occupancy of resources.
[0057] Cr: short for custom resource, that is, user-defined resources. In the k8s ecosystem, users are allowed to customize resources and implement dedicated control loop logic to tune the state of cr for the custom resources.
[0058] Operator: The control loop logic used to tune the cr status in k8s. It exists in the form of a service or code program. It interacts with kube-apiserver to observe (watch) and update (update) the status of the corresponding cr, and continuously tunes the cr until the cr reaches the target state.
[0059] Reference Figure 1 , shows a flow chart of the steps of a k8s resource merging management method based on Operator of the present application, which can be applied to electronic devices, wherein the method can specifically include the following steps:
[0060] Step 101: Open a k8s cluster through the cluster management cr;
[0061] Step 102: After the k8s cluster is activated, create a node management cr;
[0062] Step 103: Perform node management on the k8s cluster through the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change;
[0063] Step 104: When the node management is completed, synchronize the current full node information to the cluster management cr;
[0064] Step 105: After the node information synchronization is completed, the node management cr is deleted.
[0065] In step 101, a k8s cluster is opened through the cluster management cr.
[0066] Specifically, in this embodiment, the cluster management cr is only responsible for cluster activation, and the specific applicable business scenario is: when activating a cluster, based on the node pool model, a series of nodes will be activated in batches according to certain specifications.
[0067] In step 102, after the k8s cluster is activated, a node management cr is created.
[0068] Specifically, in this embodiment, after the cluster management cr is opened and running, a node management cr is created to be responsible for node life cycle management after the cluster is opened.
[0069] In some embodiments, in the Operator-based k8s resource merging management method of the present application, the cluster management controller manages the cluster management cr to open the cluster tuning process; the node management controller manages the node management cr's tuning process for node life cycle management, and monitors the status of the node management cr in real time.
[0070] Specifically, in this embodiment, the CR is split from the original one into two: the first CR (cluster management CR) is only responsible for cluster activation, and this CR is tuned by a separate cluster management controller. The main logic of the cluster management controller tuning is to tune the cluster activation, including all processes involved in the cluster activation process; the second CR (node management CR) is responsible for node life cycle management after cluster activation, and a separate node management controller is responsible for managing its tuning process. At the same time, the cluster management controller responsible for cluster activation also monitors (watches) the status of the node management CR, so as to synchronize the node information to the cluster management CR and delete the node management CR when the node management CR tuning is completed.
[0071] In step 103, the node management of the k8s cluster is performed through the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change.
[0072] In some embodiments, step 103 in the operator-based k8s resource merging management method of the present application specifically includes:
[0073] For any node pool in the k8s cluster, expansion management is performed. When it is determined through the status of the node management cr that the node management cr has been created and the node can be expanded normally, the node management cr expands the corresponding node pool;
[0074] Perform specification configuration change management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created, the node management cr changes the specification configuration of the corresponding node pool;
[0075] Configuration change management is performed on any node in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the changed node exists, the node management cr performs configuration changes on the corresponding node.
[0076] Specifically, the operator-based k8s resource merging management method of this application meets the application of the following business scenarios:
[0077] 1) After the cluster is opened, you can operate node expansion based on any node pool, which essentially means continuing to open a series of new nodes based on the specifications configured in this node pool.
[0078] 2) After the cluster is activated, you can change the specification configuration of the node pool. The nodes that were triggered to be activated before the change are not affected by the configuration change, and the nodes that were triggered to be activated after the change use the new configuration.
[0079] 3) After the cluster is opened, it supports changing the configuration of any node individually. The change will trigger the corresponding node to re-trigger tuning until the changed configuration is successfully applied.
[0080] In step 104, when the node management is completed, the current full node information is synchronized to the cluster management cr.
[0081] In some embodiments, the operator-based k8s resource merging management method of the present application synchronizes the current full node information to the cluster management cr after completing the node management, specifically:
[0082] The current full node information in the status field of the node management cr is synchronized to the status field of the cluster management cr.
[0083] It should be noted that the k8s protocol includes two standard fields, namely the spec field and the status field. The spec field is used to fill in the cr input parameter, and the status field is used to fill in the cr tuning result. Figure 2-5 The following are some sample protocol fields. Figure 2 : The cluster management cr spec protocol sample indicates that when cluster management is enabled, multiple machines define the relevant fields in order to expand the capacity of newly created node management cr; Figure 3 : The node management cr spec protocol sample indicates the template used to monitor N node management crs, that is, the existing template; Figure 4: The cluster management cr status protocol sample indicates that by monitoring the node management cr, the latest status of the cluster management behavior is updated to the cluster management cr, which is also a list of node information; Figure 5 : The node management cr status protocol sample indicates that by monitoring the node management cr, the latest status of the node management behavior is updated to the cluster management cr.
[0084] In some embodiments, the status field in the Operator-based k8s resource merging management method of the present application is an overall status list, and each element in the list is a node template and a node map.
[0085] In some embodiments, the node management cr is created in the Operator-based k8s resource merging management method of the present application at the moment when the user clicks on the node expansion after each node configuration change.
[0086] In some embodiments, the Operator-based k8s resource merging management method of the present application also includes: performing node management on the k8s cluster based on the same protocol through the node management cr, the protocol includes field one and field two, the field one is the configuration of the node pool, and the field two is a list of node configurations to be expanded or changed.
[0087] Specifically, with regard to the node management cr, the business scenarios 1), 2), and 3) above can be abstracted into the same set of protocols. The node management cr is created at the moment of each node configuration application. This set of protocols is divided into two fields. Field one represents the configuration of the node pool (which can be understood as a set of node creation templates), and field two is a list of nodes that are about to be expanded and configured. This means that for the 2) business scenario, although the user can change the configuration of the node pool, the timing of triggering the creation of the node management cr is the time point when the user clicks on the expansion after the change. At this moment, there is no difference between the 1) and 2) business scenarios at the protocol level. For the 3) business scenario, since the node is defined as a list in the protocol, there is only one element in the list in this scenario. This protocol design is perfectly compatible with the three business scenarios 1), 2), and 3).
[0088] The specific interaction between the node management cr and the cluster management cr is as follows: Figure 6As shown in the figure, after the cluster management cr is tuned, the relevant information of the node will be filled in the status field of the cluster management cr. The protocol of this information is similar to the protocol when the node management cr is created, but the whole is a list, and each element of the list is a node template and a node map. When the node management cr is tuned, a dedicated state will be set and the node information will be saved in its own status field (the specific protocol is consistent with the protocol in the status field of the cluster management cr). When the cluster management controller watches that the node management cr has been set to this state, it obtains the relevant information of the node management from the status field of the node management cr, and performs a mapreduce operation on the status field of its own cr: the specific logic is to traverse the node information list of the node management cr, and determine whether the node template (the template used to monitor N node management crs, that is, the existing template) is consistent (the specific comparison can be implemented by calculating a hash value based on the configuration of cpu, memory, disk, etc.), if so, all the nodes of the node management are directly filled into the node map of the existing template. If there is no identical node template after comparison, the situation is handled separately. If the nodes managed by the node exist in the node map managed by the cluster, these nodes are removed from the cluster management node map, and then new elements are inserted into the overall status list (such as Figure 4 ebm in); if the node managed by the node does not exist in the node map of the cluster management, a new element is directly inserted into the overall status list. Through such processing, the cluster management cr will have real-time and full node information. After processing, the cluster management controller deletes the node management cr, and the node management life cycle officially ends. Subsequent cluster destruction and other scenarios can directly operate the cluster management cr. The node management cr is essentially a task form.
[0089] The above cluster management cr plays the role of process management in the whole construction process, which means that after the cluster management cr is created, the corresponding cluster management controller will derive and create the real node management cr based on the cluster management cr for the real expansion of the node, and another node management controller will be responsible for the real creation logic (for the configuration change of a certain node, it means updating the corresponding node management cr to trigger the existing node configuration, and the node management controller will realize the real configuration change logic). In this way, the whole construction process can be connected in series through the pipeline, and each node on the pipeline will realize the real business logic through the corresponding dedicated controller.
[0090] The method of the present application is described below with a specific embodiment:
[0091] Step 1: Open a k8s cluster based on the cluster management cr, and observe whether all IaaS resources involved in the k8s cluster, including nodes, can be successfully opened. After a period of time, observe whether the cluster can run normally.
[0092] Step 2: After the cluster is running, expand any node pool and observe whether the node management cr can be created and whether the node can be expanded normally. After the node expansion is completed, observe whether the status field in the cluster management cr is updated to the current full node information after the expansion. After the update, observe whether the node management cr has been deleted.
[0093] Step 3: Change the configuration of any node pool, and then re-execute the operation in step 2 to see whether it meets expectations.
[0094] Step 4: Change the CPU or memory configuration for any node, observe whether the node management cr can be created and whether the updated node exists, observe whether the node cr is updated, and wait for the node to be updated successfully. Observe whether the status field in the cluster management cr is updated to the current full node information after the change. After the update, observe whether the node management cr has been deleted.
[0095] 1) After the implementation is complete, clean up the cluster and all the resources it depends on.
[0096] The operator-based k8s resource merging management method of the present application realizes the splitting and design of the cluster lifecycle management protocol under multiple IaaS resource scenarios, greatly simplifies the original bloated cluster lifecycle management protocol, and greatly reduces the maintenance cost; adopts information synchronization and interaction between different management crs, so that the construction data in the form of tasks after the cluster is opened can be persisted, and this information can be obtained in a unified way, which is more convenient for the management of the cluster lifecycle. Therefore, the operator-based k8s resource merging management method of the present application can merge and manage k8s resources, making the cr protocol of cluster lifecycle management as simple and maintainable as possible; and after the protocol is decoupled, it is necessary to realize fast communication between different components, and obtain accurate status information of the node resources of the entire cluster, so that the lifecycle management of the entire cluster is more efficient and more fault-tolerant.
[0097] It should be noted that, for the sake of simplicity, the method embodiments are described as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the order of the actions described, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions involved are not necessarily required by the present application.
[0098] Reference Figure 7 , showing a structural block diagram of a k8s resource merging management device based on Operator of the present application, the device 700 includes:
[0099] The first processing module 701 is configured to open a k8s cluster through the cluster management cr;
[0100] The second processing module 702 is configured to create a node management cr when the k8s cluster is opened;
[0101] The third processing module 703 is configured to perform node management on the k8s cluster through the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change;
[0102] The fourth processing module 704 is configured to synchronize the current full node information to the cluster management cr when the node management is completed;
[0103] The fifth processing module 705 is configured to delete the node management cr when the node information synchronization is completed.
[0104] In some embodiments, the node management cr in the Operator-based k8s resource merging management device of the present application is created at the moment when the user clicks on the node expansion after each node configuration change.
[0105] In some embodiments, the Operator-based k8s resource merging management device of the present application performs node management on the k8s cluster based on the same protocol through the node management cr, and the protocol includes field one and field two, field one is the configuration of the node pool, and field two is a list of node configurations to be expanded or changed.
[0106] In some embodiments, in the first processing module 701 of the Operator-based k8s resource merging management device of the present application, the cluster management cr is managed by the cluster management controller to open the cluster tuning process; in the second processing module, the node management controller is used to manage the node management cr's tuning process for node life cycle management, and the status of the node management cr is monitored in real time.
[0107] In some embodiments, the third processing module 703 in the operator-based k8s resource merging management device of the present application specifically includes:
[0108] The expansion unit is configured to perform expansion management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the node can be expanded normally, the node management cr expands the corresponding node pool;
[0109] The first change unit is configured to perform specification configuration change management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created, the node management cr performs specification configuration change on the corresponding node pool;
[0110] The second change unit is configured to perform configuration change management on any node in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the changed node exists, the node management cr performs configuration changes on the corresponding node.
[0111] In some embodiments, the fourth processing module 704 in the operator-based k8s resource merging management device of the present application is specifically configured as follows:
[0112] The current full node information in the status field of the node management cr is synchronized to the status field of the cluster management cr.
[0113] In some embodiments, the status field in the Operator-based k8s resource merging management device of the present application is an overall status list, and each element in the list is a node template and a node map.
[0114] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.
[0115] Optionally, an embodiment of the present application further provides an electronic device, comprising: a processor, a memory, and a computer program stored in the memory and executable on the processor. When the computer program is executed by the processor, the various processes of the above-mentioned method embodiment are implemented, and the same technical effect can be achieved. To avoid repetition, it will not be described here.
[0116] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, each process of the above method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it is not repeated here. The computer-readable storage medium is, for example, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0117] Figure 8 800 is a block diagram of an electronic device 800 shown in the present application. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.
[0118] Reference Figure 8 , the electronic device 800 may include one or more of the following components: a processing component 802 , a memory 804 , a power component 806 , a multimedia component 808 , an audio component 810 , an input / output (I / O) interface 812 , a sensor component 814 , and a communication component 816 .
[0119] The processing component 802 generally controls the overall operation of the electronic device 800, such as operations associated with display, phone calls, data communications, camera operations, and recording operations. The processing component 802 may include one or more processors 820 to execute instructions to complete all or part of the steps of the above method. In addition, the processing component 802 may include one or more modules to facilitate the interaction between the processing component 802 and other components. For example, the processing component 802 may include a multimedia module to facilitate the interaction between the multimedia component 808 and the processing component 802.
[0120] The memory 804 is configured to store various types of data to support operations on the device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phone book data, messages, images, videos, etc. The memory 804 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk.
[0121] The power supply component 806 provides power to the various components of the electronic device 800. The power supply component 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power to the electronic device 800.
[0122] The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and the user. In some embodiments, the screen may include a liquid crystal display (LCD) and a touch panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from the user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundaries of the touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front camera and / or a rear camera. When the device 800 is in an operating mode, such as a shooting mode or a video mode, the front camera and / or the rear camera may receive external multimedia data. Each front camera and the rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
[0123] The audio component 810 is configured to output and / or input audio signals. For example, the audio component 810 includes a microphone (MIC), and when the electronic device 800 is in an operating mode, such as a call mode, a recording mode, and a voice recognition mode, the microphone is configured to receive an external audio signal. The received audio signal can be further stored in the memory 804 or sent via the communication component 816. In some embodiments, the audio component 810 also includes a speaker for outputting audio signals.
[0124] I / O interface 812 provides an interface between processing component 802 and peripheral interface modules, such as keyboards, click wheels, buttons, etc. These buttons may include but are not limited to: home button, volume button, start button, and lock button.
[0125] The sensor assembly 814 includes one or more sensors for providing various aspects of status assessment for the electronic device 800. For example, the sensor assembly 814 can detect the open / closed state of the device 800, the relative positioning of components, such as the display and keypad of the electronic device 800, and the sensor assembly 814 can also detect the position change of the electronic device 800 or a component of the electronic device 800, the presence or absence of contact between the user and the electronic device 800, the orientation or acceleration / deceleration of the electronic device 800, and the temperature change of the electronic device 800. The sensor assembly 814 may include a proximity sensor configured to detect the presence of nearby objects without any physical contact. The sensor assembly 814 may also include an optical sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an accelerometer, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
[0126] The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 can access a wireless network based on a communication standard, such as WiFi, a carrier network (such as 2G, 3G, 4G or 8G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast operation information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 also includes a near field communication (NFC) module to facilitate short-range communication. For example, the NFC module can be implemented based on radio frequency identification (RFID) technology, infrared data association (IrDA) technology, ultra-wideband (UWB) technology, Bluetooth (BT) technology and other technologies.
[0127] In an exemplary embodiment, the electronic device 800 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to perform the above methods.
[0128] In an exemplary embodiment, a non-transitory computer-readable storage medium including instructions is also provided, such as a memory 804 including instructions, and the instructions can be executed by a processor 820 of an electronic device 800 to perform the above method. For example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.
[0129] Fig. 9 19 is a block diagram of a computer storage medium 1900 shown in the present application. For example, the computer storage medium 1900 may be provided as a server.
[0130] Reference Fig. 9 , the computer storage medium 1900 includes a processing component 1922, which further includes one or more processors, and a memory resource represented by a memory 1932 for storing instructions, such as an application, that can be executed by the processing component 1922. The application stored in the memory 1932 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1922 is configured to execute instructions to perform the above method.
[0131] The computer storage medium 1900 may also include a power supply component 1926 configured to perform power management of the computer storage medium 1900, a wired or wireless network interface 1950 configured to connect the computer storage medium 1900 to a network, and an input / output (I / O) interface 1958. The computer storage medium 1900 may operate based on an operating system stored in the memory 1932, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™ or the like.
[0132] It should be noted that, in this article, the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.
[0133] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0134] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
[0135] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed in the present application can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0136] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.
[0137] In the embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0138] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0139] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
[0140] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as USB flash drives, mobile hard drives, ROM, RAM, magnetic disks, or optical disks.
[0141] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any person skilled in the art who is familiar with the present technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.
Claims
1. A k8s resource merging management method based on Operator, characterized in that: The method comprises: Open a k8s cluster through the cluster management cr; After the k8s cluster is activated, create a node management cr; The k8s cluster is managed by the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change; When the node management is completed, the current full node information is synchronized to the cluster management cr; When the node information synchronization is completed, the node management cr is deleted.
2. According to the operator-based k8s resource merging management method according to claim 1, it is characterized in that: The node management cr is created each time when the user clicks on node expansion after each node configuration change.
3. According to the operator-based k8s resource merging management method according to claim 2, it is characterized in that: The node management cr is used to manage nodes of the k8s cluster based on the same protocol. The protocol includes field one and field two. Field one is the configuration of the node pool, and field two is a list of node configurations to be expanded or changed.
4. According to the operator-based k8s resource merging management method according to claim 1, it is characterized in that: Also includes: The cluster management controller manages the cluster management cr to open the cluster tuning process; The node management controller manages the tuning process of the node management cr for the node life cycle management, and monitors the status of the node management cr in real time.
5. According to the operator-based k8s resource merging management method of claim 4, it is characterized in that: The node management of the k8s cluster is performed through the node management cr, specifically including: For any node pool in the k8s cluster, expansion management is performed. When it is determined through the status of the node management cr that the node management cr has been created and the node can be expanded normally, the node management cr expands the corresponding node pool; Perform specification configuration change management for any node pool in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created, the node management cr changes the specification configuration of the corresponding node pool; Configuration change management is performed on any node in the k8s cluster. When it is determined through the status of the node management cr that the node management cr has been created and the changed node exists, the node management cr performs configuration changes on the corresponding node.
6. According to the operator-based k8s resource merging management method of claim 5, it is characterized in that: When the node management is completed, the current full node information is synchronized to the cluster management cr, specifically: The current full node information in the status field of the node management cr is synchronized to the status field of the cluster management cr.
7. According to the operator-based k8s resource merging management method of claim 6, it is characterized in that: The status field is a whole status list, and each element in the list is a node template and a node map.
8. A k8s resource merging management device based on Operator, characterized in that: The device comprises: The first processing module is configured to open a k8s cluster through the cluster management cr; The second processing module is configured to create a node management cr when the k8s cluster is opened; The third processing module is configured to perform node management on the k8s cluster through the node management cr, wherein the node management includes: node pool expansion, node pool specification configuration change and node configuration change; The fourth processing module is configured to synchronize the current full node information to the cluster management cr when the node management is completed; The fifth processing module is configured to delete the node management cr when the node information synchronization is completed.
9. An electronic device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the computer program is executed by the processor, the operator-based k8s resource merging management method is implemented as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored on the computer-readable storage medium, and when the computer program is executed by the processor, the operator-based k8s resource merging management method is implemented as described in any one of claims 1 to 7.