[go: up one dir, main page]

CN110086726A - A method of automatically switching Kubernetes host node - Google Patents

A method of automatically switching Kubernetes host node Download PDF

Info

Publication number
CN110086726A
CN110086726A CN201910322772.XA CN201910322772A CN110086726A CN 110086726 A CN110086726 A CN 110086726A CN 201910322772 A CN201910322772 A CN 201910322772A CN 110086726 A CN110086726 A CN 110086726A
Authority
CN
China
Prior art keywords
node
kubernetes
host node
host
cluster
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.)
Pending
Application number
CN201910322772.XA
Other languages
Chinese (zh)
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.)
Space Cloud Network Technology Development LLC
Original Assignee
Space Cloud Network Technology Development LLC
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 Space Cloud Network Technology Development LLC filed Critical Space Cloud Network Technology Development LLC
Priority to CN201910322772.XA priority Critical patent/CN110086726A/en
Publication of CN110086726A publication Critical patent/CN110086726A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1008Server selection for load balancing based on parameters of servers, e.g. available memory or workload

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Hardware Design (AREA)
  • General Engineering & Computer Science (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of methods for automatically switching Kubernetes host node, including the following steps: the first step, in Kubernetes cluster, section, calculates the load capacity weighted score of each node at regular intervals;The weighted score of each node is stored in ETCD distribution key/value.Second step selects the least node of load when host node delay machine in Kubernetes cluster from node, starts Kubernetes host node by the node, configures virtual IP address for the host node, other nodes start Kubernetes host node program.When the state of delay machine occurs in host node in kubernetes cluster, this method can go out a host node from the host automatic election of other in cluster to work on, and provide High Availabitity ability for cluster, and cost is relatively low.

Description

A method of automatically switching Kubernetes host node
Technical field
The present invention relates to field of cloud computer technology, especially a kind of method for automatically switching Kubernetes host node.
Background technique
Container technique is a kind of operating system layer virtualization technology of kernel lightweight, and the application software of user can operate in In container, container technique has many advantages:
1. agile environment: container technique biggest advantage is that creation container instance is more faster than creation virtual machine example, is held The script of device lightweight can reduce expense in terms of performance and size.
2. increasing productivity: container improves the productivity of developer by removing to rely on and conflict across service.Each appearance Device can be regarded as one it is different be served by, therefore can with standalone upgrade, and do not have to worry synchronize.
3. Version Control: the mirror image of each container has Version Control, can thus track the container of different editions, Monitor the difference between version.
4. running environment portable: container encapsulates relevant details necessary to all operation application programs and such as applies Dependence and operating system.
5. standardization: most of containers be based on open standard, may operate in all mainstream Linux releases, Microsoft platform etc..
6. safety: what the process between container was mutually isolated, infrastructure therein is also such.In this way one of them The upgrading or variation of container will not influence other containers.
Kubernetes is the distributed type assemblies management system based on container technique, multiple in cloud platform for managing The application of containerization on host is provided using functions such as deployment, maintenance, extensions, can easily using kubernetes Across host container change application is managed, critical function includes:
1. using container technique to application package dress, instantiation, operation.
2. being run in a manner of cluster, managing the container across machine.
3. solving container across the Communication between machine container.
The self-regeneration mechanism of 4.Kubernetes makes container cluster always operate in the desired state of user.
Hardware load balancing solution is the installation load equalizing equipment directly between server and external network, this to set Standby normally referred to as load balancer, since special equipment completes special task, independently of operating system, overall performance is obtained It is improved to a large amount of, in addition diversified load balancing, intelligentized traffic management, can reach optimal load balancing is needed It asks.In general, hardware load equilibrium is better than software mode in function, performance, but it is expensive.
The prior art has following defect:
1. increase hardware load equalization server undoubtedly increases use cost for O&M.
2. group system can enter state of paralysis when host node delay machine.
3. no matter external hardware or third party software, cannot all possess simultaneously cluster host node high availability and externally Load balancing void IP ability is provided.
Summary of the invention
The present invention provides a kind of method for automatically switching Kubernetes host node, when host node in kubernetes cluster When there is the state of delay machine, a host node can be gone out from the host automatic election of other in cluster to work on, for collection Group provides High Availabitity ability, and cost is relatively low.
The present invention includes the following steps:
S1: in Kubernetes cluster, section, calculates the load capacity weighted score of each node at regular intervals; The weighted score of each node is stored in ETCD distribution key/value;
S2: when host node delay machine in Kubernetes cluster, the least node of load is selected from node, by the node Start Kubernetes host node, configures virtual IP address for the host node, other nodes start Kubernetes host node program.
Optionally, the load capacity weighted score of each node is calculated using following formula:
FinalScoreNode=ETCD* [(weight1*priorityFunc1)+(weight2*priorityFunc2) +…+(weight3*priorityFunc3)]
Wherein: finalScoreNode is load capacity weighted score, and ETCD is host ETCD cluster availability, can be used Being is 1, is 0 when unavailable;Weight1 is 1, priorityFunc1 for using free time cpu utilization rate calculating score;weight2 It is to calculate score using free memory utilization rate for 1, priorityFunc2;Weight3 is that 1, priorityFunc3 is to use Free hard disk capacity utilization calculates score;
Above-mentioned finalScoreNode maximum value is to load least node.
Technical solution of the present invention have it is following the utility model has the advantages that
1. realizing that load balance ability the method realizes more save the cost by software compared to by hardware device.
2. hardware load equalizing equipment, which is realized, to provide service ability according to kubernetes clustered node availability.
3. the method can be from the host of other in cluster when the state of delay machine occurs in host node in kubernetes cluster Machine automatic election goes out a host node to work on, and provides High Availabitity ability for cluster.
Detailed description of the invention
Fig. 1 is the application structure figure of the embodiment of the present invention.
Specific embodiment
For Kubernetes current version in design, cluster host node must include kube-apiserver, kube- Tri- core components of scheduler, kube-controller-manager, system need to be deployed in same physics when running On machine or virtual machine, once host node interrupts service, it is unavailable to will lead to all nodes of cluster, causes serious accident, i.e., High availability scheme is not provided with for cluster host node service, while current Kubernetes version is to the outside access of application It is not provided with load-balancing function, if to come by external load balancing hardware device or third-party software real It is existing, since incompatible Kubernetes service also needs customized development.
It is an object of the invention to provide a kind of switching of realization kubernetes cluster host node and has soft load balancing Method, be able to solve the above problem, present invention is further described in detail with reference to the accompanying drawing.
Fig. 1 is the application structure figure of the embodiment of the present invention, as shown, NODE is computer node, Master is Kubernetes cluster host node, k8sproxy are to grind application certainly, while providing Kubernetes cluster host node high availability Function VIP service balanced with cluster external loading.
Implementation: host preference rule gives a mark to the Host List for meeting demand, and one score value of final choice is most High host-initiated kubernetes cluster host node, each pri function can return to the score of a 0-10, and score is got over Height indicates that host gets over " good ", while each function can also correspond to the value of an expression weight.The score of final host computer is with following Formula is calculated:
FinalScoreNode=ETCD* [(weight1*priorityFunc1)+(weight2*priorityFunc2) +…+(weightn*priorityFuncn)]
Wherein: finalScoreNode is load capacity weighted score, and ETCD is host ETCD cluster availability, can be used Being is 1, is 0 when unavailable;Weight1 is 1, priorityFunc1 for using free time cpu utilization rate calculating score;weight2 It is to calculate score using free memory utilization rate for 1, priorityFunc2;Weight3 is that 1, priorityFunc3 is to use Free hard disk capacity utilization calculates score.
The present embodiment only considered cpu, memory and hard disk, can according to circumstances consider the use of other resources on this basis Situation, method are identical with this, and details are not described herein.
Weight1~weightn can be adjusted according to the actual situation, in priorityFunc1~priorityFuncn The data of calculating, default realize that score is corresponded divided by 0.1 using by idle percentages, such as percentage is 90%, that PriorityFunc return value is 0.9/0.1=9.
Each node is by calculating one to indexs weighted values such as host CPU, memory, hard disk and ETCD cluster robustnesses A node calculated value, and the calculated value of this node can be run in ETCD distribution key/value storage in each node Monitoring programme, Timing Synchronization obtains the calculated value of clustered node, and selects optimal node by value sequence.Optimal node will start Kubernetes host node program, and configuration void IP are serviced, other non-optimal nodes then start from kubernetes from node Program, and remove void IP operation.
The present embodiment has only been illustratively described a kind of Weight algorithm, however the present invention be not limited to it is described here Embodiment, the scope of the present invention further includes the various change made on this basis.

Claims (2)

1. a kind of method for automatically switching Kubernetes host node, characterized in that it comprises the following steps:
S1: in Kubernetes cluster, section, calculates the load capacity weighted score of each node at regular intervals;It will be every The weighted score of a node is stored in ETCD distribution key/value;
S2: when host node delay machine in Kubernetes cluster, the least node of load is selected from node, is started by the node Kubernetes host node configures virtual IP address for the host node, other nodes start Kubernetes host node program.
2. the method according to claim 1 for automatically switching Kubernetes host node, it is characterised in that: each section The load capacity weighted score of point is calculated using following formula:
FinalScoreNode=ETCD* [(weight1*priorityFunc1)+(weight2*priorityFunc2) ++ (weight3*priorityFunc3)]
Wherein: finalScoreNode be load capacity weighted score, ETCD be host ETCD cluster availability, can be for 1, it is 0 when unavailable;Weight1 is 1, priorityFunc1 for using free time cpu utilization rate calculating score;Weight2 is 1, PriorityFunc2 is to calculate score using free memory utilization rate;Weight3 is 1, priorityFunc3 for using idle Hard-disk capacity utilization rate calculates score;
Above-mentioned finalScoreNode maximum value is to load least node.
CN201910322772.XA 2019-04-22 2019-04-22 A method of automatically switching Kubernetes host node Pending CN110086726A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910322772.XA CN110086726A (en) 2019-04-22 2019-04-22 A method of automatically switching Kubernetes host node

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910322772.XA CN110086726A (en) 2019-04-22 2019-04-22 A method of automatically switching Kubernetes host node

Publications (1)

Publication Number Publication Date
CN110086726A true CN110086726A (en) 2019-08-02

Family

ID=67415912

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910322772.XA Pending CN110086726A (en) 2019-04-22 2019-04-22 A method of automatically switching Kubernetes host node

Country Status (1)

Country Link
CN (1) CN110086726A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641522A (en) * 2020-05-25 2020-09-08 杭州安恒信息技术股份有限公司 Method, system and computer equipment for node switching
CN111708659A (en) * 2020-06-10 2020-09-25 中国—东盟信息港股份有限公司 Method for constructing cloud native disaster tolerance architecture based on kubernets
CN112367214A (en) * 2020-10-12 2021-02-12 成都精灵云科技有限公司 Method for rapidly detecting and switching main node based on etcd
CN113407257A (en) * 2021-06-09 2021-09-17 交控科技股份有限公司 Mysql cluster deployment method and device, electronic equipment and storage medium
WO2022033121A1 (en) * 2020-08-14 2022-02-17 苏州浪潮智能科技有限公司 Method and system for resource exposure in kubernetes, and device and medium
CN114390052A (en) * 2021-12-30 2022-04-22 武汉达梦数据技术有限公司 Method and device for realizing high availability of ETCD (electronic toll Collection) double nodes based on VRRP (virtual router redundancy protocol)
CN114584458A (en) * 2022-03-03 2022-06-03 平安科技(深圳)有限公司 Cluster disaster recovery management method, system, equipment and storage medium based on ETCD
CN115499447A (en) * 2022-09-15 2022-12-20 北京天融信网络安全技术有限公司 A cluster master node confirmation method, device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229695A1 (en) * 2013-02-13 2014-08-14 Dell Products L.P. Systems and methods for backup in scale-out storage clusters
CN104283948A (en) * 2014-09-26 2015-01-14 东软集团股份有限公司 Server cluster system and load balancing implementation method thereof
CN106713056A (en) * 2017-03-17 2017-05-24 郑州云海信息技术有限公司 Method for selecting and switching standbys under distributed cluster
CN106888254A (en) * 2017-01-20 2017-06-23 华南理工大学 A kind of exchange method between container cloud framework based on Kubernetes and its each module

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140229695A1 (en) * 2013-02-13 2014-08-14 Dell Products L.P. Systems and methods for backup in scale-out storage clusters
CN104283948A (en) * 2014-09-26 2015-01-14 东软集团股份有限公司 Server cluster system and load balancing implementation method thereof
CN106888254A (en) * 2017-01-20 2017-06-23 华南理工大学 A kind of exchange method between container cloud framework based on Kubernetes and its each module
CN106713056A (en) * 2017-03-17 2017-05-24 郑州云海信息技术有限公司 Method for selecting and switching standbys under distributed cluster

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111641522A (en) * 2020-05-25 2020-09-08 杭州安恒信息技术股份有限公司 Method, system and computer equipment for node switching
CN111708659A (en) * 2020-06-10 2020-09-25 中国—东盟信息港股份有限公司 Method for constructing cloud native disaster tolerance architecture based on kubernets
WO2022033121A1 (en) * 2020-08-14 2022-02-17 苏州浪潮智能科技有限公司 Method and system for resource exposure in kubernetes, and device and medium
US12010166B2 (en) 2020-08-14 2024-06-11 Inspur Suzhou Intelligent Technology Co., Ltd. Method and system for resource exposure in kubernetes, and device and medium
CN112367214A (en) * 2020-10-12 2021-02-12 成都精灵云科技有限公司 Method for rapidly detecting and switching main node based on etcd
CN112367214B (en) * 2020-10-12 2022-06-14 成都精灵云科技有限公司 Method for rapidly detecting and switching main node based on etcd
CN113407257A (en) * 2021-06-09 2021-09-17 交控科技股份有限公司 Mysql cluster deployment method and device, electronic equipment and storage medium
CN114390052A (en) * 2021-12-30 2022-04-22 武汉达梦数据技术有限公司 Method and device for realizing high availability of ETCD (electronic toll Collection) double nodes based on VRRP (virtual router redundancy protocol)
CN114390052B (en) * 2021-12-30 2023-10-10 武汉达梦数据技术有限公司 Method and device for realizing ETCD double-node high availability based on VRRP protocol
CN114584458A (en) * 2022-03-03 2022-06-03 平安科技(深圳)有限公司 Cluster disaster recovery management method, system, equipment and storage medium based on ETCD
CN115499447A (en) * 2022-09-15 2022-12-20 北京天融信网络安全技术有限公司 A cluster master node confirmation method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110086726A (en) A method of automatically switching Kubernetes host node
KR102650892B1 (en) Apparatus for container orchestration in geographically distributed multi cloud environment and method using the same
EP2652594B1 (en) Multi-tenant, high-density container service for hosting stateful and stateless middleware components
EP3270289B1 (en) Container-based multi-tenant computing infrastructure
US8862720B2 (en) Flexible cloud management including external clouds
CN101593134B (en) virtual machine CPU resource allocation method and device
US8271653B2 (en) Methods and systems for cloud management using multiple cloud management schemes to allow communication between independently controlled clouds
CN108337109B (en) Resource allocation method and device and resource allocation system
US8656404B2 (en) Statistical packing of resource requirements in data centers
US20220318071A1 (en) Load balancing method and related device
CN110231976B (en) A method and system for container deployment on an edge computing platform based on load prediction
US9184982B2 (en) Balancing the allocation of virtual machines in cloud systems
US20110055377A1 (en) Methods and systems for automated migration of cloud processes to external clouds
US20170141944A1 (en) Verifier for network function virtualization resource allocation
Megharaj et al. A survey on load balancing techniques in cloud computing
CN103677983B (en) The dispatching method and device of application
CN110838939B (en) A lightweight container-based scheduling method and edge IoT management platform
Singh et al. Survey on various load balancing techniques in cloud computing
US12386670B2 (en) On-demand clusters in container computing environment
CN111240824A (en) CPU resource scheduling method and electronic equipment
CN120560776A (en) Container rescheduling method, system, device, storage medium and program product
US20200394071A1 (en) Systems and methods for cluster resource balancing in a hyper-converged infrastructure
Wu et al. ABP scheduler: Speeding up service spread in docker swarm
CN113590317B (en) Offline service scheduling method, device, medium and computing equipment
KR102231359B1 (en) Single virtualization system for HPC cloud service and process scheduling method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20190802

RJ01 Rejection of invention patent application after publication