Management node capacity expansion method and device, electronic equipment and medium
By expanding the management nodes of CKE instances, updating certificates and network configurations, adding etcd nodes and performing health checks, the unavailability problem caused by a single point of failure is solved and the tenant's user experience is improved.
Patent Information
- Application Number
- CN202410027408.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-08
- Publication Date
- 2025-07-08
AI Technical Summary
When the CKE instance has only one management node, if a failure causes it to be unavailable, the tenant cannot manage the CKE instance and its applications, which will affect the user experience. The existing technology lacks effective scaling methods to reduce the risk of single point of failure.
When receiving a scaling request, update the certificate configuration information of the management node to be scaling, add management nodes and etcd nodes, and perform health checks, update domain name resolution and network configuration, feedback the scaling success information, and ensure the health status of the etcd cluster.
It effectively reduces the unavailability risk caused by single point of failure of CKE instances, and ensures the availability of management nodes and the user experience of tenants.
Smart Images

Figure CN120281632A_ABST
Abstract
Description
Technical Field
[0001] This application relates to cloud native technology, and in particular to a method, device, electronic device and medium for expanding the management node. Background Art
[0002] With the increasing maturity of cloud native technology, as the best implementation path for enterprise digital transformation, the cloud native architecture has gradually become the mainstream application deployment method in various industries. How to ensure the reliability of cloud native large-scale applications has become an urgent problem to be solved in the development of the cloud native industry.
[0003] In this context, the stability of the CKE (Chinaunicom Kubernetes Engine) instance is also very important. When there is only one management node in the CKE instance, if the management node becomes unavailable due to some reasons (such as host machine downtime, fat container failure, etc.), the tenant will not be able to manage the CKE instance and the applications in the CKE instance, which is not conducive to improving the tenant's usage experience.
[0004] To solve the above problems, it is necessary to expand the management node of the CKE instance, hoping that when one of the management nodes fails, the tenant can still manage the CKE instance. Therefore, there is an urgent need for a method to expand the CKE instance to perform expansion processing on the CKE instance to reduce the risk of service unavailability caused by single point of failure. Summary of the Invention
[0005] This application provides a method, device, electronic device and medium for expanding the management node, so as to provide a method for expanding the management node of the CKE instance and reduce the risk of service unavailability.
[0006] On the one hand, this application provides a method for expanding the management node, and the method includes:
[0007] When receiving an expansion request, update the certificate configuration information of the management node to be expanded of the target CKE instance; the expansion request is triggered when there is no management node other than the management node to be expanded in the target CKE instance, and the certificate configuration information includes the server certificate of the management node to be expanded;
[0008] Add a management node and an etcd node corresponding to the management node, and perform a health check on the etcd cluster after adding the etcd node to obtain a check result; the check result is used to indicate whether the state of the etcd cluster is a healthy state;
[0009] If the inspection result indicates that the status of the etcd cluster is healthy, update the domain name resolution configuration information of the management node in the corresponding computing node, as well as the network configuration information of the management node in the preset network plugin, and feedback the successful expansion information; the preset network plugin is used to enable network interoperability among the management nodes in the target CKE instance.
[0010] In another possible implementation manner, the method further includes:
[0011] If the inspection result indicates that the status of the etcd cluster is not healthy, obtain error information by monitoring the running log of the etcd cluster, and perform automatic repair based on the error information;
[0012] Repeat the step of performing a health check on the etcd cluster after adding the etcd node to obtain an inspection result until an inspection result indicating that the status of the etcd cluster is healthy is obtained.
[0013] In another possible implementation manner, before updating the domain name resolution configuration information of the management node in the corresponding computing node, the method further includes:
[0014] Determine whether the number of management nodes reaches the target number indicated by the expansion request;
[0015] If so, determine to update the domain name resolution configuration of the management node in the corresponding computing node;
[0016] Otherwise, repeat the steps of adding a management node and the etcd node corresponding to the management node until the number of management nodes reaches the target number indicated by the expansion request.
[0017] In another possible implementation manner, before feedbacking the successful expansion information, the method further includes:
[0018] Restart kubelet and kube-proxy to query the status of the target CKE instance. When the status of the target CKE instance is running, determine to feedback the successful expansion information.
[0019] In another possible implementation manner, adding the management node includes:
[0020] Add the management node by calling the scheduler interface of the target CKE instance through a shell script.
[0021] In another possible implementation manner, updating the certificate configuration information of the management node to be expanded in the target CKE instance includes:
[0022] Generate the server certificate based on the root certificate of the management node to be expanded, and update the server certificate to the certificate configuration information; the certificate configuration information further includes the server certificates of the computing nodes in the CKE instance and the certificates stored in the etcd cluster.
[0023] In another possible implementation, before updating the certificate configuration information of the management node to be expanded in the target CKE instance, the method further includes:
[0024] Back up the CKE instance.
[0025] In a second aspect, the present application provides a management node expansion device, the device includes:
[0026] An update module, configured to update the certificate configuration information of the management node to be expanded in the target CKE instance when receiving an expansion request; the expansion request is triggered when there is no management node other than the management node to be expanded in the target CKE instance, and the certificate configuration information includes the server certificate of the management node to be expanded;
[0027] A new addition module, configured to add a management node and an etcd node corresponding to the management node, and perform a health check on the etcd cluster after adding the etcd node to obtain a check result; the check result is used to indicate whether the state of the etcd cluster is a healthy state;
[0028] A feedback module, configured to, if the check result indicates that the state of the etcd cluster is a healthy state, update the domain name resolution configuration information of the management node in the corresponding computing node, and the network configuration information of the management node in the preset network plugin, and feedback an expansion success message; the preset network plugin is used to enable network intercommunication among the management nodes in the target CKE instance.
[0029] In another possible implementation, the feedback module is further configured to:
[0030] If the check result indicates that the state of the etcd cluster is not a healthy state, obtain error information by monitoring the running log of the etcd cluster, and perform automatic repair based on the error information;
[0031] Repeat the step of performing a health check on the etcd cluster after adding the etcd node to obtain a check result until a check result indicating that the state of the etcd cluster is a healthy state is obtained.
[0032] In another possible implementation, the feedback module is further configured to:
[0033] Determine whether the number of the management nodes reaches the target number indicated by the scaling-up request;
[0034] If so, determine to update the domain name resolution configuration of the management nodes in the corresponding computing nodes;
[0035] Otherwise, repeatedly execute the steps of adding a management node and an etcd node corresponding to the management node until the number of the management nodes reaches the target number indicated by the scaling-up request.
[0036] In another possible implementation manner, the feedback module is further configured to:
[0037] Restart kubelet and kube-proxy to query the status of the target CKE instance, and when the status of the target CKE instance is running, determine to feedback the scaling-up success information.
[0038] In another possible implementation manner, the adding module is specifically configured to:
[0039] Add the management node by calling the scheduler interface of the target CKE instance through a shell script.
[0040] In another possible implementation manner, the updating module is specifically configured to:
[0041] Generate the server certificate according to the root certificate of the management node to be scaled up, and update the server certificate to the certificate configuration information; the certificate configuration information further includes the server certificates of the computing nodes in the CKE instance and the certificates stored in the etcd cluster.
[0042] In another possible implementation manner, the updating module is further configured to:
[0043] Back up the CKE instance.
[0044] In a third aspect, the present application provides an electronic device, including a memory and a processor, wherein the memory is used for storing computer execution instructions;
[0045] The processor is used for calling the computer execution instructions to enable the electronic device to execute the method according to any one of the first aspect.
[0046] In a fourth aspect, the present application provides a computer-readable storage medium, in which computer execution instructions are stored, and when the computer execution instructions are executed by a processor, they are used to implement the method according to any one of the first aspect.
[0047] The present application provides a method, apparatus, electronic device, and medium for expanding management nodes. In the method of the present application, when the electronic device receives an expansion request, it first updates the integer configuration information of the management nodes to be expanded for the target CKE instance indicated by the expansion request. Secondly, the electronic device adds new management nodes and etcd nodes corresponding to the management nodes, performs a health check on the etcd cluster after adding the new etcd nodes, and when the check result obtained from the health check indicates that the status of the etcd cluster is healthy, updates the domain name resolution configuration information of the management nodes in the corresponding computing nodes and the network configuration information of the management nodes in the preset network plugin. Finally, the electronic device feeds back information indicating successful expansion. Through the method of the present application, for a target CKE instance, when it has one management node, the electronic device expands it so that the target CKE instance has more than one management node. Based on this, when one of the management nodes fails, the tenant can continue to use the target CKE instance. In addition, when the electronic device expands the target CKE instance, after adding new management nodes and etcd nodes, it performs a health check on the etcd cluster, ensuring the availability of the management nodes. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The accompanying drawings herein are incorporated into and constitute a part of this specification, showing embodiments consistent with the present application and, together with the specification, are used to explain the principles of the present application.
[0049] Figure 1 FIG. is a schematic diagram of an application scenario of a method for expanding management nodes provided by an embodiment of the present application;
[0050] Figure 2 FIG. is a flowchart of a method for expanding management nodes provided by an embodiment of the present application Figure 1 ;
[0051] Figure 3 FIG. is a flowchart of a method for expanding management nodes provided by an embodiment of the present application Figure 2 ;
[0052] Figure 4 FIG. is a schematic structural diagram of an apparatus for expanding management nodes provided by an embodiment of the present application;
[0053] Figure 5 FIG. is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
[0054] Through the above-mentioned accompanying drawings, specific embodiments of the present application have been shown, and there will be more detailed descriptions hereinafter. These drawings and written descriptions are not intended to limit the scope of the concept of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0055] Exemplary embodiments will be described in detail herein, and examples thereof are shown in the accompanying drawings. When the following description refers to the accompanying drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. On the contrary, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.
[0056] First, the terms involved in the present application are explained:
[0057] Mesos: It is a resource management framework. From the perspective of the data center, it can uniformly plan, allocate, and manage hardware resources (here, the hardware resources refer to the CPU, memory, and hard disk of the server).
[0058] k8s (Kubernetes): It is a brand-new distributed architecture solution based on container technology and is an open-source container cluster management system by Google.
[0059] CKE (Chinaunicom Kubernetes Engine): It refers to a Kubernetes (k8s) cluster management engine developed based on Mesos. Through CKE, the k8s cluster can be conveniently managed; at the technical level, it is a Mesos framework, including a central scheduler and an executor; CKE uses Mesos as the underlying IaaS resource management to manage the k8s cluster. The nodes KubeNode of the CKE instance interact through a private network. When the virtual network is abnormally large-scale, the CKE nodes need to be restarted for recovery.
[0060] scheduler: It requests resources from Mesos according to the resource configuration of the cluster. After the Mesos resources are successfully matched, the scheduler starts to plan the k8s cluster tasks for startup.
[0061] shell: It is a scripting language. You can use any text editor to write the corresponding program according to the syntax, add executable permissions, and then execute it in an environment where the shell command interpreter is installed.
[0062] etcd: It is a key component of Kubernetes. It stores the entire state of the cluster, including configuration, specifications, the state of running workloads, etc.
[0063] etcd: It is a key component of Kubernetes. It stores the entire state of the cluster, including configuration, specifications, the state of running workloads, etc.
[0064] Calico: A network plugin used for container network intercommunication in CKE instances.
[0065] Kubelet: A proxy component on k8s worker nodes.
[0066] Kube-proxy: A network proxy component on k8s worker nodes.
[0067] Cloud native is a distributed cloud based on distributed deployment and unified operation and management, and a set of technology product systems built on technologies such as containers, microservices, and DevOps. As cloud native technology becomes increasingly mature, the cloud native architecture, as the best implementation path for enterprise digital transformation, has gradually become the mainstream application deployment method in various industries. How to ensure the reliability of cloud native large-scale applications has become an urgent problem to be solved in the development of the cloud native industry.
[0068] In this context, the stability of CKE (Chinaunicom Kubernetes Engine) instances is also very important. When there is only one management node in a CKE instance, if for some reason (such as host machine downtime, fat container failure, etc.) the management node becomes unavailable, then the tenant will not be able to manage the CKE instance and the applications within the CKE instance, which is not conducive to improving the tenant's usage experience.
[0069] It can be understood that to solve the above problems, it is expected that a CKE instance includes more than one management node. Based on this, when one of the management nodes becomes unavailable due to factors such as host machine downtime, the tenant can still manage the CKE instance and the applications within it through other management nodes. Therefore, there is an urgent need for a method to expand the CKE instance to expand the management nodes of the CKE instance, so as to reduce the risk of service unavailability caused by single-point failures, which is conducive to improving the tenant's usage experience.
[0070] This application proposes a method, device, electronic device and medium for expanding management nodes. Specifically, when the electronic device receives an expansion request triggered when there is only one management node in any target CKE instance, it responds to the expansion request, performs expansion processing, and synchronously performs expansion processing on the etcd cluster. In addition, it will also perform a health check on the etcd cluster, and only when the check result indicates that the status of the etcd cluster is healthy, will it feedback the expansion success information. Through the method of this application, for a target CKE instance with an expansion request, the electronic device can timely perform expansion processing on it, and at the same time effectively ensure that both the target CKE instance and the etcd cluster are available after expansion, which is conducive to improving the tenant's usage experience.
[0071] Figure 1 A schematic diagram of an application scenario of a method for expanding a management node provided by an embodiment of the present application is as follows Figure 1 As shown, the method of the present application can be applied to the expansion scenario of a CKE instance with only one management node. Specifically, based on the method of the present application, when the electronic device detects that there is only one management node in the CEK instance, it triggers an expansion request for the CKE instance. Based on this expansion request, the electronic device first updates the certificate configuration information of the management node to be expanded included in the CKE instance, and secondly, adds a new management node and an etcd node corresponding to the management node, and performs a health check on the etcd cluster. Further, when the inspection result indicates that the status of the etcd cluster is healthy, the electronic device continues to update the domain name resolution configuration information of the management node in the corresponding computing node and the network configuration information in the preset network plugin. Finally, the electronic device feeds back the expansion success information to let the user know that the CKE instance has been expanded.
[0072] In Figure 1 the scenario shown, the management node marked by the dashed box is obtained after the electronic device expands the CKE instance.
[0073] The following will describe in detail some embodiments of the present application in conjunction with the accompanying drawings. In the case where there is no conflict among the embodiments, the following embodiments and the features in the embodiments can be combined with each other.
[0074] The present application provides a method for expanding a management node, Figure 2 A flowchart of a method for synchronizing a disk array provided by an embodiment of the present application is as follows Figure 1 as Figure 2 shown, the method of the embodiment of the present application includes:
[0075] S201, when receiving an expansion request, update the certificate configuration information of the management node to be expanded of the target CKE instance.
[0076] Among them, the expansion request is triggered when there is no management node other than the management node to be expanded in the target CKE instance, and the certificate configuration information includes the server certificate of the management node to be expanded.
[0077] In this embodiment, after the CKE instance is created, the electronic device monitors the number of management nodes of the CKE instance. When the number of management nodes of any CKE instance is 1, an expansion request for the CKE instance is automatically triggered. In practical applications, the number of management nodes of any CKE instance can also be input by the user. When the number of management nodes of any CKE instance is 1, the electronic device automatically triggers an expansion request for the CKE instance.
[0078] S202, Add a management node and an etcd node corresponding to the management node, and perform a health check on the etcd cluster after adding the etcd node to obtain a check result.
[0079] Among them, the check result is used to indicate whether the status of the etcd cluster is a healthy status.
[0080] It can be understood that each management node has a corresponding etcd node, and the target CKE instance can be available only when the status of the etcd cluster is a healthy status.
[0081] S203, If the check result indicates that the status of the etcd cluster is a healthy status, update the domain name resolution configuration information of the management node in the corresponding computing node, as well as the network configuration information of the management node in the preset network plugin, and feedback the information indicating successful expansion.
[0082] Among them, the preset network plugin is used to enable network intercommunication among the management nodes in the target CKE instance.
[0083] In this embodiment, the electronic device monitors the running logs of the etcd cluster, determines whether there are errors according to its running logs, and thus determines the status of the etcd cluster. Specifically, according to its running logs, if no error message is found, it is determined that the check result is used to indicate that the status of the etcd cluster is a healthy status. If an error message is found, it is determined that the check result is used to indicate that the status of the etcd cluster is not a healthy status. In this embodiment, when the check result indicates that the status of the etcd cluster is a healthy status, the electronic device continues to execute the steps of updating the domain name resolution configuration information of the management node in the corresponding computing node and the network configuration information of the management node in the preset network plugin.
[0084] It can be understood that when the status of the etcd cluster is not a healthy status, the use of the CKE instance will be affected. Therefore, when the status of the etcd cluster is not a healthy status, the electronic device should repair the error according to the error message to restore the status of the etcd cluster to a healthy status.
[0085] It can be understood that updating the domain name resolution configuration information of the management node in the corresponding computing node is used to connect the management node to the corresponding computing node. Among them, the computing node corresponding to the management node is the computing node called by the management node.
[0086] In this embodiment, the preset network plugin is the calico network plugin. By updating the network configuration information of the management node in the calico network plugin, the network intercommunication of each management node can be achieved.
[0087] After completing the above, the electronic device feeds back a successful expansion message to inform the user that the management node to be expanded of the target CKE instance has been successfully expanded and is available for the tenant.
[0088] In the method provided in this embodiment, when there is only one management node in any target CEK instance, the electronic device triggers an expansion request for the target CKE instance. In response to the expansion request, the electronic device first updates the certificate configuration information of the management node to be expanded included in the target CKE instance. Secondly, the electronic device adds a new management node and an etcd node corresponding to the management node, and performs a health check on the etcd cluster to determine whether the state of the etcd cluster is a healthy state. When the state of the etcd cluster of the electronic device is a healthy state, the electronic device further updates the domain name resolution configuration information of the management node in the corresponding computing node and the network configuration information in the preset network plugin. Finally, the electronic device feeds back a successful expansion message.
[0089] Through the method provided in this embodiment, for any target CKE instance with only one management node, the electronic device can timely expand the management node to be expanded of the target CKE instance, effectively reducing the risk of single point of failure of the target CKE instance, which is beneficial to improving the user experience of the tenant. Moreover, when the electronic device expands the management node, it simultaneously expands the etcd cluster and performs a health check on the etcd cluster to ensure that the etcd node can successfully join the etcd cluster and ensure that the basic components in the management node can be started normally, which is beneficial to making the target CKE instance available.
[0090] Figure 3 Flow schematic of a method for expanding a management node provided by an embodiment of the present application Figure 2 On the basis of the foregoing embodiment, this embodiment details the expansion process of the management node. Specifically, as Figure 3 shown, the method of this embodiment includes:
[0091] S301, when receiving an expansion request, back up the CKE instance.
[0092] Among them, the expansion request is triggered when there is no management node in the target CKE instance other than the management node to be expanded.
[0093] In this embodiment, when the electronic device monitors that the number of management nodes of any target CKE instance is 1, it determines that an expansion request for the target CKE instance is received.
[0094] In this embodiment, to prevent the occurrence of a situation where the target CKE instance cannot be recovered due to an exception during the expansion of the target CKE instance, before expanding the target CKE instance, the target CKE instance is first backed up to ensure that the target CKE instance is still available when the above-mentioned exception occurs.
[0095] S302. Generate a server certificate based on the root certificate of the management node to be expanded, and update the server certificate to the certificate configuration information.
[0096] Among them, the certificate configuration information also includes the server certificates of the computing nodes in the CKE instance and the certificates stored in the etcd cluster.
[0097] In this embodiment, the electronic device first generates a server certificate based on the ca root certificate of the management node to be expanded to update the ip of the management node to be expanded into the server certificate. Further, the electronic device updates the server certificate to the certificate configuration information. It can be understood that the certificate configuration information also includes the server certificates of the computing nodes corresponding to the management node to be expanded and the certificates stored in the etcd cluster.
[0098] S303. Call the scheduler interface of the target CKE instance through a shell script to add a management node, and add an etcd node corresponding to the management node.
[0099] Specifically, the electronic device can call the following interface to add a management node: http: / / $mesos_ip / service / $cluster_name / k8s / v2 / clusters / $cluster_name / nodes-d@data.json.
[0100] S304. Perform a health check on the etcd cluster after adding the etcd node to obtain a check result, and determine whether the check result indicates that the status of the etcd cluster is a healthy state. If so, execute S305; otherwise, execute S308.
[0101] In this embodiment, the electronic device determines the check result of the health check of the etcd cluster by monitoring whether there is an error message in the running log of the etcd cluster. Specifically, when there is an error message, it is determined that the check result indicates that the status of the etcd cluster is an unhealthy state, and at this time, the electronic device continues to execute the action of S308. When there is no error message, it is determined that the check result indicates that the status of the etcd cluster is a healthy state, and at this time, the electronic device continues to execute the action of S305.
[0102] S305. Determine whether the number of management nodes has reached the target number indicated by the scaling request. If so, execute S306; otherwise, execute S303.
[0103] In this embodiment, the target number is 3. Each time the electronic device adds a new management node, after executing the foregoing steps, a quantity check is performed to determine whether the number of management nodes has reached the target number. Specifically, if not, the electronic device continues to execute the steps of adding a management node and subsequent corresponding steps in S303. If the number of management nodes has reached the target number, the electronic device continues to execute the operation in S306.
[0104] S306. Update the domain name resolution configuration information of the management node in the corresponding computing node, and the network configuration information of the management node in the preset network plugin.
[0105] S307. Restart kubelet and kube-proxy to query the status of the target CKE instance. When the status of the target CKE instance is running, feedback the scaling success information.
[0106] In this embodiment, when the number of management nodes of the electronic device reaches the target number and the etcd cluster passes the health check, the two components kubelet and kube-proxy are restarted to determine whether the status of the target CKE instance is running. When the status of the target CKE instance is running, feedback the scaling success information.
[0107] In this embodiment, the scaling success information can be text information, voice information, or any combination form. This embodiment does not limit this.
[0108] S308. Monitor the running log of the etcd cluster to obtain error messages, and perform automatic repair based on the error messages to obtain the repaired etcd cluster.
[0109] In this embodiment, an etcd error handling mechanism is preset in the electronic device. The error handling mechanism includes any error message and its corresponding handling mechanism. After the electronic device obtains the error message, it determines the corresponding handling mechanism based on the etcd error handling mechanism to automatically repair the error indicated by the error message.
[0110] S309. Perform a health check on the repaired etcd cluster to obtain a check result, and determine whether the check result indicates that the status of the etcd cluster is a healthy state. If so, execute S305; otherwise, execute S308.
[0111] It can be understood that for the repaired etcd cluster, the electronic device needs to continue to perform health checks on it and determine the actions to be taken next based on the check results. Specifically, when the check results indicate that the status of the etcd cluster is healthy, continue to execute the step of determining whether the number of management nodes reaches the target number; otherwise, continue to execute the step of repairing the error indicated by the error message.
[0112] In the method provided in this embodiment, before expanding the target CKE instance, the target CKE instance is first backed up, thereby further reducing the risk of the target CKE instance being unavailable. Further, when the etcd cluster fails the health check, the electronic device repairs the etcd cluster through a preset etcd error handling mechanism until the etcd cluster passes the health check, thus effectively ensuring that etcd nodes can successfully join the etcd cluster, which is beneficial to the normal startup of the basic components in the management node. In addition, the electronic device restarts two components, kubelet and kube-proxy, to ensure the availability of the target CKE instance.
[0113] Through the method provided in this embodiment, the risk of the target CKE instance being unavailable is effectively reduced, which is beneficial to improving the tenant's usage experience.
[0114] This application also provides a management node expansion device. Figure 4 For a management node expansion device provided in an embodiment of this application, as Figure 4 shown, the device in this embodiment includes: an update module 41, a new addition module 42, and a feedback module 43.
[0115] Among them, the update module 41 is used to update the certificate configuration information of the management node to be expanded of the target CKE instance when receiving an expansion request; the expansion request is triggered when there is no management node other than the management node to be expanded in the target CKE instance, and the certificate configuration information includes the server certificate of the management node to be expanded.
[0116] The new addition module 42 is used to add a management node and an etcd node corresponding to the management node, and perform a health check on the etcd cluster after adding the new etcd node to obtain a check result; the check result is used to indicate whether the status of the etcd cluster is a healthy state.
[0117] The feedback module 43 is used to, if the check result indicates that the status of the etcd cluster is healthy, update the domain name resolution configuration information of the management node in the corresponding computing node, as well as the network configuration information of the management node in the preset network plugin, and feedback an expansion success message; the preset network plugin is used to enable network intercommunication among the management nodes in the target CKE instance.
[0118] Another possible implementation of the embodiment of the present application, the feedback module is further configured to:
[0119] If the inspection result indicates that the status of the etcd cluster is not healthy, then by monitoring the running log of the etcd cluster, obtain the error message, and perform automatic repair based on the error message;
[0120] Repeat the step of performing a health check on the etcd cluster after adding a new etcd node to obtain the inspection result until an inspection result indicating that the status of the etcd cluster is healthy is obtained.
[0121] Another possible implementation of the embodiment of the present application, the feedback module is further configured to:
[0122] Determine whether the number of management nodes reaches the target number indicated by the expansion request;
[0123] If so, determine to update the domain name resolution configuration of the management node in the corresponding computing node;
[0124] Otherwise, repeat the steps of adding a new management node and the etcd node corresponding to the management node until the number of management nodes reaches the target number indicated by the expansion request.
[0125] Another possible implementation of the embodiment of the present application, the feedback module is further configured to:
[0126] Restart kubelet and kube-proxy to query the status of the target CKE instance. When the status of the target CKE instance is running, determine to feedback the expansion success information.
[0127] Another possible implementation of the embodiment of the present application, the adding module is specifically configured to:
[0128] Add a new management node by calling the scheduler interface of the target CKE instance through a shell script.
[0129] Another possible implementation of the embodiment of the present application, the updating module is specifically configured to:
[0130] Generate a server certificate according to the root certificate of the management node to be expanded, and update the server certificate to the certificate configuration information; the certificate configuration information also includes the server certificates of the computing nodes in the CKE instance and the certificates stored in the etcd cluster.
[0131] Another possible implementation of the embodiment of the present application, the updating module is further configured to:
[0132] Back up the CKE instance.
[0133] The present application also provides an electronic device,Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present application is shown as Figure 5 shown in Figure 5 The monitoring device shown includes: a processor 51 and a memory 52. Among them, the processor 51 and the memory 52 are connected, such as connected through a bus 53. Optionally, the monitoring device may further include a transceiver 54. It should be noted that in practical applications, the transceiver 54 is not limited to one, and the structure of this monitoring device does not constitute a limitation to the embodiment of the present application.
[0134] The processor 51 may be a central processing unit (CPU), a general-purpose processor, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. It can implement or execute various exemplary logical blocks, modules, and circuits described in connection with the disclosure of the present application. The processor 51 may also be a combination that implements computing functions, such as a combination including one or more microprocessors, a combination of a DSP and a microprocessor, etc.
[0135] The bus 53 may include a path for transmitting information between the above components. The bus 53 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The bus 53 may be divided into an address bus, a data bus, a control bus, etc. For the sake of representation, Figure 5 only a thick line is used to represent it in the figure, but it does not mean that there is only one bus 53 or one type of bus 53.
[0136] The memory 52 can be a read only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or can also be an electrically erasable programmable read only memory (EEPROM), a compact disc read only memory (CD-ROM) or other optical disc storage, optical disc storage (including compact discs, laser discs, optical discs, digital versatile discs, Blu-ray discs, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.
[0137] The memory 52 is used to store the application program code for executing the solution of this application, and is controlled by the processor 51 for execution. The processor 51 is used to execute the application program code stored in the memory 52 to implement the content shown in the foregoing method embodiments.
[0138] This application also provides a computer-readable storage medium, which may include: various media that can store program code such as USB flash drives, external hard drives, read-only memories (ROMs), random access memories (RAMs), magnetic disks or optical discs, etc. Specifically, the computer-readable storage medium stores program instructions for implementing the methods in the above various embodiments.
[0139] This application embodiment also provides a computer program product, including a computer program, which implements the technical solutions of the above method embodiments when executed by a processor. The implementation principle and technical effects are similar and will not be elaborated here.
[0140] Those skilled in the art will readily think of other implementation solutions of this application after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses or adaptive changes of this application, and these variations, uses or adaptive changes follow the general principles of this application and include the common general knowledge or conventional technical means in the technical field not disclosed in this application. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of this application are pointed out by the following claims.
[0141] It should be understood that the present application is not limited to the exact structures described above and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present application is only limited by the appended claims.
Claims
1. A method for expanding a management node, characterized in that The method includes: When receiving an expansion request, updating the certificate configuration information of the management node to be expanded in the target CKE instance; the expansion request is triggered when there is no management node other than the management node to be expanded in the target CKE instance, and the certificate configuration information includes the server certificate of the management node to be expanded; Adding a management node and an etcd node corresponding to the management node, and performing a health check on the etcd cluster after adding the etcd node to obtain a check result; the check result is used to indicate whether the status of the etcd cluster is a healthy status; If the check result indicates that the status of the etcd cluster is a healthy status, then updating the domain name resolution configuration information of the management node in the corresponding computing node, and the network configuration information of the management node in the preset network plugin, and feedbacking an expansion success message; the preset network plugin is used to enable network intercommunication among the management nodes in the target CKE instance.
2. The method according to claim 1, wherein The method further includes: If the check result indicates that the status of the etcd cluster is not a healthy status, then obtaining error information by monitoring the running log of the etcd cluster, and performing automatic repair based on the error information; Repeating the step of performing a health check on the etcd cluster after adding the etcd node to obtain a check result until a check result indicating that the status of the etcd cluster is a healthy status is obtained.
3. The method according to claim 1 or 2, wherein Before updating the domain name resolution configuration information of the management node in the corresponding computing node, the method further includes: Judging whether the number of management nodes reaches the target number indicated by the expansion request; If so, determining to update the domain name resolution configuration of the management node in the corresponding computing node; Otherwise, repeating the step of adding a management node and an etcd node corresponding to the management node until the number of management nodes reaches the target number indicated by the expansion request.
4. The method according to claim 1 or 2, characterized in that, Before feedbacking the expansion success message, the method further includes: Restarting kubelet and kube-proxy to query the status of the target CKE instance, and determining to feedback the expansion success message when the status of the target CKE instance is running.
5. The method according to claim 1 or 2, characterized in that, The adding of the management node includes: Adding the management node by calling the scheduler interface of the target CKE instance through a shell script.
6. The method according to claim 1 or 2, characterized in that, The updating of the certificate configuration information of the management node to be expanded in the target CKE instance includes: Generating the server certificate according to the root certificate of the management node to be expanded, and updating the server certificate to the certificate configuration information; the certificate configuration information further includes the server certificates of the computing nodes in the CKE instance and the certificates stored in the etcd cluster.
7. The method according to claim 1 or 2, characterized in that, Before updating the certificate configuration information of the management node to be expanded in the target CKE instance, the method further includes: Backing up the CKE instance.
8. An expansion device for a management node, characterized in that The device includes: An update module, configured to update the certificate configuration information of the management nodes to be expanded in a target CKE instance when receiving an expansion request; the expansion request is triggered when there are no management nodes other than the management nodes to be expanded in the target CKE instance, and the certificate configuration information includes the server certificate of the management nodes to be expanded. A new addition module, configured to add a management node and an etcd node corresponding to the management node, and perform a health check on the etcd cluster after adding the etcd node to obtain a check result; the check result is used to indicate whether the status of the etcd cluster is a healthy status. A feedback module, configured to, if the check result indicates that the status of the etcd cluster is a healthy status, update the domain name resolution configuration information of the management node in the corresponding computing node, and the network configuration information of the management node in a preset network plugin, and feedback an expansion success message; the preset network plugin is used to enable network intercommunication among the management nodes in the target CKE instance.
9. An electronic device, characterized in that, Comprising: A memory and a processor, wherein the memory is used to store computer execution instructions; The processor is used to call the computer execution instructions to cause the electronic device to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Computer execution instructions are stored in the computer-readable storage medium, and when the computer execution instructions are executed by the processor, they are used to implement the method according to any one of claims 1 to 7.