Resource object changing method and device based on cloud platform cluster and computer equipment
By deploying verification server components and controller components in the cloud platform cluster, filtering and backing up resource objects, the risks of business interruption and data loss during configuration changes in Tianyi Cloud Operating System 4.0 are solved, and a safe and reliable configuration change processing is achieved.
Patent Information
- Application Number
- CN202411703759.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2044-11-26
AI Technical Summary
When the Tianyi Cloud Operating System 4.0 platform is configured to change, there are problems with high risk of business interruption and data loss.
By pre-deploying verification server components and controller components within a cloud platform cluster, obtain external requests and filter resource objects based on preset matching conditions. If the resource object meets the conditions, a tag container group is created to perform service configuration change processing; otherwise, configuration change processing is refused. In addition, the controller component listens for tagged container groups, performs backup processing, and deletes tagged container groups.
It effectively reduces the risk of business interruption and data loss, ensures that only configuration change operations that meet the requirements can be performed, avoid unauthorized or incorrect configuration changes, and prevents system failures or misconfigurations caused by improper configuration changes.
Smart Images

Figure CN119561833A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of cloud computing technology, and in particular to a resource object change method, device and computer equipment based on a cloud platform cluster. Background Art
[0002] Tianyi Cloud Operating System 4.0 platform is based on the container base kubernetes cloud platform cluster for hosting. From the perspective of architectural design, some advanced features of kubernetes can be used to meet the cloud host operation needs. By making reasonable use of these features, Tianyi Cloud Cloud Operating System 4.0 platform can well meet the diverse needs of cloud hosts in the operation process, such as resource scheduling, service management, etc., providing strong support for the stable operation and efficient service of cloud hosts.
[0003] However, the current Tianyi Cloud OS 4.0 platform has a high risk of increasing business interruption and data loss when making configuration changes. Summary of the invention
[0004] Based on this, it is necessary to provide a resource object change method, device and computer equipment based on a cloud platform cluster that can reduce the high risk of business interruption and data loss in response to the above technical problems.
[0005] In a first aspect, the present application provides a resource object change method based on a cloud platform cluster, comprising:
[0006] Obtain external requests based on the verification server component pre-deployed in the cloud platform cluster;
[0007] When the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object;
[0008] If the resource object involved in the external request does not meet the preset matching conditions, the service configuration change processing is rejected.
[0009] In one embodiment, the method further comprises:
[0010] Use the controller component pre-deployed in the cloud platform cluster for monitoring;
[0011] When the marked container group is monitored, the resource object is backed up through the controller component and the marked container group is deleted.
[0012] In one embodiment, the above-mentioned backing up the resource object through the controller component and deleting the marked container group includes:
[0013] Create a backup container group;
[0014] Backing up resource objects based on the backup container group;
[0015] When it is detected that the backup container group is in the backup completed state, the marked container group is deleted.
[0016] In one embodiment, the deployment process of the verification server component includes:
[0017] Packaging the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image;
[0018] The first image is deployed in the cloud platform cluster, and the verification server component is associated with the admission control mechanism of the cloud platform cluster, so that the verification server component runs in the cloud platform cluster.
[0019] In one embodiment, the deployment process of the controller component includes:
[0020] The pre-written controller component code and the information required for the operation of the controller component are packaged to obtain a portable second image;
[0021] The second image is deployed to the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
[0022] In one embodiment, the preset matching condition includes: whether the name information of the resource object matches the preset name, whether the time information is the cutover time period, and whether the environment variable is an allowed operation;
[0023] The resource objects include at least a computing module, a mirroring module, an authentication module, a host high-availability service module, a forwarding module and a cloud host component.
[0024] In a second aspect, the present application also provides a resource object changing device based on a cloud platform cluster, comprising:
[0025] A request acquisition module, used to acquire external requests based on a verification server component pre-deployed in the cloud platform cluster;
[0026] A change processing module is used to create a tag container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets the preset matching conditions;
[0027] The change rejection module is used to reject the service configuration change processing when the resource objects involved in the external request do not meet the preset matching conditions.
[0028] In a third aspect, the present application further provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0029] A request acquisition module, used to acquire external requests based on a verification server component pre-deployed in the cloud platform cluster;
[0030] A change processing module is used to create a tag container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets the preset matching conditions;
[0031] The change rejection module is used to reject the service configuration change processing when the resource objects involved in the external request do not meet the preset matching conditions.
[0032] In a fourth aspect, the present application further provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the following steps are implemented:
[0033] A request acquisition module, used to acquire external requests based on a verification server component pre-deployed in the cloud platform cluster;
[0034] A change processing module is used to create a tag container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets the preset matching conditions;
[0035] The change rejection module is used to reject the service configuration change processing when the resource objects involved in the external request do not meet the preset matching conditions.
[0036] In a fifth aspect, the present application further provides a computer program product, including a computer program, which implements the following steps when executed by a processor:
[0037] A request acquisition module, used to acquire external requests based on a verification server component pre-deployed in the cloud platform cluster;
[0038] A change processing module is used to create a tag container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets the preset matching conditions;
[0039] The change rejection module is used to reject the service configuration change processing when the resource objects involved in the external request do not meet the preset matching conditions.
[0040] The resource object change method, device and computer equipment based on the cloud platform cluster first obtain an external request based on the verification server component pre-deployed in the cloud platform cluster; when the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object; when the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected. In this method, when processing the external request, the verification server component first screens the resource object according to the preset matching condition. If the resource object meets the condition, the tag container group will be created and the service configuration change processing will be performed. In this way, by strictly verifying the resource object, it is ensured that only the configuration change operation that meets the requirements can be executed, thereby effectively avoiding unauthorized or erroneous configuration changes. For those resource objects that do not meet the preset matching conditions, the verification server component will reject the service configuration change request, which effectively prevents the occurrence of improper configuration changes, avoids system failures or wrong configurations caused by human operations, and reduces business interruptions caused by improper operations or unverified changes. Therefore, by obtaining external requests based on the verification server components pre-deployed in the cloud platform cluster and performing matching verification on the resource objects involved, the risk of business interruption and data loss can be significantly reduced. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 is an internal structure diagram of a computer device in one embodiment;
[0043] Figure 2 The figure is a flowchart of a resource object changing method based on a cloud platform cluster in one embodiment;
[0044] Figure 3 It is a flowchart of a resource object changing method based on a cloud platform cluster in another embodiment;
[0045] Figure 4 It is a flowchart of a resource object changing method based on a cloud platform cluster in another embodiment;
[0046] Figure 5 It is a flowchart of a resource object changing method based on a cloud platform cluster in another embodiment;
[0047] Figure 6 It is a flowchart of a resource object changing method based on a cloud platform cluster in another embodiment;
[0048] Figure 7 It is a structural block diagram of a resource object changing device based on a cloud platform cluster in one embodiment. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0050] With the rapid development of cloud computing technology and the surge in business volume, how to ensure the efficient, secure and stable operation of cloud platforms has become a key task for enterprises and platform operators. The Tianyi Cloud Operating System 4.0 platform is based on the containerized architecture of the Kubernetes (K8S) cluster, which fully utilizes the advanced features of K8S, such as automated management, elastic scaling, container scheduling, resource isolation and load balancing. These features not only support large-scale cloud host resource management, but also efficiently meet the needs of different types of businesses. However, in actual operation, the Tianyi Cloud platform still faces a high risk of business interruption and data loss when making configuration changes. For example, when service configuration changes are prohibited during the non-cutover window, improper human operation may cause system failures and major impacts; while in the cutover window, there may be problems such as untimely backup and inconsistency between change operations and backup data. These problems may cause the change rollback to fail or fail to recover to the expected state, thereby affecting business continuity and the stability of the cloud platform.
[0051] Based on this, the present application proposes a resource object change scheme based on a cloud platform cluster, firstly obtaining an external request based on a verification server component pre-deployed in the cloud platform cluster; when the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object; when the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected. In this scheme, when processing an external request, the verification server component first screens the resource object according to the preset matching condition. If the resource object meets the condition, a tag container group will be created and the service configuration change processing will be performed. In this way, by strictly verifying the resource object, it is ensured that only configuration change operations that meet the requirements can be executed, thereby effectively avoiding unauthorized or erroneous configuration changes. For those resource objects that do not meet the preset matching conditions, the verification server component will reject the service configuration change request, which effectively prevents the occurrence of improper configuration changes, avoids system failures or wrong configurations caused by human operations, and reduces business interruptions caused by improper operations or unverified changes. Therefore, by obtaining external requests based on the verification server components pre-deployed in the cloud platform cluster and performing matching verification on the resource objects involved, the risk of business interruption and data loss can be significantly reduced.
[0052] In an exemplary embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as shown in FIG. Figure 1 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data in the resource object change process based on the cloud platform cluster. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a resource object change method based on the cloud platform cluster is implemented.
[0053] Those skilled in the art will understand that Figure 1The structure shown in the figure is only a block diagram of a part 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.
[0054] In an exemplary embodiment, Figure 2 As shown, a resource object change method based on a cloud platform cluster is provided, and the method is applied to Figure 1 The computer device in the example is used to illustrate, including the following steps 201 to 203. Among them:
[0055] Step 201 , obtaining an external request based on a verification server component pre-deployed in a cloud platform cluster.
[0056] Among them, the verification server component is the Webhook verification server.
[0057] In an embodiment of the present application, a Webhook verification server is deployed in K8S to receive external requests; wherein the external request is a Hypertext Transfer Protocol (HTTP) request.
[0058] In some embodiments, in Kubernetes, the webhook validation server receives external requests through a configuration-changing webhook configuration (MutatingWebhookConfiguration) or a validation-type webhook configuration (ValidatingWebhookConfiguration) resource. These configuration resources point to the service address of the webhook validation server and send requests to the webhook validation server when the resource changes.
[0059] Among them, MutatingWebhookConfiguration is used to automatically modify resource objects. When a resource object is created or updated, Kubernetes sends the request to the changing Webhook. The Webhook can dynamically modify the resource object according to the configuration and then continue to process the request.
[0060] ValidatingWebhookConfiguration is used to validate resource objects. When creating or updating resources, Kubernetes sends the request to the validating Webhook, which checks the validity of the resource configuration according to the specified rules.
[0061] Step 202: When the resource object involved in the external request meets the preset matching condition, a marking container group is created to perform service configuration change processing on the resource object.
[0062] In an embodiment of the present application, the webhook verification server automatically scans the resource objects in the Kubernetes cluster and filters out the resource objects that meet the specific name rules (for example, the resource objects may contain a specific prefix, suffix, or a resource that meets the regular expression in the name). These resource objects that meet the requirements can be added to the monitoring list of the webhook verification server to facilitate further change control and verification operations.
[0063] The webhook validation server defines a validation function to process external HTTP requests. The main responsibility of the validate function is to verify whether the change operation complies with predefined rules and conditions based on the request content. When an external request arrives, the webhook validation server calls the validate function and passes the resource object information in the request to the function for processing. Usually, the HTTP request content contains detailed information about the resource object (such as resource type, name, status, tags, etc.), as well as the change operation that the requester wants to perform.
[0064] The validate function first performs a preliminary match check on the resource object in the request to ensure that the name of the resource object complies with the preset naming rules. For example, the name of the resource object may need to contain certain keywords, comply with specific naming conventions, or meet business logic requirements.
[0065] In addition to name matching, the validate function can further check the state of the resource object (such as whether the resource object is running), resource type (such as whether it is a specific workload type), and access permissions based on other conditions.
[0066] If the resource object meets these conditions, it means that the requested resource meets the processing requirements and further configuration change operations are allowed. When the resource object in the request passes the validation function, the webhook validation server automatically creates a dedicated tag container group, namely the tag pod, to carry this configuration change operation. The tag pod uses labels to mark and isolate the change process, thereby ensuring that the entire change process is traceable and controllable. In the tag pod, the configuration change operation is executed step by step according to the request content.
[0067] Step 203: If the resource object involved in the external request does not meet the preset matching condition, the service configuration change process is rejected.
[0068] In an embodiment of the present application, when the resource object involved in the external request does not meet the preset matching conditions, the service configuration change processing is rejected.
[0069] In some embodiments, if the validate function finds that the name or status of the resource object does not meet the preset conditions, the verification server will immediately reject the request and will not create a tag container group.
[0070] In this case, the webhook verification server returns a rejection response with detailed rejection reasons. For example, it can clearly indicate that the name of the resource object does not comply with the rules, or the current resource state does not support such changes. This rejection mechanism can effectively block non-compliant external requests to avoid unnecessary interference with the core resources of the cloud platform cluster.
[0071] In the above-mentioned resource object change method based on the cloud platform cluster, firstly, an external request is obtained based on the verification server component pre-deployed in the cloud platform cluster; when the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object; when the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected. In this method, when processing the external request, the verification server component will first filter the resource object according to the preset matching condition. If the resource object meets the condition, the tag container group will be created and the service configuration change processing will be performed. In this way, by strictly verifying the resource object, it is ensured that only the configuration change operation that meets the requirements can be executed, thereby effectively avoiding unauthorized or erroneous configuration changes. For those resource objects that do not meet the preset matching conditions, the verification server component will reject the service configuration change request, which effectively prevents the occurrence of improper configuration changes, avoids system failures or wrong configurations caused by human operations, and reduces business interruptions caused by improper operations or unverified changes. Therefore, by obtaining external requests based on the verification server components pre-deployed in the cloud platform cluster and performing matching verification on the resource objects involved, the risk of business interruption and data loss can be significantly reduced.
[0072] In an exemplary embodiment, Figure 3 As shown, the above method further includes step 301 to step 302. Among them:
[0073] Step 301, using the controller component pre-deployed in the cloud platform cluster to monitor.
[0074] Among them, the controller component is Controller.
[0075] In the embodiment of the present application, in the cloud platform cluster, the automatic management and backup operation of the marked Pod is realized by the pre-deployed Controller. The Controller monitors the marked Pod in the Webhook verification server in real time.
[0076] Step 302: When a marked container group is detected, the resource object is backed up by the controller component and the marked container group is deleted.
[0077] In an embodiment of the present application, when the Controller detects the presence of a marked pod in the cluster, the backup process is started. The presence of the marked pod indicates that a specific resource object needs to be backed up, and the Controller performs the backup task according to a preset backup strategy. Among them, the preset backup strategy may include backing up data, configuration files, databases, etc. stored in the marked pod, so that key data and application configurations are securely stored.
[0078] During the execution of the backup task, the Controller will continuously monitor the status of the task to ensure that the backup process is completed smoothly. When the backup operation is successfully completed and the backup completion conditions are met, the Controller will delete the marked Pod to release cluster resources to avoid repeated backup or resource waste.
[0079] In the above embodiment, in the cloud platform cluster, the status of the marked container group can be continuously monitored through the pre-deployed controller component, thereby realizing the automatic backup and management of resource objects. In addition, by deleting the marked pod, the Controller can also prevent backup conflicts caused by misoperation. When making service configuration changes or other operations, backup can serve as the last line of defense for data protection to ensure that important data is not lost during the change process. If the change fails or a problem occurs, the backup can quickly restore the system, avoiding major impacts caused by data loss and ensuring the continuity and stability of the business.
[0080] In an exemplary embodiment, Figure 4 As shown, the above-mentioned resource object is backed up by the controller component and the marked container group is deleted, including steps 401 to 403. Among them:
[0081] Step 401: Create a backup container group.
[0082] The backup container group is the backup pod.
[0083] In the embodiment of the present application, the Controller creates a backup Pod for performing the backup task to ensure that the backup of the resource object can be performed independently and efficiently. The backup Pod is a temporary task execution container responsible for processing data backup operations related to the resource object.
[0084] Step 402: Back up the resource object based on the backup container group.
[0085] In the embodiment of the present application, after detecting the marked Pod, the Controller starts the backup process. The backup task contains a backup code that has been encapsulated into a container image. The Controller will create a backup Pod to run the image and perform resource backup operations including gostack. After the backup task is completed, the status of the backup Pod will be marked as completed.
[0086] Step 403: When it is detected that the backup container group is in the backup completed state, the marked container group is deleted.
[0087] In the embodiment of the present application, the Controller continuously monitors the status change of the backup Pod, and when it detects that the backup Pod status changes to Completed, it triggers a cleanup operation. At this time, the Controller deletes the initial marked Pod to prevent duplicate backup or resource occupation.
[0088] In some embodiments, the Controller returns a backup completion status to Kubernetes, notifying Kubernetes that the backup has completed successfully and allowing subsequent operations to proceed.
[0089] In the above embodiment, when the resource object configuration needs to be changed or backed up, the backup processing flow can ensure that a complete backup is performed before the change, thereby effectively avoiding the risk of business data loss. The existence of the backup container group as a protection measure enables rapid data recovery in the event of improper operation or configuration change failure, avoiding the impact on business continuity and data integrity. After the backup task is completed, deleting the marked container group can effectively release cluster resources and prevent unnecessary resource occupation. This resource cleanup mechanism helps maintain the healthy utilization of the computing and storage resources of the cloud platform cluster, avoids resource waste, and enables the cloud platform cluster to more efficiently support other tasks and needs.
[0090] In an exemplary embodiment, Figure 5 As shown, the deployment process of the above verification server component includes steps 501 to 502. Among them:
[0091] Step 501 : Packaging the pre-written verification server component code and the information required for the operation of the verification server component to obtain a portable first image.
[0092] In the embodiment of the present application, the pre-written verification server component code and the information required for the operation of the verification server component are packaged and processed to obtain a portable first image.
[0093] In some embodiments, first, the core code of the Webhook verification server is written in Go language, so that it has three key functions. First, the resource objects in Kubernetes are collected to ensure that the Webhook verification server can perceive the current status of the resource objects in real time. Second, the Webhook verification server needs to record the reception time of the request object and read the environment variables to help obtain the time and environment variables when the request is processed. Third, the Webhook verification server needs to be able to match the object name or label according to the request content to determine whether the resource object meets the preset conditions. If the conditions are met, the Webhook verification server will automatically create a marked Pod as a trigger for performing backup and subsequent operations.
[0094] Next, write the image building file Dockerfile to package the Webhook verification server component code and its dependent operating environment into a containerized platform Docker image. In the Dockerfile, you need to select a suitable base image, install the dependencies of the Go code, configure the operating environment, etc. to ensure the independence and portability of the image. After packaging, push the first image to an image repository, such as DockerHub or a private image repository, so that it can be directly pulled and deployed in the Kubernetes cluster later. Among them, Dockerfile is a configuration file for building a Docker container image, which contains instructions for all steps such as starting from the base image, installing the required software, copying application files, and configuring environment variables. Dockerfile can automatically generate application images to ensure the consistency of the environment and the portability of the application. Docker is an open source containerization platform that can package, distribute, and run applications. In Docker, the application and all its dependencies are packaged in a portable container image and then run on any system that supports Docker.
[0095] Step 502: deploy the first image into the cloud platform cluster, and associate the verification server component with the admission control mechanism of the cloud platform cluster, so that the verification server component runs in the cloud platform cluster.
[0096] In an embodiment of the present application, the first image is deployed in a cloud platform cluster, and the verification server component and the admission control mechanism of the cloud platform cluster are associated with each other so that the verification server component runs in the cloud platform cluster.
[0097] In some embodiments, a deployment Deployment and a service Service of a Webhook verification server are created in Kubernetes. Deployment is responsible for managing the labeled Pod of the Webhook server to ensure its continuous operation and scalability in Kubernetes; while Service provides a stable network entry so that other components in Kubernetes can communicate with the Webhook verification server. Through the combination of Deployment and Service, the Webhook verification server can run smoothly in the cluster and has fault recovery capabilities. Deployment is a controller object used in Kubernetes to manage stateless applications. It is responsible for operations such as application deployment, scaling, and updating. By defining a Deployment, users can specify the number of application replicas, container images, startup parameters, and other configurations. Deployment monitors and maintains a specified number of Pod replicas to ensure high availability of the application, supports rolling updates and rollback functions, and facilitates safe upgrades of applications. Service is a resource object in Kubernetes used to expose a group of Pods as a unified network service.
[0098] Finally, create a ValidatingWebhookConfiguration in the Kubernetes cluster to integrate the Webhook validation server into the Kubernetes admission control process.
[0099] ValidatingWebhookConfiguration defines which resource operations in the cluster need to be reviewed by the Webhook validation server, such as resource creation or modification operations. The rules in ValidatingWebhookConfiguration automatically forward matching requests to the Webhook validation server for validation and screening to ensure that the request meets the preset conditions before it is allowed to continue execution in Kubernetes.
[0100] In the above embodiment, by packaging the verification server as a portable first image, rapid deployment in different environments becomes possible. This method ensures the consistent operation of the verification server components in various environments, which not only simplifies the installation and configuration process, but also supports rapid expansion and migration, and facilitates unified management in multi-cluster scenarios. By packaging the verification server in a container image manner, version control and flexible allocation of resources can be performed at any time.
[0101] In an exemplary embodiment, Figure 6 As shown, the deployment process of the controller component includes steps 601 to 602. Among them:
[0102] Step 601: Packaging the pre-written controller component code and the information required for the controller component to run to obtain a portable second image.
[0103] In an embodiment of the present application, the pre-written controller component code and the configuration information required for operation are packaged to create a second image that is easy to port. The second image contains the controller code logic and all its required dependencies.
[0104] Step 602: deploy the second image to the cloud platform cluster so that the controller component runs in the cloud platform cluster.
[0105] In the embodiment of the present application, the constructed second image is deployed to Kubernetes, so that the Controller can perform the monitoring task in the cluster environment. At this time, the Controller will monitor the status of the marked pod in the cluster in real time through the configured event notification mechanism.
[0106] In some embodiments, a controller component image is built by creating a Dockerfile and pushing the image to an image repository to ensure that each node in Kubernetes can access and run the image. A specific backup code is written in Go language to process the backup operation of resource object files such as Gostack, and then the backup code is packaged as an image and uploaded to the environment.
[0107] Finally, create Kubernetes Deployment and Service resource objects to deploy the Controller in Kubernetes. Deployment ensures the continuous operation and high availability of the Pod, while Service provides a fixed access point to facilitate communication between other components and the Controller.
[0108] The Controller monitors in real time in Kubernetes whether there is a marked pod. When the marked pod is detected, the Controller triggers the backup process. In the backup process, the Controller starts a backup Pod to run the backup task. The backup Pod runs based on the backup code image written in advance and is responsible for performing the specified backup operations (such as backing up resources such as Gostack files, etc.). After the backup Pod completes the task, its status will be automatically marked as completed.
[0109] When the Controller detects that the backup Pod status has changed to completed, it deletes the original marked Pod to ensure that the backup process is performed only once and to avoid resource waste caused by repeated backups. At the same time, the Controller returns a backup completion notification to allow Kubernetes to proceed to the next step.
[0110] In the above embodiment, the controller component is packaged as a portable image so that it can be easily deployed in different environments, ensuring that the controller can run consistently in different cloud platform clusters. Through the image management tool, different versions of the controller component can be managed in a versioned manner, which makes version rollback more convenient. If a problem occurs during the update or maintenance process, it can be quickly restored to the previous version, ensuring the continuity and reliability of cluster management and reducing the possibility of abnormal risks.
[0111] In an exemplary embodiment, the preset matching condition includes: whether the name information of the resource object matches the preset name, whether the time information is a cutover time period, and whether the environment variable is an allowed operation.
[0112] The resource objects include at least a computing module, a mirroring module, an authentication module, a host high-availability service module, a forwarding module and a cloud host component.
[0113] In a cloud platform cluster, one of the key tasks of the Webhook verification server is to verify and process external requests. In this process, the resource object needs to meet specific preset matching conditions before the operation can continue. These preset matching conditions include the following aspects:
[0114] (1) Whether the name information of the resource object conforms to the preset name
[0115] The Webhook verification server needs to check whether the name of the resource object conforms to the preset rules or format. The name of the resource object may contain specific symbols to indicate the module or task to which it belongs. If the resource object name does not conform to the preset rules, the Webhook verification server will not continue to process the object. For example, the Webhook verification server requires that the resource name of the computing module must conform to a certain naming convention before it can be further processed. Among them, these resource objects include the computing module gostack, the image module glance, the authentication module gostone, the host high availability service module hostha, the forwarding module sdk, and the cloud host component etcd.
[0116] (2) Whether the time information is the cutover time period
[0117] The operation of resource objects is limited to a specific time period, such as verifying whether the time is between 0 and 6 o'clock. When the Webhook verification server receives an external request, it needs to verify whether the time information of the resource object matches the predetermined cutover time period. If the time does not match, the Webhook verification server will reject the operation to avoid sensitive resource processing operations at inappropriate times. The cutover time period usually refers to the window period when a major system switch or update is performed.
[0118] (3) Whether the environment variable is allowed to operate
[0119] The webhook verification server also needs to verify whether the environment variables are allowed. For example, for gostack, even if its operation time is not in a specific time period, it can still process service configuration changes.
[0120] In the above embodiment, by screening the preset matching conditions, it is possible to ensure that the resources meet the requirements before configuration and operation. This can avoid erroneous operations caused by object name mismatch or operation time not within the specified time period, improve the accuracy of the operation, and ensure the standardization of resource management.
[0121] According to some embodiments of the present application, a resource object change method based on a cloud platform cluster is provided. Taking the method applied to a computer device as an example for explanation, the method may include the following steps:
[0122] Step 1: Packaging the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image.
[0123] Step 2: deploy the first image to the cloud platform cluster, and associate the verification server component with the admission control mechanism of the cloud platform cluster so that the verification server component runs in the cloud platform cluster.
[0124] Step 3: Packaging the pre-written controller component code and the information required for the controller component to run to obtain a portable second image.
[0125] Step 4: deploy the second image to the cloud platform cluster so that the controller component runs in the cloud platform cluster.
[0126] Step 5: Obtain external requests based on the verification server component pre-deployed in the cloud platform cluster.
[0127] Step 6: If the resource object involved in the external request meets the preset matching conditions, create a tag container group to perform service configuration change processing on the resource object. The preset matching conditions include: whether the name information of the resource object meets the preset name, whether the time information is the cutover time period, and whether the environment variable is a permitted operation. The resource object includes at least a computing module, an image module, an authentication module, a host high availability service module, a forwarding module, and a cloud host component.
[0128] Step 7: If the resource object involved in the external request does not meet the preset matching condition, the service configuration change process is rejected.
[0129] Step 8: Use the controller component pre-deployed in the cloud platform cluster for monitoring.
[0130] Step 9: When a marked container group is detected, a backup container group is created.
[0131] Step 10: Back up the resource object based on the backup container group.
[0132] Step 11: When it is detected that the backup container group is in the backup completed state, the marked container group is deleted.
[0133] It should be understood that, although the steps in the flowcharts involved in the above embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above embodiments may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0134] Based on the same inventive concept, the embodiment of the present application also provides a resource object change device based on a cloud platform cluster for implementing the resource object change method based on a cloud platform cluster involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the resource object change device based on a cloud platform cluster provided below can refer to the limitations of the resource object change method based on a cloud platform cluster above, and will not be repeated here.
[0135] In an exemplary embodiment, Figure 7 As shown, a resource object change device based on a cloud platform cluster is provided, comprising: a request acquisition module 701, a change processing module 702 and a change rejection module 703, wherein:
[0136] The request acquisition module 701 is used to acquire external requests based on the verification server component pre-deployed in the cloud platform cluster;
[0137] The change processing module 702 is used to create a tag container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets the preset matching condition;
[0138] The change rejection module 703 is used to reject the service configuration change process when the resource object involved in the external request does not meet the preset matching condition.
[0139] In an exemplary embodiment, the above device further includes:
[0140] A monitoring module 704 is used to monitor using a controller component pre-deployed in the cloud platform cluster;
[0141] The deletion module 705 is used to perform backup processing on the resource object through the controller component and delete the marked container group when the marked container group is monitored.
[0142] In an exemplary embodiment, the deletion module is specifically used to create a backup container group; perform backup processing on resource objects based on the backup container group; and delete the marked container group when it is detected that the backup container group is in a backup completed state.
[0143] In an exemplary embodiment, the above device further includes:
[0144] A first packaging module 706 is used to package the pre-written verification server component code and the information required for the verification server component to run, and obtain a portable first image;
[0145] The first deployment module 707 is used to deploy the first image into the cloud platform cluster, and associate the verification server component with the admission control mechanism of the cloud platform cluster so that the verification server component runs in the cloud platform cluster.
[0146] In an exemplary embodiment, the above device further includes:
[0147] The second packaging module 708 is used to package the pre-written controller component code and the information required for the controller component to run, and obtain a portable second image;
[0148] The second deployment module 709 is used to deploy the second image to the cloud platform cluster so that the controller component runs in the cloud platform cluster.
[0149] Each module in the resource object change device based on the cloud platform cluster can be implemented in whole or in part by software, hardware and their combination. Each module can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory in the computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0150] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0151] Obtain external requests based on the verification server component pre-deployed in the cloud platform cluster;
[0152] When the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object;
[0153] If the resource object involved in the external request does not meet the preset matching conditions, the service configuration change processing is rejected.
[0154] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0155] Use the controller component pre-deployed in the cloud platform cluster for monitoring;
[0156] When the marked container group is monitored, the resource object is backed up through the controller component and the marked container group is deleted.
[0157] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0158] Create a backup container group;
[0159] Backing up resource objects based on the backup container group;
[0160] When it is detected that the backup container group is in the backup completion state, the marked container group is deleted.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] Packaging the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image;
[0163] The first image is deployed in the cloud platform cluster, and the verification server component is associated with the admission control mechanism of the cloud platform cluster, so that the verification server component runs in the cloud platform cluster.
[0164] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0165] The pre-written controller component code and the information required for the operation of the controller component are packaged to obtain a portable second image;
[0166] The second image is deployed to the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
[0167] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0168] Obtain external requests based on the verification server component pre-deployed in the cloud platform cluster;
[0169] When the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object;
[0170] If the resource object involved in the external request does not meet the preset matching conditions, the service configuration change processing is rejected.
[0171] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0172] Use the controller component pre-deployed in the cloud platform cluster for monitoring;
[0173] When the marked container group is monitored, the resource object is backed up through the controller component and the marked container group is deleted.
[0174] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0175] Create a backup container group;
[0176] Backing up resource objects based on the backup container group;
[0177] When it is detected that the backup container group is in the backup completion state, the marked container group is deleted.
[0178] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0179] Packaging the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image;
[0180] The first image is deployed in the cloud platform cluster, and the verification server component is associated with the admission control mechanism of the cloud platform cluster, so that the verification server component runs in the cloud platform cluster.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] The pre-written controller component code and the information required for the operation of the controller component are packaged to obtain a portable second image;
[0183] The second image is deployed to the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
[0184] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0185] Obtain external requests based on the verification server component pre-deployed in the cloud platform cluster;
[0186] When the resource object involved in the external request meets the preset matching condition, a tag container group is created to perform service configuration change processing on the resource object;
[0187] If the resource object involved in the external request does not meet the preset matching conditions, the service configuration change processing is rejected.
[0188] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0189] Use the controller component pre-deployed in the cloud platform cluster for monitoring;
[0190] When the marked container group is monitored, the resource object is backed up through the controller component and the marked container group is deleted.
[0191] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0192] Create a backup container group;
[0193] Backing up resource objects based on the backup container group;
[0194] When it is detected that the backup container group is in the backup completed state, the marked container group is deleted.
[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0196] Packaging the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image;
[0197] The first image is deployed in the cloud platform cluster, and the verification server component is associated with the admission control mechanism of the cloud platform cluster, so that the verification server component runs in the cloud platform cluster.
[0198] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0199] The pre-written controller component code and the information required for the operation of the controller component are packaged to obtain a portable second image;
[0200] The second image is deployed to the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
[0201] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0202] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0203] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A resource object change method based on a cloud platform cluster, characterized in that: The method comprises: Obtain external requests based on the verification server component pre-deployed in the cloud platform cluster; When the resource object involved in the external request meets the preset matching condition, a marking container group is created to perform service configuration change processing on the resource object; When the resource object involved in the external request does not satisfy the preset matching condition, the service configuration change process is rejected.
2. The method according to claim 1, characterized in that The method further comprises: Use the controller component pre-deployed in the cloud platform cluster for monitoring; In the case of monitoring the marked container group, the resource object is backed up by the controller component, and the marked container group is deleted.
3. The method according to claim 2, characterized in that The backing up of the resource object by the controller component and deleting the marked container group includes: Create a backup container group; Performing backup processing on the resource object based on the backup container group; When it is detected that the status of the backup container group is backup completed, the marked container group is deleted.
4. The method according to claim 1, characterized in that: The deployment process of the verification server component includes: Packaging the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image; The first image is deployed in the cloud platform cluster, and the verification server component is associated with the admission control mechanism of the cloud platform cluster, so that the verification server component runs in the cloud platform cluster.
5. The method according to claim 2, characterized in that: The deployment process of the controller component includes: Packaging the pre-written controller component code and the information required for the operation of the controller component to obtain a portable second image; The second image is deployed to the cloud platform cluster so that the controller component runs in the cloud platform cluster.
6. The method according to any one of claims 1 to 5, characterized in that: The preset matching conditions include: whether the name information of the resource object conforms to the preset name, whether the time information is the cutover time period, and whether the environment variable is a permitted operation; The resource object includes at least a computing module, a mirroring module, an authentication module, a host high-availability service module, a forwarding module and a cloud host component.
7. A resource object changing device based on a cloud platform cluster, characterized in that: The device comprises: A request acquisition module, used to acquire external requests based on a verification server component pre-deployed in the cloud platform cluster; A change processing module, used to create a marking container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets the preset matching condition; The change rejection module is used to reject the service configuration change processing when the resource object involved in the external request does not meet the preset matching condition.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Resource deployment method and device, electronic equipment and storage medium
CN113448686A
Cloud resource scheduling method and system based on Kubernetes
CN113918270A
Cluster management method and device and electronic equipment
CN115291891A
Cloud resource configuration updating method and system, transformation and distribution node, electronic equipment and medium
CN116208491A
Verification method and device for application to be deployed to Kubernetes cluster and electronic equipment
CN118520444A