Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the principle of Scheduler in kubernetes

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article shows you what the Scheduler principle in kubernetes is, concise and easy to understand, absolutely can make you shine, through the detailed introduction of this article I hope you can gain something.

I: Introduction

1. Kubernetes scheduler assumes the important function of "connecting the upper and lower" in the whole system."Connecting" means that it is responsible for receiving the new Pod created by Controller Manager and arranging a landing Node for it; "Starting" means that after the placement work is completed, the kubelet service process on the target Node takes over the subsequent work.

2. Kubernetes scheduler is used to bind the Pod to be scheduled to a suitable Node in the cluster according to a specific scheduling algorithm and scheduling policy, and write the binding information into etcd. Three objects are involved in the whole scheduling process, namely: the Pod list to be scheduled, the available Node list, and the scheduling algorithm and policy.

3. The kubelet on the target node listens to the Pod binding event generated by the Kubernetes scheduler through the API Server, then obtains the corresponding Pod list, downloads the Image image, and starts the container.

II: Dispatching process

1. Pre-scheduling process, i.e. traversing all target nodes, screening out candidate nodes that meet the requirements.

2. Determine the optimal node, on the basis of the first step, calculate the integral of each candidate node by using the optimization strategy, and the one with the highest integral wins.

III: Pre-selection strategy

1. NoDiskConflict

Determine if there is a conflict between the gcePersistentDisk or AWSElasticBlockStore of the candidate Pod and the existing Pod in the candidate node.

2.PodFitsResources

Determine whether the resources of the candidate node meet the requirements of the candidate Pod.

3.PodSelectorMathes

Determines whether the candidate node contains the label specified by the label selector for the candidate Pod.

4.PodFitsHost

Determine whether the node name specified in the spec.nodeName field of the candidate Pod is consistent with the name of the candidate node. Returns true if consistent, false otherwise.

5.CheckNodeLabelPresence

If the user specifies the policy in the profile, the scheduler registers the policy through the RegisterCustomFitPredicate method.

6.CheckServiceAffinity

This policy is used to determine whether the candidate node contains the label specified by the policy, or contains a label list of the node where the Pod is located under the same Service and Namespace as the candidate Pod. Returns true if it exists, false otherwise.

7.PodFitsPorts

Determine whether the port in the port list used by the candidate Pod is occupied when selected. If occupied, return false; otherwise, return true.

IV: Optimal Strategy

1.LeastRequestedPriority

The node with the least resource consumption is selected from the candidate node list.

2.CalculateNodeLabelPriority

The policy is used to judge whether to select the candidate node when the label listed in the policy exists in the candidate node.

3.BalancedResourceAllocation

Select the node with the most balanced resource utilization rate from the candidate node list.

What is the Scheduler principle in kubernetes? Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserves, please pay attention to the industry information channel.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report