Cloud-edge collaborative system, cluster resource control method and device
Through distributed deployment of edge nodes and central nodes in the cloud-edge collaboration system, multi-tenant isolation of Kubernetes cluster resources is achieved, solving the problem of tenant isolation in the public cloud, and improving resource security and management efficiency.
Patent Information
- Application Number
- CN202110315057.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-03-24
- Publication Date
- 2024-09-27
- Estimated Expiration
- 2041-03-24
AI Technical Summary
The existing Kubernetes federated management model cannot achieve multi-tenant isolation in the public cloud, and tenants cannot independently select nodes and management resources according to their needs.
A cloud-edge collaboration system is designed, which achieves multi-tenant isolation of cluster resources by deploying edge nodes in multiple computer rooms and using central nodes to store resource templates and tenant account isolation caches. Clients can log in through tenant accounts. Publish and query resource status.
Multi-tenant cloud service hosting is implemented on public cloud hardware resources, improving the security and management efficiency of cluster resources.
Smart Images

Figure CN112925647B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud services, and in particular to a cloud-edge collaborative system, and a control method and device for cluster resources. Background Art
[0002] In the related technologies, kec (Kingsoft Cloud Edge Node Computing) edge container cloud platform is an enterprise-level distributed edge container cloud platform based on open source technologies such as Kubernetes (abbreviated as kube / K8S), containers, OVS (Open vSwitch), LVS (LinuxVirtual Server), and Wayne (Web-based Kubernetes multi-cluster management platform), ENAT (Elastic Network Address Translation), EIP (Elastic IP), Local PV (local volume) and other components developed by edge computing providers. In terms of technical logic, kenc consists of two roles: a management node and a large number of business nodes. The management node does not bear the business load and only performs cluster management and scheduling. The business node is open to customers to supply container IaaS (Infrastructure as a Service) resources.
[0003] The commonly used management solutions in related technologies are all deployed in a private cloud mode, and the Kubernetes native federation management mode manages the cluster. The biggest problem is that it cannot isolate multiple tenants. For example, Rancher kubesphere is deployed in a private cloud mode and uses K8S native federation management. It does not consider network isolation, resource isolation and other issues. As a public cloud vendor, it is necessary to run different businesses of different tenants on the cloud server without affecting each other. Related technologies have the following shortcomings: In related technologies, multi-tenant isolation cannot be achieved, tenants cannot publish their own resources according to the nodes (computer rooms) they want, and tenants cannot manage the templates of their published resources.
[0004] With respect to the above-mentioned problems existing in the related technologies, no effective solutions have been found so far. Summary of the invention
[0005] Embodiments of the present invention provide a cloud-edge collaboration system, a cluster resource control method and a device.
[0006] According to one aspect of an embodiment of the present invention, a cloud-edge collaboration system is provided, including: multiple edge nodes, distributedly deployed in multiple computer rooms, for storing cluster resources of a K8S cluster and carrying cloud services through an edge network; a central node, connected to the multiple edge nodes, for storing resource templates, and locally isolating and caching cluster resources based on the resource templates in units of tenant accounts; a client, connected to the edge nodes and the central node, logged in through the tenant account, for publishing the cluster resources and querying status information of the cluster resources.
[0007] Furthermore, the central node includes: an open application programming interface API component connected to the client and used to detect the call request of the client; a federation component, used to monitor the status information of the cluster resources in the multiple edge nodes and cache the status information locally.
[0008] Furthermore, the federation component includes: a database for storing resource templates of the cluster resources and publishing status information of the resource templates; a cache for monitoring cluster resources based on the resource templates in the multiple edge nodes, and isolating and caching the status information of the cluster resources locally in units of tenant accounts.
[0009] Furthermore, the cache is also used to: after receiving a call request from the client, authenticate the client, establish a communication connection with the client through a proxy after the authentication is passed, filter the locally cached status information according to the access rights of the client, and return the filtered target status information to the client.
[0010] Furthermore, the client also includes: a creation module, used to create the resource template and upload the resource template to the central node; and a publishing module, used to publish cluster resources to several target edge nodes based on the resource template.
[0011] Furthermore, the central node also includes: a namespace module, which is used to classify cluster resources based on tenant accounts of cloud services, and encapsulate several cluster resources of each category in a container, wherein each container corresponds to a namespace; a control group module, which is used to search for service processes based on tenant accounts after receiving an access request from the client, wherein each service process corresponds to several cluster resources of the same category.
[0012] Furthermore, the central node also includes: a user resource definition CRD module, which is used to convert the CRD resource through an object component after receiving the client-defined CRD resource, and deploy the converted CRD resource to the central node.
[0013] According to another aspect of an embodiment of the present invention, a cluster resource control method is provided, comprising: receiving a resource template of a K8S cluster created by a client, and storing the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node; monitoring cluster resources in multiple edge nodes, and isolating and caching status information of the cluster resources locally in units of tenant accounts, wherein the tenant account is logged in to the client.
[0014] Furthermore, the method also includes: after receiving a call request from the client, authenticating the client, after the authentication is passed, establishing a communication connection with the client through a proxy, filtering the locally cached status information according to the access rights of the client, and returning the filtered target status information to the client.
[0015] According to another aspect of an embodiment of the present invention, a cluster resource control device is provided, including: a receiving module, used to receive a resource template of a K8S cluster created by a client, and store the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node; a monitoring module, used to monitor cluster resources in multiple edge nodes, and locally isolate and cache status information of the cluster resources in units of tenant accounts, wherein the tenant account is logged in to the client.
[0016] Furthermore, the device also includes: a return module, which is used to authenticate the client after receiving a call request from the client, establish a communication connection with the client through a proxy after the authentication is passed, filter the locally cached status information according to the access rights of the client, and return the filtered target status information to the client.
[0017] According to another aspect of an embodiment of the present invention, a storage medium is further provided. The storage medium includes a stored program. When the program is run, the above steps are executed.
[0018] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus; wherein: the memory is used to store computer programs; and the processor is used to execute the steps in the above method by running the program stored in the memory.
[0019] The embodiment of the present invention also provides a computer program product including instructions, which, when executed on a computer, enables the computer to execute the steps in the above method.
[0020] Through the present invention, multiple edge nodes are distributedly deployed in multiple computer rooms to store cluster resources of the K8S cluster and carry cloud services through the edge network; the central node stores resource templates, and locally isolates and caches cluster resources based on the resource templates in units of tenant accounts. The client logs in through the tenant account to publish the cluster resources and query the status information of the cluster resources. By isolating and caching cluster resources based on resource templates in units of tenant accounts on the central node, a multi-tenant isolation solution on the public cloud is implemented, which solves the technical problem that the related technology cannot achieve tenant isolation on the public cloud, and can carry cloud services of multiple tenants on the hardware resources of the public cloud, while improving the security of cluster resources. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0022] Figure 1 is a structural diagram of a cloud-edge collaboration system according to an embodiment of the present invention;
[0023] Figure 2 is a schematic diagram of network deployment according to an embodiment of the present invention;
[0024] Figure 3 is a flow chart of a cluster resource control method according to an embodiment of the present invention;
[0025] Figure 4 is a structural block diagram of a cluster resource control device according to an embodiment of the present invention;
[0026] Figure 5 It is a structural block diagram of an electronic device implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0027] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only embodiments of a part of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention. It should be noted that the embodiments of the present invention and the features in the embodiments can be combined with each other without conflict.
[0028] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0029] Example 1
[0030] In this embodiment, a cloud-edge collaboration system is provided. Figure 1 is a structural diagram of a cloud-edge collaboration system according to an embodiment of the present invention. Figure 1 As shown, including:
[0031] Multiple edge nodes 10 are distributed and deployed in multiple computer rooms to store cluster resources of the K8S cluster and carry cloud services through the edge network;
[0032] In this embodiment, each computer room is deployed in an area, such as an administrative city or county, a community, etc., that is, an edge node is deployed in each computer room. The edge node serves as an access gateway for the client to realize distributed carrying of cloud services and improve the detection speed of online services.
[0033] Edge nodes are distributed edge resource pools built based on cloud services and operator edge nodes. Edge nodes make full use of the cloud service provider's resource reserve and scheduling management capabilities in edge networks, and provide customers with efficient, stable and cost-effective computing and network services through edge nodes to reduce customer access delays and costs, and gradually guide the integration of more industry applications.
[0034] The central node 12 is connected to the plurality of edge nodes, and is used to store resource templates and to isolate and cache cluster resources based on the resource templates locally in units of tenant accounts;
[0035] The central node is used to globally synchronize the resource status information of the edge nodes and display it to the client through front-end interaction.
[0036] The client 14 is connected to the edge node and the central node, and is logged in through the tenant account to publish the cluster resources and query the status information of the cluster resources.
[0037] Optionally, the status information is used to represent the occupancy status, resource publishing status, editing, deletion status, etc. of the cluster resources, and the status information corresponds to the current status or historical status of the cluster resources on the edge node.
[0038] In this embodiment, the client used by the tenant of cloud resources can connect to the edge node and the central node, publish cluster resources based on the edge node, and execute cloud services by accessing the cluster resources. On the other hand, create resources based on the central node, query status, etc.
[0039] Through the above system, multiple edge nodes are distributedly deployed in multiple computer rooms to store cluster resources of the K8S cluster and carry cloud services through the edge network; the central node stores resource templates and locally isolates and caches cluster resources based on the resource templates in units of tenant accounts. The client logs in through the tenant account to publish the cluster resources and query the status information of the cluster resources. By isolating and caching cluster resources based on resource templates in units of tenant accounts on the central node, a multi-tenant isolation solution on the public cloud is implemented, which solves the technical problem that related technologies cannot achieve tenant isolation on the public cloud. Cloud services of multiple tenants can be carried on the hardware resources of the public cloud, while improving the security of cluster resources.
[0040] Figure 2 It is a schematic diagram of network deployment of an embodiment of the present invention, including multiple edge nodes (illustrating edge node 1, edge node 2, edge node 3), a central node, clients (illustrating client a, client b, client c, client d, client e), etc. The client is connected to the central node via the Internet, and selects to connect to the edge node through the edge network. The edge node and the central node are connected through the core network. The central node manages all edge nodes and interacts with the client at the same time.
[0041] In one implementation of the embodiment, the central node includes: an open application programming interface (API) component connected to the client to detect the call request of the client; a federation component to monitor the status information of the cluster resources in the multiple edge nodes and cache the status information locally. The open API component realizes the interaction between the central node and the client through the SDK (Software Development Kit), so that the customer isolates the namespace of the tenant account and the information within the scope of the central node's access rights.
[0042] In an example based on the above implementation, the federation component includes: a database for storing resource templates of the cluster resources and publishing status information of the resource templates; a cache for monitoring cluster resources based on the resource templates in the multiple edge nodes, and isolating and caching the status information of the cluster resources locally in units of tenant accounts.
[0043] The client first creates a resource template for the cluster resources. Optionally, the resource template includes the container name, image address, required hardware resources (CPU core number, memory capacity, etc.). The central node stores the resource template created by the client and associates it with the created tenant account. When the client creates a cluster resource, it first queries the resource template and then publishes specific resources based on the template. The central node is authenticated and the client can only query the resource template it created, thereby realizing cluster resource classification based on tenant accounts.
[0044] Optionally, the cache is also used to: after receiving a call request from the client, authenticate the client, establish a communication connection with the client through a proxy after the authentication is passed, filter the locally cached status information according to the access rights of the client, and return the filtered target status information to the client.
[0045] During the query process, the central node returns the cluster resources created by the current tenant account to the client, or returns the cluster resources under the jurisdiction of the tenant account. Other irrelevant resources are directly filtered at the central node to achieve tenant isolation of resource access.
[0046] Optionally, the tenant account includes a master account and a sub-account. The user uses the cloud account as the tenant account to log in to the client. The client is the terminal that runs the cloud service instance locally. In some scenarios, the cloud account is divided into a master account and a sub-account. The master account is the account registered by the user with the cloud service provider. Multiple sub-accounts can be created. Each sub-account corresponds to a sub-user. The sub-user can also be called an IAM (Identity and Access Management) user. An IAM user is a type of entity identity of IAM. It has a certain identity ID and identity credentials. It can correspond to a certain person or application one by one. It is the smallest unit of authentication object. Multiple IAM accounts can be created under a tenant account (master account), corresponding to employees, systems or applications within the enterprise. IAM users do not own resources. IAM users must obtain authorization from the cloud account before they can log in to the console or use APIs to operate resources under the cloud account. When an enterprise has multiple cloud resources, using the authorization management function of IAM can achieve user decentralization and unified resource management.
[0047] The client connects to the kenc-openAPI component (an open API component) of the central node through the Transfer-Encoding component of HTTP (HyperText Transfer Protocol). The component queries the database for verification permissions, etc., and then proxies to the kec-federation component (a federation component) to establish a connection between the client and the federation component of the central node. The federation component filters the listening time returned by the edge node (filtering the data of other tenants) and returns it to the corresponding client, solving the security issues caused by the client listening to the edge node query status information.
[0048] In one implementation of the embodiment, the client further includes: a creation module, used to create the resource template and upload the resource template to the central node; and a publishing module, used to publish cluster resources to several target edge nodes based on the resource template.
[0049] In one implementation of this embodiment, the central node includes kec-APIserver (interface service component), kec-federation (federation component), kec-console (front-end component), and kec-openAPI (open interface component).
[0050] kenc-APIserver: built with beego framework, manages tenant account permissions, resource templates, customer namespaces, etc. through tools such as mysql;
[0051] kenc-federation: uses a monitoring mechanism to monitor all K8S cluster resources managed by the cluster, and caches them in the cache system to facilitate concurrent queries and achieve global synchronization;
[0052] kenc-console: Use the angularjs front-end code framework to build interactive components and display them to the client on the front end;
[0053] kenc-openAPI: Uses the beego framework to encapsulate the K8S native openAPI, allowing customers to isolate their namespaces.
[0054] The implementation process based on this implementation method includes: the user creates a resource template, the authentication system verifies whether the current user has the authority to create resources, and if so, the database (Wayne DB) is responsible for storing the various resource templates created by the user and information such as the release status, and at the same time, the template is retrieved from the database and some input processing is performed, such as annotations, tags, etc. The user publishes to the corresponding K8S cluster based on the existing template, and uses the Watch mechanism to monitor all K8S cluster resources managed by Wayne through the cache (Wayne Cache system), and caches them in the Cache system for easy query.
[0055] The solution of this embodiment is adopted to manage edge nodes by deploying the central management component kec-federation, deploying the kec-APIserver component to provide interfaces and perform tenant isolation, deploying the kec-console component to implement front-end display with the client, and replacing the native K8SopenAPI by deploying the kec-openAPI component.
[0056] In one implementation of the embodiment, the central node also includes: a namespace module, which is used to classify cluster resources based on tenant accounts of cloud services, and encapsulate several cluster resources of each category in a container, wherein each container corresponds to a namespace; a control group (Cgroup / control group) module, which is used to search for service processes based on tenant accounts after receiving an access request from the client, wherein each service process corresponds to several cluster resources of the same category.
[0057] The namespace module is used to implement access isolation. It abstracts a type of resources and encapsulates them together for use in a container. For resources in the same container, since each container has its own abstraction, they are invisible to each other, thus achieving access isolation.
[0058] The control group module is a functional module based on the Linux kernel, which is used to limit, control and separate the hardware resources (such as CPU, memory, disk input and output, etc.) of a process group. In this embodiment, the hardware resources limited are the processes running in the CPU. The control group module can monitor the configured processes, allow or deny processes to access certain resources, and even dynamically configure processes in the running system by configuring hardware resources. The control group module achieves the purpose of controlling the available resources of this group of processes by placing a group of processes in a control group and allocating specified available hardware resources and accessible cluster resources to this control group.
[0059] In one implementation of the embodiment, the central node also includes: a user resource definition (CustomResourceDefinition, CRD) module, which is used to convert the CRD resource customized by the client through an object component after receiving the CRD resource, and deploy the converted CRD resource to the central node.
[0060] In this embodiment, everything in the Kubernetes cluster can be regarded as a resource. The Kubernetes API can be extended through the secondary development capability of custom resources. New resource types can be added to the Kubernetes API through the CRD module without modifying the Kubernetes source code to create a custom API server, thereby improving the expansion capability of Kubernetes. When creating a new CRD resource, the Kubernetes API server will create a new RESTful resource path for each version you specify, and you can create your own defined type resources based on the API path. CRD resources can be namespaced or cluster-wide, as specified in the scope (scpoe) field of the CRD resource. Like existing built-in objects, deleting a namespace will delete all custom objects in the namespace. The CRD resource itself has no namespace, and all namespaces can be used. Users can customize their own CRD resources on the client side, and publish and deploy custom CRDs through object component (informer) conversion of the federated node.
[0061] In this embodiment, a cluster resource control method is also provided, which is applied in the central node of the cloud-edge collaboration system in the above embodiment. Figure 3 is a flow chart of a cluster resource control method according to an embodiment of the present invention. Figure 3 As shown, the process includes the following steps:
[0062] Step S302, receiving a resource template of a K8S cluster created by a client, and storing the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node;
[0063] Step S304, monitoring cluster resources in multiple edge nodes, and isolating and caching the status information of the cluster resources locally in units of tenant accounts, wherein the tenant accounts are logged in on the client.
[0064] When interacting with the client, the central node is used to globally synchronize the resource status information of the edge nodes and display it to the client through front-end interaction. This embodiment opens an API component, connects to the client, detects the client's call request, monitors the status information of the cluster resources in the multiple edge nodes, and caches the status information locally. Among them, the open API component implements the interaction between the local device (corresponding to the execution subject of this embodiment - the central node of the cloud-edge collaborative system) and the client through the SDK, so that the customer can isolate the namespace of the tenant account and the information within the scope of local access rights.
[0065] In an example based on the above implementation, a database is used to store the resource template of the cluster resources and the publishing status information of the resource template, a cache is used to monitor the cluster resources based on the resource template in the multiple edge nodes, and the status information of the cache cluster resources is isolated and cached locally in units of tenant accounts.
[0066] The client first creates a resource template for the cluster resources. Optionally, the resource template includes the container name, image address, required hardware resources (CPU core number, memory capacity, etc.), etc. By storing the resource template created by the client and associating it with the created tenant account, the client first queries the resource template when creating cluster resources, and then publishes specific resources based on the template. Through authentication, the client can only query the resource template it created, thereby realizing cluster resource classification based on tenant accounts.
[0067] Optionally, after receiving a call request from the client, the client is authenticated. After the authentication is passed, a communication connection with the client is established through a proxy, the locally cached status information is filtered according to the access rights of the client, and the filtered target status information is returned to the client.
[0068] In one example, returning the filtered target status information to the client includes: returning the cluster resources created by the current tenant account to the client, or returning the cluster resources governed by the tenant account, and directly filtering out other irrelevant resources to achieve tenant isolation of resource access.
[0069] The tenant account of this embodiment includes a main account and a sub-account. The user uses the cloud account as the tenant account to log in to the client. The client is a terminal that runs the cloud service instance locally. In some scenarios, the cloud account is divided into a main account and a sub-account. The main account is the account registered by the user in the cloud service provider. Multiple sub-accounts can be created. Each sub-account corresponds to a sub-user. The sub-user can also be called an IAM user. The IAM user is a type of entity identity of IAM. It has a certain identity ID and identity credentials. It can correspond to a certain person or application program one by one. It is the smallest unit of authentication object. Multiple IAM accounts can be created under a tenant account (main account), corresponding to employees, systems or applications in the enterprise. IAM users do not own resources. IAM users must obtain authorization from the cloud account before they can log in to the console or use APIs to operate resources under the cloud account. When an enterprise has multiple cloud resources, the authorization management function of IAM can be used to achieve user decentralization and unified resource management.
[0070] The client connects to the kenc-openAPI component of the local device through the Transfer-Encoding component of the HTTP protocol. The component queries the database for verification permissions, and then proxies to the kec-federation component to establish a connection between the client and the federation component of the local device. The federation component filters the listening time returned by the edge node (filtering data from other irrelevant tenants) and returns it to the corresponding client, solving the security issues caused by the client listening to the edge node to query status information.
[0071] Optionally, cluster resources can be classified based on the tenant account of the cloud service, and several cluster resources of each category can be encapsulated in a container, wherein each container corresponds to a namespace; after receiving the access request from the client, the service process is searched according to the tenant account, wherein each service process corresponds to several cluster resources of the same category. This embodiment uses a namespace to implement access isolation, abstracts a class of resources, and encapsulates them together for use in a container. For resources in a unified container, since each container has its own abstraction, they are invisible to each other, thereby implementing access isolation.
[0072] When searching for service processes according to tenant accounts, it is implemented through the control group module, which uses a functional module of the Linux kernel to limit, control and separate the hardware resources (such as CPU, memory, disk input and output, etc.) of a process group. In this embodiment, the limited hardware resources are the processes running in the CPU. The control group module can monitor the configured processes, allow or deny processes to access certain resources, and even dynamically configure processes in the running system by configuring hardware resources. By placing a group of processes in a control group and allocating specified available hardware resources and accessible cluster resources to this control group, the purpose of controlling the available resources of this group of processes is achieved.
[0073] In one implementation of the embodiment, the solution further includes: after receiving the CRD resource customized by the client, converting the CRD resource through an object component, and deploying the converted CRD resource to a local device (central node).
[0074] By adopting the solution of this embodiment, the central node in the cloud-edge collaborative system is split into various components, each of which performs its own function without interfering with each other, thereby achieving complete isolation of customer resources and networks. For clients, through the isolation of the central node, clients can more conveniently and safely manage their own resource templates, query resource status, and accurately manage the resources of each node.
[0075] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present invention.
[0076] Example 2
[0077] In this embodiment, a control device for cluster resources is also provided, which is used to implement the above embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0078] Figure 4 is a structural block diagram of a cluster resource control device according to an embodiment of the present invention. Figure 4As shown, the device includes: a receiving module 40, a monitoring module 42, wherein:
[0079] A receiving module 40 is used to receive a resource template of a K8S cluster created by a client, and store the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node;
[0080] The monitoring module 42 is used to monitor the cluster resources in multiple edge nodes and locally isolate and cache the status information of the cluster resources in units of tenant accounts, wherein the tenant accounts are logged in on the client.
[0081] Optionally, the device also includes: a return module, which is used to authenticate the client after receiving a call request from the client, establish a communication connection with the client through a proxy after the authentication is passed, filter the locally cached status information according to the access rights of the client, and return the filtered target status information to the client.
[0082] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0083] Example 3
[0084] The embodiment of the present application also provides an electronic device, Figure 5 is a structural diagram of an electronic device according to an embodiment of the present invention, such as Figure 5 As shown, it includes a processor 51, a communication interface 52, a memory 53 and a communication bus 54, wherein the processor 51, the communication interface 52, and the memory 53 communicate with each other through the communication bus 54, and the memory 53 is used to store computer programs; the processor 51 is used to execute the program stored in the memory 53 to implement the following steps: receiving a resource template of a K8S cluster created by a client, and storing the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node; monitoring cluster resources in multiple edge nodes, and isolating and caching the status information of the cluster resources locally in units of tenant accounts, wherein the tenant account logs in to the client.
[0085] Furthermore, the method also includes: after receiving a call request from the client, authenticating the client, after the authentication is passed, establishing a communication connection with the client through a proxy, filtering the locally cached status information according to the access rights of the client, and returning the filtered target status information to the client.
[0086] The communication bus mentioned in the above terminal can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.
[0087] The communication interface is used for communication between the above terminal and other devices.
[0088] The memory may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0089] The above-mentioned processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0090] In another embodiment provided in the present application, a computer-readable storage medium is provided. The computer-readable storage medium stores instructions. When the instructions are executed on a computer, the computer executes the cluster resource control method described in any one of the above embodiments.
[0091] In another embodiment provided by the present application, a computer program product including instructions is also provided. When the computer program product is executed on a computer, the computer executes the cluster resource control method described in any one of the above embodiments.
[0092] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.
[0093] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.
[0094] The above description is only a specific implementation of the present application, so that those skilled in the art can understand or implement the present application. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest range consistent with the principles and novel features applied for herein.
Claims
1. A cloud-edge collaboration system, characterized in that: include: Multiple edge nodes are distributed and deployed in multiple computer rooms to store cluster resources of the K8S cluster and carry cloud services through the edge network; A central node, connected to the plurality of edge nodes, for storing resource templates and isolating and caching cluster resources based on the resource templates locally in units of tenant accounts; A client is connected to the edge node and the central node, and is logged in through the tenant account to publish the cluster resources and query the status information of the cluster resources; Wherein, the central node includes: An open application programming interface API component is connected to the client and is used to detect a call request from the client; A federation component is used to monitor the status information of cluster resources in the multiple edge nodes and cache the status information locally. The federation component includes: a database, which is used to store resource templates of the cluster resources and publishing status information of the resource templates; a cache, which is used to monitor the cluster resources based on the resource templates in the multiple edge nodes, and locally isolate and cache the status information of the cluster resources in units of tenant accounts, and is also used to authenticate the client after receiving a call request from the client. After the authentication is passed, a communication connection with the client is established through a proxy, and the locally cached status information is filtered according to the access rights of the client, and the filtered target status information is returned to the client.
2. The system according to claim 1, characterized in that The client also includes: A creation module, used to create the resource template and upload the resource template to the central node; The publishing module is used to publish cluster resources to several target edge nodes based on the resource template.
3. The system according to claim 1, characterized in that The central node also includes: The namespace module is used to classify cluster resources based on the tenant account of the cloud service and encapsulate several cluster resources of each category into a container, where each container corresponds to a namespace; The control group module is used to search for a service process according to a tenant account after receiving an access request from the client, wherein each service process corresponds to a plurality of cluster resources of the same category.
4. The system according to claim 1, characterized in that The central node also includes: The user resource definition CRD module is used to convert the CRD resource customized by the client through the object component after receiving the CRD resource, and deploy the converted CRD resource to the central node.
5. A cluster resource control method, characterized in that: Applied to the central node, the control method includes: Receive a resource template of a K8S cluster created by a client, and store the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node; Monitoring cluster resources in multiple edge nodes, and isolating and caching status information of the cluster resources locally in units of tenant accounts, wherein the tenant accounts are logged in on the client; Among them, the central node includes: an open application programming interface API component, which is connected to the client and is used to detect the call request of the client; a federal component, which is used to monitor the status information of the cluster resources in the multiple edge nodes and cache the status information locally. The federal component includes: a database, which is used to store the resource templates of the cluster resources and the release status information of the resource templates; a cache, which is used to monitor the cluster resources based on the resource templates in the multiple edge nodes, and locally isolate and cache the status information of the cluster resources in units of tenant accounts, and is also used to authenticate the client after receiving the call request from the client. After the authentication is passed, a communication connection with the client is established through a proxy, the locally cached status information is filtered according to the access rights of the client, and the filtered target status information is returned to the client.
6. A cluster resource control device, characterized in that: Applied to the central node, the control device comprises: A storage module, used to receive a resource template of a K8S cluster created by a client, and store the resource template in a database, wherein the resource template is used by the client to publish cluster resources on an edge node; A cache module, used to monitor cluster resources in multiple edge nodes, and locally isolate and cache status information of the cluster resources in units of tenant accounts, wherein the tenant accounts are logged in on the client; Among them, the central node includes: an open application programming interface API component, which is connected to the client and is used to detect the call request of the client; a federal component, which is used to monitor the status information of the cluster resources in the multiple edge nodes and cache the status information locally. The federal component includes: a database, which is used to store the resource templates of the cluster resources and the release status information of the resource templates; a cache, which is used to monitor the cluster resources based on the resource templates in the multiple edge nodes, and locally isolate and cache the status information of the cluster resources in units of tenant accounts, and is also used to authenticate the client after receiving the call request from the client. After the authentication is passed, a communication connection with the client is established through a proxy, the locally cached status information is filtered according to the access rights of the client, and the filtered target status information is returned to the client.
7. A storage medium, characterized in that: The storage medium includes a stored program, wherein the method steps of claim 5 are executed when the program is executed.
8. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein: The processor, the communication interface, and the memory communicate with each other via a communication bus; wherein: Memory, used to store computer programs; A processor, configured to execute the method steps of claim 5 by running a program stored in a memory.
