Cloud platform cluster-based resource object change method and device, and computer equipment
By employing a verification server and controller component screening and backup mechanism within the cloud platform cluster, the risk of business interruption and data loss during configuration changes on the China Telecom Cloud Operating System 4.0 platform has been mitigated, enabling secure and controllable changes to resource objects.
Patent Information
- Application Number
- CN202411703759.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-26
- Publication Date
- 2026-01-16
- Estimated Expiration
- 2044-11-26
AI Technical Summary
The China Telecom Cloud Operating System 4.0 platform has a high risk of service interruption and data loss when configuration changes are made.
By deploying a verification server component within the cloud platform cluster, external requests are obtained and resource objects are filtered according to preset matching conditions. If the conditions are met, a marked container group is created for configuration changes; otherwise, the request is rejected. At the same time, the controller component listens and performs backup processing.
This effectively avoids unauthorized or erroneous configuration changes, reduces the risk of business interruption and data loss, and ensures the security and controllability of configuration changes.
Smart Images

Figure CN119561833B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and particularly relates to a resource object changing method and device based on a cloud platform cluster and a computer device. BACKGROUND
[0002] The Tianyi cloud operating system 4.0 platform is based on a container base kubernetes cloud platform cluster and can use some advanced features of kubernetes to meet the cloud host operation requirements in terms of architecture design. By reasonably using these features, the Tianyi cloud operating system 4.0 platform can well meet the diversified needs of cloud hosts in the operation process, such as resource scheduling, service management, etc., and provides strong support for the stable operation and efficient service of cloud hosts.
[0003] However, the Tianyi cloud operating system 4.0 platform currently has the problem of high risk of business interruption and data loss when performing configuration changes. SUMMARY
[0004] Therefore, it is necessary to provide a resource object changing method and device based on a cloud platform cluster and a computer device capable of reducing the problem of high risk of business interruption and data loss.
[0005] In a first aspect, the present application provides a resource object changing method based on a cloud platform cluster, comprising:
[0006] obtaining an external request based on a verification server component pre-deployed in the cloud platform cluster;
[0007] creating a marker container group to perform service configuration change processing on the resource object when the resource object involved in the external request meets a preset matching condition;
[0008] refusing the service configuration change processing when the resource object involved in the external request does not meet the preset matching condition.
[0009] In one of the embodiments, the method further comprises:
[0010] listening by using a controller component pre-deployed in the cloud platform cluster;
[0011] performing backup processing on the resource object by the controller component and deleting the marker container group when the marker container group is listened to.
[0012] In one of the embodiments, the backup processing on the resource object by the controller component and the deletion of the marker container group comprise:
[0013] creating a backup container group;
[0014] Backup the resource object based on the backup container group;
[0015] In the case of detecting that the state of the backup container group is backup completed, delete the label container group.
[0016] In one embodiment, the deployment process of the above-mentioned verification server component includes:
[0017] The pre-written verification server component code and the information required for the verification server component to run are packaged to obtain a portable first image;
[0018] The first image is deployed to the cloud platform cluster, and the verification server component and the admission control mechanism of the cloud platform cluster are associated to enable the verification server component to run in the cloud platform cluster.
[0019] In one embodiment, the deployment process of the above-mentioned controller component includes:
[0020] The pre-written controller component code and the information required for the controller component to run are packaged to obtain a portable second image;
[0021] The second image is deployed to the cloud platform cluster to enable the controller component to run in the cloud platform cluster.
[0022] In one embodiment, the above-mentioned preset matching condition includes whether the name information of the resource object meets the preset name, whether the time information is a switchover time period, and whether the environment variable is an allowed operation;
[0023] The resource object at least includes a computing module, an image module, an authentication module, a host high-availability service module, a forwarding module, and a cloud host component.
[0024] In a second aspect, the application also provides a resource object changing device based on a cloud platform cluster, which includes:
[0025] The request acquisition module is configured to acquire an external request based on a verification server component pre-deployed in the cloud platform cluster;
[0026] The change processing module is configured to create a label container group to perform service configuration change processing on the resource object if the resource object involved in the external request meets the preset matching condition;
[0027] The change processing module is configured to create a label container group to perform service configuration change processing on the resource object if the resource object involved in the external request meets the preset matching condition;
[0028] In a third aspect, the present application also provides a computer device comprising a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0029] The request obtaining module is configured to obtain an external request based on a verification server component pre-deployed in the cloud platform cluster.
[0030] The change processing module is configured to create a marked container group to perform service configuration change processing on the resource object if the resource object involved in the external request meets the preset matching condition.
[0031] The change rejection module is configured to reject the service configuration change processing if the resource object involved in the external request does not meet the preset matching condition.
[0032] In a fourth aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the following steps:
[0033] The request obtaining module is configured to obtain an external request based on a verification server component pre-deployed in the cloud platform cluster.
[0034] The change processing module is configured to create a marked container group to perform service configuration change processing on the resource object if the resource object involved in the external request meets the preset matching condition.
[0035] The change rejection module is configured to reject the service configuration change processing if the resource object involved in the external request does not meet the preset matching condition.
[0036] In a fifth aspect, the present application also provides a computer program product comprising a computer program, the computer program being executed by a processor to implement the following steps:
[0037] The request obtaining module is configured to obtain an external request based on a verification server component pre-deployed in the cloud platform cluster.
[0038] The change processing module is configured to create a marked container group to perform service configuration change processing on the resource object if the resource object involved in the external request meets the preset matching condition.
[0039] The change rejection module is configured to reject the service configuration change processing if the resource object involved in the external request does not meet the preset matching condition.
[0040] The cloud platform cluster-based resource object change method, device and computer equipment obtain an external request based on a verification server component pre-deployed in the cloud platform cluster. If the resource object involved in the external request meets a preset matching condition, a marker container group is created to perform service configuration change processing on the resource object. If the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected. In the 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 marker container group is created and the service configuration change processing is performed. In this way, by strictly verifying the resource object, it is ensured that only the configuration change operation meeting the requirement can be performed, thereby effectively avoiding unauthorized or incorrect configuration changes. For the resource object that does not meet the preset matching condition, the verification server component rejects the service configuration change request, which effectively prevents improper configuration changes and avoids system failure or incorrect configuration caused by human operation, and reduces business interruption caused by improper operation or change without verification. Therefore, by obtaining the external request based on the verification server component pre-deployed in the cloud platform cluster and matching the resource object involved, the risk of business interruption and data loss can be significantly reduced. BRIEF DESCRIPTION OF DRAWINGS
[0041] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other related drawings can also be obtained without creative labor on the basis of these drawings.
[0042] Figure 1 An internal structure diagram of a computer device in an embodiment;
[0043] Figure 2 A flowchart of a cloud platform cluster-based resource object change method in an embodiment;
[0044] Figure 3 A flowchart of a cloud platform cluster-based resource object change method in another embodiment;
[0045] Figure 4 A flowchart of a cloud platform cluster-based resource object change method in another embodiment;
[0046] Figure 5 A flowchart of a cloud platform cluster-based resource object change method in another embodiment;
[0047] Figure 6 FIG. 2 is a flowchart of a cloud platform cluster-based resource object change method according to another embodiment;
[0048] Figure 7 FIG. 3 is a structural block diagram of a cloud platform cluster-based resource object change device according to an embodiment. DETAILED DESCRIPTION
[0049] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not 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 the cloud platform has become a key task for enterprises and platform operators. The Tianyi cloud operating system 4.0 platform is based on the containerization architecture of 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 high risks 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 failure and significant impact; and during the cutover window, there may be problems such as untimely backup, inconsistency between change operation and backup data, etc., which may lead to change rollback failure or failure to recover to the expected state, thereby affecting business continuity and the stability of the cloud platform.
[0051] Based on this, the application provides a resource object change scheme based on a cloud platform cluster. First, an external request is acquired based on a verification server component pre-deployed in the cloud platform cluster. If the resource object involved in the external request meets a preset matching condition, a marked container group is created to perform service configuration change processing on the resource object. If 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 a preset matching condition. If the resource object meets the condition, a marked container group is created and service configuration change processing is performed. In this way, by strictly verifying the resource object, it is ensured that only a configuration change operation meeting the requirements can be performed, thereby effectively avoiding unauthorized or incorrect configuration changes. For resource objects that do not meet the preset matching condition, the verification server component rejects the service configuration change request, which effectively prevents improper configuration changes and avoids system failures or incorrect configurations caused by human operation, and reduces business interruption caused by improper operation or change without verification. Therefore, by acquiring an external request based on a verification server component pre-deployed in the cloud platform cluster and matching the resource object involved, the risk of business interruption and data loss can be significantly reduced.
[0052] In an exemplary embodiment, a computer device, which can be a server, is provided, and an internal structure diagram of the computer device can be as shown in Figure 1 The computer device includes a processor, a memory, an input / output interface (I / O), and a communication interface. 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. The processor of the computer device is configured 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 running the operating system and the computer program in the non-volatile storage medium. The database of the computer device is configured to store data in a resource object change process based on a cloud platform cluster. The input / output interface of the computer device is configured to exchange information between the processor and external devices. The communication interface of the computer device is configured to communicate with external terminals through a network connection. The computer program is executed by the processor to implement a resource object change method based on a cloud platform cluster.
[0053] Those skilled in the art can understand that Figure 1The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can 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, as shown in Figure 2 , a cloud platform cluster-based resource object change method is provided. The method is applied to a computer device as shown in Figure 1 , and includes 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 a Webhook verification server.
[0057] In the embodiments of the present application, a Webhook verification server is deployed in K8S for receiving external requests; wherein the external request is a Hypertext Transfer Protocol (HTTP) request.
[0058] In some embodiments, in Kubernetes, the Webhook verification server receives external requests through Mutating Webhook Configuration (MutatingWebhookConfiguration) or Validating Webhook Configuration (ValidatingWebhookConfiguration) resources. These configuration resources point to the service address of the Webhook verification server, and send requests to the Webhook verification server when the resources change.
[0059] Among them, MutatingWebhookConfiguration is used to automatically modify resource objects. When a resource object is created or updated, Kubernetes sends a request to the mutating 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 verify resource objects. When creating or updating a resource, Kubernetes sends a request to the validating webhook, which checks the validity of the resource configuration according to the specified rules.
[0061] Step 202, in the case that the resource object involved in the external request meets the preset matching condition, a label container group is created to perform service configuration change processing on the resource object.
[0062] In the embodiments of the present application, the Webhook verification server automatically scans the resource objects in the Kubernetes cluster, and filters out resource objects that meet certain name rules (for example, resource objects whose names contain certain prefixes, suffixes, or conform to regular expressions). These qualified resource objects can be added to the monitoring list of the Webhook verification server, facilitating further change control and verification operations.
[0063] The Webhook verification server defines a validation function validate to process external incoming HTTP requests. The main responsibility of the validate function is to verify whether the change operation meets the predefined rules and conditions according to the request content. When an external request arrives, the Webhook verification server calls the validate function to pass the resource object information in the request to the function for processing. Generally, the HTTP request content contains detailed information of the resource object (such as resource type, name, status, label, etc.), and the change operation that the requester wants to perform.
[0064] The validate function first performs a preliminary matching check on the resource object in the request to ensure that the name of the resource object meets the preset naming rules. For example, the name of the resource object may need to contain certain keywords, conform to certain naming specifications, or meet business logic requirements.
[0065] In addition to name matching, the validate function can further check the state of the resource object (for example, whether the resource object is running), the resource type (for example, whether it is a specific workload type), and access permissions, etc.
[0066] If the resource object meets these conditions, it means that the resource of the request meets the processing requirements and allows further configuration change operations. When the resource object in the request passes the validation of the validate function, the Webhook verification server automatically creates a dedicated label container group, i.e., a label pod, to carry out this configuration change operation. The label pod is marked and isolated by labels to ensure that the entire change process is traceable and controllable. In the label pod, the configuration change operation is executed step by step according to the request content.
[0067] Step 203, in the case that the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected.
[0068] In the embodiments of the present application, if the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected.
[0069] In some embodiments, if the validate function finds that the name or state of the resource object does not meet the preset condition, the validation server will immediately reject the request and will not create a marker container group.
[0070] In this case, the webhook validation server returns a rejection response containing detailed rejection reasons. For example, it can be explicitly stated that the name of the resource object does not meet the rules, or the current resource state does not support such changes. This rejection mechanism can effectively prevent non-compliant external requests from interfering with the core resources of the cloud platform cluster.
[0071] In the above method for changing resource objects based on a cloud platform cluster, the external request is first obtained based on a validation server component pre-deployed in the cloud platform cluster; if the resource object involved in the external request meets the preset matching condition, a marker container group is created to perform service configuration change processing on the resource object; and if 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 an external request, the validation server component first filters the resource object according to the preset matching condition. If the resource object meets the condition, a marker container group is created and service configuration change processing is performed. In this way, by strictly verifying the resource object, only configuration change operations that meet the requirements can be executed, thereby effectively avoiding unauthorized or incorrect configuration changes. For resource objects that do not meet the preset matching condition, the validation server component rejects the service configuration change request, which effectively prevents improper configuration changes and avoids system failures or errors caused by human operation, reducing business interruptions caused by improper operation or changes that have not been verified. Therefore, by obtaining external requests based on a validation server component pre-deployed in the cloud platform cluster and matching the resource objects involved, the risk of business interruption and data loss can be significantly reduced.
[0072] In an exemplary embodiment, as shown in Figure 3 the above method further includes steps 301 to 302. Wherein:
[0073] Step 301, using a controller component pre-deployed in the cloud platform cluster for listening.
[0074] The controller component is Controller.
[0075] In the embodiments of the present application, in the cloud platform cluster, the pre-deployed Controller is used to realize the automatic management and backup operation of the labeled Pod. The Controller listens to the labeled Pod in the Webhook verification server in real time.
[0076] In step 302, when the labeled container group is listened to, the resource object is processed for backup by the controller component, and the labeled container group is deleted.
[0077] In the embodiments of the present application, when the Controller detects the existence of the labeled pod in the cluster, the backup process is started. The existence of the labeled Pod indicates that the specific resource object needs to be backed up, and the Controller will execute the backup task according to the preset backup strategy. The preset backup strategy can include backing up the data, configuration file, database and the like stored in the labeled pod, so that the key data and application configuration are safely stored.
[0078] During the execution of the backup task, the Controller continuously monitors the state of the task to ensure that the backup process is successfully completed. When the backup operation is successfully ended and the conditions for completing the backup are met, the Controller deletes the labeled Pod to release the cluster resources and avoid repeated backup or resource waste.
[0079] In the above embodiments, in the cloud platform cluster, the pre-deployed controller component can continuously listen to the state of the labeled container group, thereby realizing the automatic backup and management of the resource object. In addition, by deleting the labeled pod, the Controller can also prevent backup conflicts caused by misoperation. When service configuration changes or other operations are performed, the backup can serve as the last line of defense for data protection, ensuring 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 significant impact caused by data loss and ensuring the continuity and stability of the business.
[0080] In an exemplary embodiment, as shown in Figure 4 The above backup processing of the resource object by the controller component and deletion of the labeled container group include steps 401 to 403. Among them:
[0081] Step 401, creating a backup container group.
[0082] Among them, the backup container group is a backup pod.
[0083] In this embodiment, the Controller creates a backup Pod to perform backup tasks, ensuring that backups of resource objects can be performed independently and efficiently. This backup Pod is a temporary task execution container responsible for handling data backup operations related to resource objects.
[0084] Step 402: Back up the resource objects based on the backup container group.
[0085] In this embodiment, after detecting a marked Pod, the Controller initiates a backup process. The backup task includes backup code packaged into a container image. The Controller creates a backup Pod to run this image and performs resource backup operations, including gostack. Once the backup task is complete, the backup Pod's status is marked as "Completed".
[0086] Step 403: If the status of the backup container group is detected as backup complete, delete the marked container group.
[0087] In this embodiment, the Controller continuously monitors the state changes of the backup Pod. When it detects that the backup Pod's state has changed to Completed, it triggers a cleanup operation. At this time, the Controller deletes the initially marked Pod to prevent duplicate backups or resource consumption.
[0088] In some embodiments, the Controller returns a backup completion status to Kubernetes, notifying Kubernetes that the backup has been successfully completed and allowing subsequent operations to continue.
[0089] In the above embodiments, when resource object configurations need to be changed or backed up, the backup process ensures a complete backup is performed before the change, effectively avoiding the risk of business data loss. The existence of backup container groups serves as a protective measure, enabling rapid data recovery in case of improper operation or configuration change failures, avoiding impact on business continuity and data integrity. After the backup task is completed, deleting the marked container group effectively releases cluster resources, preventing unnecessary resource occupation. This resource cleanup mechanism helps maintain the healthy utilization of computing and storage resources in the cloud platform cluster, avoiding resource waste and enabling the cloud platform cluster to more efficiently support other tasks and needs.
[0090] In one exemplary embodiment, such as Figure 5 As shown, the deployment process of the above-mentioned verification server component includes steps 501 to 502. Wherein:
[0091] Step 501, package the pre-written verification server component code and the information required for the verification server component to run, to obtain a portable first image.
[0092] In the embodiments of the present application, the pre-written verification server component code and the information required for the verification server component to run are packaged to obtain a portable first image.
[0093] In some embodiments, first, the core code of the Webhook verification server is written in Go language, which has three key functions. First, the resource objects in Kubernetes are collected to ensure that the Webhook verification server can perceive the current state of the resource objects in real time. Second, the Webhook verification server needs to record the receiving time of the request object and read the environment variables to help obtain the time and environment variables when processing the request. 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 marker Pod as a trigger for executing backup and subsequent operations.
[0094] Then, the image building file Dockerfile is written to package the Webhook verification server component code and its dependent running environment into a containerized platform Docker image. In the Dockerfile, the appropriate base image needs to be selected, the dependencies of the Go code need to be installed, and the running environment needs to be configured, etc., to ensure the independence and portability of the image. After packaging, the first image is pushed to the image repository, such as DockerHub or a private image repository, so that it can be directly pulled and deployed in the Kubernetes cluster later. The Dockerfile is a configuration file used to build Docker container images, which contains instructions for all steps from the base image, installation of required software, copying of application files, configuration of environment variables, etc. Through the Dockerfile, the image of the application program can be automatically generated 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 application programs. In Docker, the application and all its dependencies are packaged in a portable container image, which can then be run on any system that supports Docker.
[0095] Step 502, 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.
[0096] In the embodiments of the present application, the first mirror is deployed into the cloud platform cluster, and the verification server component is associated with the admission control mechanism of the cloud platform cluster for running the verification server component in the cloud platform cluster.
[0097] In some embodiments, a Deployment and a Service of the Webhook verification server are created in Kubernetes. The Deployment is responsible for managing the labeled Pods of the Webhook server, ensuring its continuous operation and scalability in Kubernetes; and the Service provides a stable network entry, enabling other components within Kubernetes to 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 capability. Deployment is a controller object in Kubernetes used to manage stateless applications, responsible for deployment, scaling, and updating of applications. By defining 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 application high availability, supports rolling updates and rollback functions, and facilitates safe application upgrades. Service is a resource object in Kubernetes that exposes a group of Pods as a unified network service.
[0098] Finally, ValidatingWebhookConfiguration is created in the Kubernetes cluster to integrate the Webhook verification server into the admission control process of Kubernetes.
[0099] ValidatingWebhookConfiguration defines which resource operations in the cluster need to be audited by the Webhook verification server, such as resource creation or modification operations. The rules in ValidatingWebhookConfiguration automatically forward matching requests to the Webhook verification server for verification and screening, ensuring that the request meets the preset conditions before allowing it to continue execution in Kubernetes.
[0100] In the above embodiments, the verification server is packaged as a portable first image, which enables rapid deployment in different environments. This approach ensures consistent operation of the verification server components in various environments, simplifies the installation and configuration process, supports rapid expansion and migration, and facilitates unified management in multi-cluster scenarios. By packaging the verification server as a container image, version control and flexible resource allocation can be performed at any time.
[0101] In an exemplary embodiment, as shown in Figure 6 the deployment of the above controller component includes steps 601-602. Among them:
[0102] Step 601, the pre-written controller component code and the information required for the controller component to run are packaged to obtain a portable second image.
[0103] In the embodiments of the present application, the pre-written controller component code and the configuration information required for running are packaged to create a portable second image. The second image contains the controller code logic and all dependencies required.
[0104] Step 602, deploy the second image to the cloud platform cluster to enable the controller component to run in the cloud platform cluster.
[0105] In the embodiments of the present application, the built second image is deployed to Kubernetes, enabling Controller to perform listening tasks in the cluster environment. At this time, Controller will listen to the state of the marked pod in the cluster in real time through the configured event notification mechanism.
[0106] In some embodiments, the image of the controller component is built by creating a Dockerfile, and the image is pushed to the image repository to ensure that each node in Kubernetes can access and run the image. The specific backup code is written in Go language to handle the backup operation of Gostack resource object files, 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 Controller in Kubernetes. Deployment ensures the continuous operation and high availability of the pod, while Service provides a fixed access entry for other components to communicate with Controller.
[0108] Controller listens to the existence of the marker pod in real time in Kubernetes. When the marker pod is detected to exist, Controller triggers the backup process. In the backup process, Controller starts a backup Pod to run the backup task, and the backup Pod runs based on the backup code image written in advance, which is responsible for executing the specified backup operation (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 Controller detects that the status of the backup Pod becomes completed, it will delete the original marker pod to ensure that the backup process is only executed once and to avoid resource waste caused by repeated backups. At the same time, Controller returns a backup completion notification to allow Kubernetes to perform the next operation.
[0110] In the above embodiment, packaging the controller component into a portable image makes it easy to deploy to different environments, ensuring that the controller can consistently run in different cloud platform clusters. Through the image management tool, different versions of the controller component can be versioned, which makes version rollback more convenient. If there is a problem during updating or maintenance, it can quickly recover 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 above-mentioned preset matching conditions include whether the name information of the resource object conforms to the preset name, whether the time information is a switchover time period, and whether the environment variable is an allowed operation.
[0112] 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.
[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 certain preset matching conditions to continue to perform operations, and 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 validation server needs to check whether the name of the resource object meets the preset rules or formats. The name of the resource object can contain specific symbols indicating the module or task to which it belongs. If the resource object name does not meet the predetermined rules, the webhook validation server will not continue processing the object. For example, the webhook validation server requires that the resource name of the computing module must meet certain specific naming conventions to be further processed. 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 a switchover time period
[0117] The operation of the resource object is limited to a specific time period, for example, verifying whether the time is between 0 and 6 o'clock. When the webhook validation server receives an external request, it needs to verify whether the time information of the resource object matches the predetermined switchover time period. If the time does not match, the webhook validation server will reject the operation to avoid sensitive resource processing operations at inappropriate times. The switchover time period usually refers to the window period when major system switching or updating is performed.
[0118] (3) Whether the environment variable is allowed to operate
[0119] The webhook validation server also needs to verify whether the environment variable is allowed to operate. For example, for gostack, even if its operation time is not within a specific time period, it can still be processed for service configuration changes.
[0120] In the above embodiments, by screening the preset matching conditions, it can be ensured that the resource configuration and operation meet the requirements before the operation, which can avoid misoperations caused by mismatched object names or operation times 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, it can include the following steps:
[0122] Step 1: Pack 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 to enable the verification server component to run 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, deploying the second image to the cloud platform cluster to enable the controller component to run in the cloud platform cluster.
[0126] Step 5, obtaining an external request based on the verification server component pre-deployed in the cloud platform cluster.
[0127] Step 6, in the case where the resource object involved in the external request meets the preset matching condition, creating a marker container group to perform service configuration change processing on the resource object. The preset matching condition includes whether the name information of the resource object meets the preset name, whether the time information is a switchover time period, and whether the environment variable is an allowed operation. The resource object at least includes 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, in the case where the resource object involved in the external request does not meet the preset matching condition, rejecting the service configuration change processing.
[0129] Step 8, listening using the controller component pre-deployed in the cloud platform cluster.
[0130] Step 9, in the case where a marker container group is detected, creating a backup container group.
[0131] Step 10, performing backup processing on the resource object based on the backup container group.
[0132] Step 11, in the case where it is detected that the state of the backup container group is backup complete, deleting the marker container group.
[0133] It should be understood that although each step in the flowchart involved in each of the above embodiments is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other sequences. Moreover, at least part of the steps in the flowchart involved in each of the above embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution sequence of these steps or stages is not necessarily sequential, but can be executed in rotation or alternation with at least part of other steps or steps or stages in other steps.
[0134] Based on the same inventive concept, the embodiment of the present application further provides a cloud platform cluster-based resource object change device for implementing the cloud platform cluster-based resource object change method. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, and therefore the specific limitations in one or more cloud platform cluster-based resource object change device embodiments provided below can refer to the limitations of the cloud platform cluster-based resource object change method described above, which will not be repeated here.
[0135] In one exemplary embodiment, as shown in Figure 7 a cloud platform cluster-based resource object change device is provided, comprising: a request acquisition module 701, a change processing module 702, and a rejection change module 703, wherein:
[0136] The request acquisition module 701 is configured to acquire an external request based on a verification server component pre-deployed in the cloud platform cluster.
[0137] The change processing module 702 is configured to create a marker container group to perform service configuration change processing on the resource object if the resource object involved in the external request meets a preset matching condition.
[0138] The rejection change module 703 is configured to reject the service configuration change processing if the resource object involved in the external request does not meet the preset matching condition.
[0139] In one exemplary embodiment, the above device further comprises:
[0140] The listening module 704 is configured to listen to the controller component pre-deployed in the cloud platform cluster.
[0141] The deletion module 705 is configured to perform backup processing on the resource object through the controller component and delete the marker container group if the marker container group is listened to.
[0142] In one exemplary embodiment, the above deletion module is specifically configured to create a backup container group, perform backup processing on the resource object based on the backup container group, and delete the marker container group if it is detected that the state of the backup container group is backup completed.
[0143] In one exemplary embodiment, the above device further comprises:
[0144] The first packaging module 706 is configured to package the pre-written verification server component code and the information required for the verification server component to run to obtain a portable first image.
[0145] The first deployment module 707 is configured to deploy the first image into the cloud platform cluster, and associate the verification server component with the access 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 apparatus further includes:
[0147] The second packaging module 708 is configured to package the pre-written controller component code and information required for running the controller component, to obtain a portable second image.
[0148] The second deployment module 709 is configured to deploy the second image into the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
[0149] The modules in the cloud platform cluster-based resource object changing apparatus can be realized by software, hardware, or a combination thereof, in whole or in part. The modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in a computer device in software form, so as to be called and executed by the processor to perform the operations corresponding to the modules.
[0150] In an exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the following steps when executing the computer program:
[0151] Obtaining an external request based on a verification server component pre-deployed in a cloud platform cluster;
[0152] In a case where a resource object involved in the external request meets a preset matching condition, creating a marker container group to perform service configuration changing processing on the resource object;
[0153] In a case where the resource object involved in the external request does not meet the preset matching condition, rejecting the service configuration changing processing.
[0154] In an embodiment, the processor further implements the following steps when executing the computer program:
[0155] Listening by using a controller component pre-deployed in the cloud platform cluster;
[0156] In a case where a marker container group is listened to, performing backup processing on the resource object by using the controller component, and deleting the marker container group.
[0157] In an embodiment, the processor further implements the following steps when executing the computer program:
[0158] Creating a backup container group;
[0159] Backup the resource object based on the backup container group;
[0160] In a case where it is detected that the state of the backup container group is backup completed, delete the marker container group.
[0161] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0162] Packaging the pre-written verification server component code and information required for the verification server component to run, to obtain a portable first image;
[0163] Deploying the first image to the cloud platform cluster, and associating the verification server component and the admission control mechanism of the cloud platform cluster for processing, so that the verification server component runs in the cloud platform cluster.
[0164] In one embodiment, the processor, when executing the computer program, also implements the following steps:
[0165] Packaging the pre-written controller component code and information required for the controller component to run, to obtain a portable second image;
[0166] Deploying the second image 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, which stores a computer program, and the computer program, when executed by a processor, implements the following steps:
[0168] Based on the verification server component pre-deployed in the cloud platform cluster, an external request is obtained;
[0169] In a case where the resource object involved in the external request meets a preset matching condition, a marker container group is created to perform service configuration change processing on the resource object;
[0170] In a case where the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected.
[0171] In one embodiment, the computer program, when executed by the processor, also implements the following steps:
[0172] Using the controller component pre-deployed in the cloud platform cluster for listening;
[0173] In a case where the marker container group is listened to, the resource object is backed up through the controller component, and the marker container group is deleted.
[0174] In one embodiment, the computer program, when executed by the processor, also implements the following steps:
[0175] Create a backup container group;
[0176] Backup the resource object based on the backup container group;
[0177] In the case where it is detected that the state of the backup container group is backup complete, delete the marker container group.
[0178] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps:
[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] Deploying the first image to the cloud platform cluster, and associating 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.
[0181] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps:
[0182] Packaging the pre-written controller component code and the information required for the controller component to run, to obtain a portable second image;
[0183] Deploying the second image 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 that, when executed by a processor, implements the following steps:
[0185] Based on the verification server component pre-deployed in the cloud platform cluster, an external request is obtained;
[0186] In the case where the resource object involved in the external request meets the preset matching condition, a marker container group is created to perform service configuration change processing on the resource object;
[0187] In the case where the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected.
[0188] In one embodiment, the computer program is further implemented when executed by the processor to perform the following steps:
[0189] Using the controller component pre-deployed in the cloud platform cluster to listen;
[0190] In the case where the marker container group is listened to, the resource object is backed up through the controller component, and the marker container group is deleted.
[0191] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0192] creating a backup container group;
[0193] performing backup processing on the resource object based on the backup container group;
[0194] deleting the marked container group in a case where it is detected that the state of the backup container group is backup completed.
[0195] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0196] packaging the pre-written verification server component code and information required for the verification server component to run, to obtain a portable first image;
[0197] deploying the first image to the cloud platform cluster, and associating the verification server component and the admission control mechanism of the cloud platform cluster for processing, so that the verification server component runs in the cloud platform cluster.
[0198] In one embodiment, the computer program, when executed by the processor, further implements the following steps:
[0199] packaging the pre-written controller component code and information required for the controller component to run, to obtain a portable second image;
[0200] deploying the second image to the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
[0201] Those skilled 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. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to 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. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.
[0202] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.
[0203] The above-described embodiments are merely illustrative of several embodiments of the present application, which are described in more detail and in a specific manner, but should not be construed as limiting the scope of the patent of the present application. It should be noted that, for those of ordinary skill in the art, several modifications 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 should be subject to the appended claims.
Claims
1. A resource object change method based on a cloud platform cluster, characterized in that, The method comprises: An external request is acquired based on a verification server component pre-deployed in a cloud platform cluster; In a case where a resource object involved in the external request meets a preset matching condition, a marker container group is created to perform service configuration change processing on the resource object; In a case where the resource object involved in the external request does not meet the preset matching condition, the service configuration change processing is rejected; A controller component pre-deployed in the cloud platform cluster is listened to; In a case where the marker container group is listened to, the resource object is backed up by the controller component, and the marker container group is deleted; The deployment process of the controller component comprises: A controller component code pre-written and information required for running the controller component are packaged to obtain a portable second image; The second image is deployed into the cloud platform cluster, so that the controller component runs in the cloud platform cluster.
2. The method of claim 1, wherein, The backup processing of the resource object by the controller component and the deletion of the marker container group comprise: A backup container group is created; The backup container group is used to back up the resource object; In a case where it is detected that the backup container group is in a backup completion state, the marker container group is deleted.
3. The method of claim 1, wherein, The deployment process of the verification server component comprises: A verification server component code pre-written and information required for running the verification server component are packaged to obtain a portable first image; The first image is deployed into the cloud platform cluster, and the verification server component and an admission control mechanism of the cloud platform cluster are associated to enable the verification server component to run in the cloud platform cluster.
4. The method according to any one of claims 1 to 3, characterized in that, The preset matching condition comprises whether name information of the resource object meets a preset name, whether time information is a switchover time period, and whether an environment variable is an allowed operation; The resource object at least comprises a computing module, an image module, an authentication module, a host high-availability service module, a forwarding module and a cloud host component. 5.A resource object changing device based on a cloud platform cluster, characterized in that, The device comprises: A request acquisition module is configured to acquire an external request based on a verification server component pre-deployed in a cloud platform cluster; A change processing module is configured to create a marker container group to perform service configuration change processing on a resource object in a case where the resource object involved in the external request meets a preset matching condition; A rejection change module is configured to reject the service configuration change processing in a case where the resource object involved in the external request does not meet the preset matching condition; A listening module is configured to listen to a controller component pre-deployed in the cloud platform cluster; A deletion module is configured to back up the resource object by the controller component and delete the marker container group in a case where the marker container group is listened to; A second packaging module is configured to package a controller component code pre-written and information required for running the controller component to obtain a portable second image; a second deployment module configured to deploy the second image into the cloud platform cluster to cause a controller component to run in the cloud platform cluster. 6.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-5 when the computer program is executed by the processor. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4.
7. A computer-readable storage medium having stored thereon a computer program, characterized in that The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4.
8. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 4.
Citation Information
Patent Citations
Cloud resource scheduling method and system based on Kubernetes
CN113918270A
Verification method and device for application to be deployed to Kubernetes cluster and electronic equipment
CN118520444A