Movatterモバイル変換


[0]ホーム

URL:


CN113835834B - A capacity expansion method and system based on K8S container cluster computing nodes - Google Patents

A capacity expansion method and system based on K8S container cluster computing nodes
Download PDF

Info

Publication number
CN113835834B
CN113835834BCN202111060558.5ACN202111060558ACN113835834BCN 113835834 BCN113835834 BCN 113835834BCN 202111060558 ACN202111060558 ACN 202111060558ACN 113835834 BCN113835834 BCN 113835834B
Authority
CN
China
Prior art keywords
container cluster
computing node
capacity expansion
cluster
container
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202111060558.5A
Other languages
Chinese (zh)
Other versions
CN113835834A (en
Inventor
赵海丽
杨川
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Jinan data Technology Co ltd
Original Assignee
Inspur Jinan data Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Inspur Jinan data Technology Co ltdfiledCriticalInspur Jinan data Technology Co ltd
Priority to CN202111060558.5ApriorityCriticalpatent/CN113835834B/en
Publication of CN113835834ApublicationCriticalpatent/CN113835834A/en
Application grantedgrantedCritical
Publication of CN113835834BpublicationCriticalpatent/CN113835834B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及服务器技术领域,提供一种基于K8S容器集群计算节点的扩容方法及系统,方法包括:在K8S容器集群正常工作的同时,创建K8S容器集群的初期基础资源;判断初期基础资源创建是否完成;当创建完成时,控制自动安装K8S容器集群以及创建K8S容器集群的剩余基础资源;当K8S容器集群的自动安装以及剩余基础资源的创建完成后,控制进行K8S容器集群的计算节点的注册;判断计算节点的注册是否完成,是则确定K8S容器集群扩容成功,否则确定扩容失败;当判定初期基础资源创建失败时,则确定扩容失败,并结束,从而实现对K8S容器集群的自动扩容,而且不影响K8S容器集群的正常工作。

The present invention relates to the technical field of servers, and provides a capacity expansion method and system based on K8S container cluster computing nodes. The method comprises: while the K8S container cluster is working normally, creating initial basic resources of the K8S container cluster; judging whether the creation of the initial basic resources is completed; when the creation is completed, controlling the automatic installation of the K8S container cluster and the creation of the remaining basic resources of the K8S container cluster; when the automatic installation of the K8S container cluster and the creation of the remaining basic resources are completed, controlling the registration of the computing nodes of the K8S container cluster; judging whether the registration of the computing nodes is completed, if yes, determining that the capacity expansion of the K8S container cluster is successful, otherwise determining that the capacity expansion fails; when it is determined that the creation of the initial basic resources fails, determining that the capacity expansion fails, and ending, thereby realizing automatic capacity expansion of the K8S container cluster without affecting the normal operation of the K8S container cluster.

Description

Capacity expansion method and system based on K8S container cluster computing nodes
Technical Field
The invention belongs to the technical field of servers, and particularly relates to a capacity expansion method and system based on K8S container cluster computing nodes.
Background
Kubernetes is an open-source container-based cluster management platform, and aims to realize simple and efficient application of deploying containerization, and provide a mechanism for deploying, planning, updating and maintaining applications, namely K8S. A K8S system, commonly called a K8S Cluster (Cluster), mainly comprises two parts, namely a plurality of Master nodes (Master nodes) and a group of Node nodes (computing nodes). The K8S cluster is a containerized management system and is a set of cloud resources required by container operation. The system consists of a plurality of working nodes (cloud hosts or physical machines), load balancing, networks and other resources, and provides abundant and various functions of resource scheduling, deployment operation, service discovery, capacity expansion, capacity shrinkage and the like for containerized applications. Pod refers to the application load in the K8S cluster, and Pod runs on the node. Pod consists of one or more containers that share container storage, network, and container operating configuration items. The containers in Pod are always scheduled simultaneously, with a common operating environment, where:
Master nodes are mainly responsible for management and control, including API SERVER, schedulers, controller manager, and ETCD. API SERVER is the external interface of the whole system for the clients and other components to call, which is equivalent to a business hall. Schedulers are responsible for scheduling resources within a cluster, monitoring newly created pods that are not assigned to nodes, and selecting one node for their operation, i.e., scheduling of pods. Controller manager is responsible for managing the controller, which is equivalent to a "big manifold". ETCD is a default storage system provided by K8S, all cluster data are stored, and a backup plan is required to be provided for the ETCD data when the ETCD is used;
The Node nodes are nodes which truly run the workload, the Node nodes run the Pod distributed by the Master, and when one Node is down, the Pod on the Node is automatically transferred to other Node nodes. Each Node has installed Node components including Kubelet, kube-proxy, etc. Kubelet monitors the Pod allocated to the Node, takes charge of the lifecycle management of the Pod, and simultaneously, is closely cooperated with the Master to maintain and manage all containers on the Node, thereby realizing the basic functions of cluster management. Kube-proxy is primarily responsible for providing a proxy for Pod objects.
The K8S container is clustered, and in the using process, the capacity is too small to meet the new service requirement, and at the moment, the capacity expansion of the cluster Node is the simplest and most convenient way. The original container cluster Node capacity expansion mode is to manually create resources such as a cloud host and a cloud hard disk, mount the cloud hard disk to the cloud host after the resources are successfully created, then associate the cloud host which is successfully created to the container cluster by executing script commands, and finally manually configure related parameters to realize capacity expansion of the cluster, in a series of operation processes, certain functions in the container cluster need to be suspended, if the cloud host and the cloud hard disk are failed to be created, the cloud host and the cloud hard disk need to be manually deleted, and manual intervention is needed for the operation, so that automatic capacity expansion and cleaning of legacy data resources cannot be realized.
Disclosure of Invention
Aiming at the defects in the prior art, the invention provides a capacity expansion method based on a K8S container cluster computing node, which aims to solve the problems that the capacity expansion of the K8S container cluster in the prior art needs to be completed manually, the operation is inconvenient and the efficiency is low, and meanwhile, the related functions of the container cluster need to be suspended in the capacity expansion process.
The technical scheme provided by the invention is that the capacity expansion method based on the K8S container cluster computing node comprises the following steps:
According to the capacity expansion demand information of the K8S container cluster computing node of the user, establishing an initial basic resource of the K8S container cluster while the K8S container cluster works normally;
Judging whether the initial basic resource creation of the K8S container cluster is completed or not;
When the initial basic resource of the K8S container cluster is judged to be established, controlling to automatically install the K8S container cluster and establishing residual basic resources of the K8S container cluster;
After the automatic installation of the K8S container cluster and the creation of the residual basic resources are completed, controlling the registration of the computing nodes of the K8S container cluster;
judging whether the registration of the computing node is completed, if yes, determining that the K8S container cluster is successfully expanded, otherwise, determining that the K8S container cluster is failed to be expanded;
and when the initial basic resource creation of the K8S container cluster is judged to fail, determining that the expansion of the K8S container cluster fails, and ending.
Another object of the present invention is to provide a capacity expansion system based on a K8S container cluster computing node based on a capacity expansion method based on a K8S container cluster computing node, the system comprising:
The initial basic resource creation module is used for creating initial basic resources of the K8S container cluster when the K8S container cluster works normally according to the capacity expansion demand information of the K8S container cluster calculation node of the user;
The initial basic resource creation judging module is used for judging whether the initial basic resource creation of the K8S container cluster is completed or not;
The installation control module is used for controlling automatic installation of the K8S container cluster and creating residual basic resources of the K8S container cluster when the initial basic resource of the K8S container cluster is judged to be completely created;
The computing node registration module is used for controlling the registration of computing nodes of the K8S container cluster after the automatic installation of the K8S container cluster and the creation of the residual basic resources are completed;
a computing node registration judging module for judging whether the registration of the computing node is completed;
the capacity expansion success determining module is used for determining that the K8S container cluster is successfully expanded when the computing node registration judging module judges that the registration of the computing node is completed;
And the capacity expansion failure determining module is used for determining that the K8S container cluster fails in capacity expansion when judging that the initial basic resource of the K8S container cluster fails in establishment or when the computing node registration judging module judges that the computing node fails in registration, and ending.
According to the embodiment of the invention, according to the capacity expansion demand information of a K8S container cluster computing node of a user, initial basic resources of the K8S container cluster are created while the K8S container cluster works normally, whether the initial basic resources of the K8S container cluster are created is judged to be completed, when the initial basic resources of the K8S container cluster are judged to be created, the K8S container cluster is automatically installed and residual basic resources of the K8S container cluster are controlled to be created, when the automatic installation of the K8S container cluster and the creation of the residual basic resources are completed, the computing node registration of the K8S container cluster is controlled to be carried out, whether the registration of the computing node is completed is judged, if yes, the capacity expansion of the K8S container cluster is determined to be successful, otherwise, the capacity expansion failure of the K8S container cluster is determined, and the automatic capacity expansion of the K8S container cluster is finished is controlled to be achieved, and the K8S container cluster is not influenced, and the normal work is not convenient.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below. Like elements or portions are generally identified by like reference numerals throughout the several figures. In the drawings, elements or portions thereof are not necessarily drawn to scale.
FIG. 1 is a flow chart of an implementation of a capacity expansion method based on K8S container cluster computing nodes;
fig. 2 is a block diagram of a capacity expansion system based on a K8S container cluster computing node.
Detailed Description
Embodiments of the technical scheme of the present invention will be described in detail below with reference to the accompanying drawings. The following examples are only for the purpose of more clearly illustrating the technical aspects of the present invention, and thus are merely exemplary and are not to be construed as limiting the scope of the present invention.
Fig. 1 is a flowchart of implementation of a capacity expansion method based on a K8S container cluster computing node, which specifically includes the following steps:
In step S101, according to expansion demand information of a user' S K8S container cluster computing node, an initial basic resource of the K8S container cluster is created while the K8S container cluster is working normally;
In step S102, determining whether the initial basic resource creation of the K8S container cluster is completed, if yes, executing step S103, otherwise, executing step S07;
in step S103, when it is determined that the initial basic resource creation of the K8S container cluster is completed, controlling to automatically install the K8S container cluster and create the remaining basic resources of the K8S container cluster;
in step S104, after the automatic installation of the K8S container cluster and the creation of the remaining basic resources are completed, controlling the registration of the computing nodes of the K8S container cluster;
In step S105, it is determined whether the registration of the computing node is completed, if yes, step S106 is performed, otherwise step S107 is performed;
in step S106, when it is determined that the registration of the computing node is completed, it is determined that the K8S container cluster expansion is successful;
in step S107, when it is determined that the registration of the computing node fails, or when it is determined that the initial basic resource creation of the K8S container cluster fails, it is determined that the K8S container cluster fails in expansion, and ends.
In this embodiment, on the premise that the normal operation of the K8S container cluster is not affected, the capacity expansion of the container cluster computing nodes is automatically completed, so that the method is convenient and fast, and the number of the expanded computing nodes can be carried out according to actual requirements, which is not described herein.
In the embodiment of the present invention, the following steps are further required to be performed before the step S101 is performed:
(1) When the K8S container cluster is built, receiving the capacity expansion requirement of the K8S container cluster computing node input by a user, wherein the action of receiving the capacity expansion requirement of the K8S container cluster computing node input by the user is realized through middleware Cetus of a relational database, the middleware Cetus of the relational database is built in an open-source cloud computing management platform project OpenStack, cetus is the middleware of a relational database MySQL developed by a C language, and a comprehensive database access proxy function is mainly provided. The Cetus connection mode is basically compatible with MySQL, an application program can access the database through the Cetus with little modification, horizontal expansion and high availability of a database layer are achieved, and OpenStack provides extensible and elastic cloud computing services for private cloud and public cloud. The project aims to provide a cloud computing management platform which is simple to implement, can be expanded in a large scale, is rich and has unified standards;
(2) Analyzing the capacity expansion demand of the K8S container cluster computing node input by the user to obtain capacity expansion demand information of the K8S container cluster computing node;
(3) Calling an arrangement service component interface Heat according to capacity expansion demand information of a K8S container cluster computing node, wherein the arrangement service component interface Heat is used for creating initial basic resources of the K8S container cluster, and the initial basic resources of the K8S container cluster comprise a cloud host, a security group and a cloud hard disk;
The step of calling the orchestration service component interface Heat is implemented through middleware cetus of the relational database.
In the embodiment of the invention, as shown in the scheme of fig. 1, when the initial basic resource creation of the K8S container cluster is judged to fail, or when the registration of the computing node is judged to fail, the arrangement service component interface Heat is called to automatically delete the basic resource which is already created, and the created basic resource is automatically deleted, so that the left garbage resource is not generated, and the normal work of the K8S container cluster is not influenced.
In the embodiment of the invention, while the capacity expansion of the computing node is performed, the K8S container cluster is in a normal working state, wherein the cluster state of the K8S container cluster can be set as follows so as to clearly know the current state:
changing the cluster state of the K8S container cluster from available to available and expanding while executing the step of creating the initial basic resource of the K8S container cluster;
When the initial basic resource creation failure of the K8S container cluster is judged, or the registration failure of the computing node is judged, calling an arrangement service component interface Heat to automatically delete the basic resource which is already created, and changing the cluster state of the K8S container cluster from available to available and expansion failure;
And when the capacity expansion of the K8S container cluster is determined to be successful, changing the cluster state of the K8S container cluster from available to available in capacity expansion, and the capacity expansion is successful.
In the embodiment of the invention, the capacity of the container cluster Node is expanded under the condition that the external service of the cluster is not influenced. And because of external factors such as network, host memory and the like, when the cluster expansion fails, cetus and Heat related interfaces are automatically called, the automatic deletion of initial basic resources such as created cloud hosts, cloud hard disks, security groups and the like is realized, and no legacy garbage resources are generated.
Fig. 2 is a block diagram of a capacity expansion system based on a K8S container cluster computing node according to the present invention, and for convenience of explanation, only a portion related to an embodiment of the present invention is shown in the figure.
The capacity expansion system based on the K8S container cluster computing node comprises:
The initial basic resource creation module 11 is configured to create initial basic resources of a K8S container cluster while the K8S container cluster is working normally according to expansion demand information of a user' S K8S container cluster computing node;
an initial basic resource creation judging module 12, configured to judge whether initial basic resource creation of the K8S container cluster is completed;
an installation control module 13, configured to control automatic installation of the K8S container cluster and creation of remaining basic resources of the K8S container cluster when it is determined that initial basic resource creation of the K8S container cluster is completed;
A computing node registration module 14, configured to control registration of computing nodes of the K8S container cluster when automatic installation of the K8S container cluster and creation of the remaining basic resources are completed;
a computing node registration judging module 15, configured to judge whether registration of the computing node is completed;
The capacity expansion success determining module 16 is configured to determine that the capacity expansion of the K8S container cluster is successful when the registration of the computing node is determined to be completed by the computing node registration determining module;
and the capacity expansion failure determining module 17 is configured to determine that the K8S container cluster fails in capacity expansion when it is determined that the K8S container cluster fails in initial basic resource creation, or when the computing node registration determining module determines that the computing node fails in registration, and end.
In this embodiment, the system further comprises:
the capacity expansion requirement receiving module 18 is configured to receive a capacity expansion requirement of a K8S container cluster computing node input by a user when the K8S container cluster is created;
The capacity expansion demand analysis module 19 is configured to analyze the capacity expansion demand of the K8S container cluster computing node input by the user, and obtain capacity expansion demand information of the K8S container cluster computing node;
The first orchestration service component interface calling module 20 is configured to call an orchestration service component interface Heat according to capacity expansion requirement information of a K8S container cluster computing node, where the orchestration service component interface Heat is configured to create an initial base resource of the K8S container cluster, and the initial base resource of the K8S container cluster includes a cloud host, a security group, and a cloud hard disk.
In an embodiment of the present invention, the system further includes:
the second orchestration service component interface calling module 21 is configured to call an orchestration service component interface Heat to automatically delete a created base resource when it is determined that the initial base resource of the K8S container cluster fails to be created, or when it is determined that the registration of the computing node fails.
In an embodiment of the present invention, as shown in fig. 2, the system further includes:
The cluster state updating module 22 is configured to synchronously update the cluster state of the K8S container cluster during the execution of the capacity expansion of the K8S container cluster computing node;
wherein, the cluster state updating module 22 specifically includes:
A first cluster state updating module 23, configured to change the cluster state of the K8S container cluster from "available" to "available" while performing the step of creating the initial base resource of the K8S container cluster, and expanding the K8S container cluster;
A second cluster state updating module 24, configured to, when it is determined that the initial basic resource of the K8S container cluster fails to be created, or when it is determined that the registration of the computing node fails, invoke an orchestration service component interface Heat to automatically delete the basic resource that has been created, change the cluster state of the K8S container cluster from "available," in expansion, and "expansion failure";
And the third cluster state updating module 25 is configured to change the cluster state of the K8S container cluster from "available" to "available" in the expansion and to successfully expand the capacity while determining that the expansion of the K8S container cluster is successful.
Under the condition that the external service of the K8S container cluster is not influenced, the capacity of the K8S container cluster is expanded, and the beneficial effects are brought:
1. the method is convenient and quick, when the capacity of the cluster cannot meet the requirement of the newly added service, the capacity of the customer can be directly expanded, the original service function is not influenced, and after the capacity expansion is finished, the new service can be directly deployed;
2. the function of one-key capacity expansion is completely realized, and even for people unfamiliar with business, successful capacity expansion of the cluster can be realized, so that time and labor are saved;
3. Controllable, can expand one or more Node nodes according to the business needs, realize the Node is controllable, save the economic cost;
4. Under the condition that the external service of the K8S container cluster is not affected, the K8S container cluster is expanded, and when the expansion failure of the cluster is caused by external factors such as a network, a host memory and the like, cetus and Heat related interfaces are automatically called, the successfully created basic resources are automatically deleted, and the legacy garbage resources are not generated.
The embodiments are only used to illustrate the technical scheme of the present invention, but not to limit the technical scheme, and although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that the technical scheme described in the foregoing embodiments may be modified or some or all technical features may be equivalently replaced, and the modification or replacement does not make the essence of the corresponding technical scheme deviate from the scope of the technical scheme of the embodiments of the present invention, and is included in the scope of the claims and the specification of the present invention.

Claims (10)

CN202111060558.5A2021-09-102021-09-10 A capacity expansion method and system based on K8S container cluster computing nodesActiveCN113835834B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN202111060558.5ACN113835834B (en)2021-09-102021-09-10 A capacity expansion method and system based on K8S container cluster computing nodes

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN202111060558.5ACN113835834B (en)2021-09-102021-09-10 A capacity expansion method and system based on K8S container cluster computing nodes

Publications (2)

Publication NumberPublication Date
CN113835834A CN113835834A (en)2021-12-24
CN113835834Btrue CN113835834B (en)2025-07-11

Family

ID=78958832

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN202111060558.5AActiveCN113835834B (en)2021-09-102021-09-10 A capacity expansion method and system based on K8S container cluster computing nodes

Country Status (1)

CountryLink
CN (1)CN113835834B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN115643169A (en)*2022-08-162023-01-24北京百度网讯科技有限公司 Cloud computing resource expansion method, intelligent local computing cluster and storage medium
US11954525B1 (en)2022-09-212024-04-09Zhejiang LabMethod and apparatus of executing collaborative job for spark faced to multiple K8s clusters
CN115242877B (en)*2022-09-212023-01-24之江实验室Spark collaborative computing and operating method and device for multiple K8s clusters
CN116132267B (en)*2022-12-302025-07-04天翼物联科技有限公司 Internet of Things device platform based on public cloud and its deployment method
CN115883563A (en)*2022-12-302023-03-31天翼云科技有限公司 A communication method, platform and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111464355A (en)*2020-03-312020-07-28北京金山云网络技术有限公司Method and device for controlling expansion capacity of Kubernetes container cluster and network equipment
CN111522622A (en)*2020-04-142020-08-11上海仪电(集团)有限公司中央研究院K8S quick starting method based on cloud platform

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN109150987B (en)*2018-07-272021-11-30北京友普信息技术有限公司Two-layer container cluster elastic expansion method based on host layer and container layer
CN113169952B (en)*2018-09-292022-12-02北京连云决科技有限公司 A container cloud management system based on blockchain technology
CN110290189B (en)*2019-06-172023-04-18深圳前海微众银行股份有限公司Container cluster management method, device and system
CN113055416B (en)*2019-12-262022-07-22华为技术有限公司 Container cluster node resource pool management method and device
CN111339055B (en)*2020-02-072023-08-01浪潮软件股份有限公司Big data cluster capacity expansion method and device
CN112328184B (en)*2020-12-032023-11-21北京联创信安科技股份有限公司Cluster capacity expansion method, device, equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111464355A (en)*2020-03-312020-07-28北京金山云网络技术有限公司Method and device for controlling expansion capacity of Kubernetes container cluster and network equipment
CN111522622A (en)*2020-04-142020-08-11上海仪电(集团)有限公司中央研究院K8S quick starting method based on cloud platform

Also Published As

Publication numberPublication date
CN113835834A (en)2021-12-24

Similar Documents

PublicationPublication DateTitle
CN113835834B (en) A capacity expansion method and system based on K8S container cluster computing nodes
CN111522628B (en)Kubernetes cluster building deployment method, framework and storage medium based on OpenStack
CN112667362B (en)Method and system for deploying Kubernetes virtual machine cluster on Kubernetes
CN111290834B (en)Method, device and equipment for realizing high service availability based on cloud management platform
CN107005426B (en) A kind of life cycle management method and device of virtual network function
CN103200036B (en)A kind of automation collocation method of electric power system cloud computing platform
CN111641515B (en)VNF life cycle management method and device
US20230342183A1 (en)Management method and apparatus for container cluster
CN112698992B (en)Disaster recovery management method and related device for cloud cluster
CN105630589A (en)Distributed process scheduling system and process scheduling and execution method
CN113918281A (en)Method for improving cloud resource expansion efficiency of container
CN115801799A (en)System for managing middleware life cycle based on kubernets multiple clusters
CN110932914B (en)Deployment method, deployment device, hybrid cloud system architecture and computer storage medium
CN110764918A (en)Method for managing main nodes in container cluster
CN112925852A (en)Distributed database designated node capacity reduction method
CN114615268A (en)Service network, monitoring node, container node and equipment based on Kubernetes cluster
CN115915404A (en)Network slice deployment system and method based on NFV-MANO
CN116010111B (en)Cross-cluster resource scheduling method, system and terminal equipment
CN113515316A (en)Novel edge cloud operating system
CN114721827B (en)Data processing method and device
CN113037881A (en)Cloud native service uninterrupted IP replacement method based on Kubernetes
CN116962185A (en)Gateway management and control method, device, electronic equipment and computer program product
CN119065803A (en) Scheduled task scheduling method and system
CN114443059A (en) Deployment method, device and equipment of Kubernetes cluster
CN116112499B (en)Construction method of data acquisition system and data acquisition method

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp