当前位置:网站首页>Pod scheduling of kubernetes

Pod scheduling of kubernetes

2022-06-26 15:00:00 Hua Weiyun

Kubernetes Of pod Dispatch

establish pod technological process

User pass kubectl Get into apiserver in , Store relevant information in etcd in ,scheduler Get into apiserver See if there is pod The creation of , If there is , adopt etcd Read the corresponding pod, Then through the scheduling algorithm , hold pod Dispatch to some node In nodes , The result information is updated to API Server in ,API Server Update to etcd The storage system .pod Dispatched to node Node passing kubelet visit apiserver, Thus in etcd Read in the pod Information , And then through docker Create a container

establish pod command :

kubectl create deployment web --image=nginx

Then copy it three times

kubectl scale deployment web --replicas=3

see pod Allocation on nodes

kubectl get pods -o wide

influence pod Properties of scheduling

pod Of yaml Restrictions on resources in the file have an impact pod The scheduling , Node selector nodeSelector Labels can also affect pod The scheduling

For tagged resource objects , Use the tag selector to select the qualified resources to complete the required operations . When creating resources , Can be directly in its metadata Medium labels Property set label , Label with key-value Form settings , You can also use the following command

Commands for creating labels on nodes :

kubectl label node node1 env_role=dev

scheduler The daemon is responsible for selecting one of the working nodes based on the availability of system resources to run the system to be created pod object ,Kubernetes All work nodes are abstracted into resource pools, and resources are allocated and used uniformly .

User first node Set labels for resource objects , Then configure pod The object is matched and detected through the node label selector , Complete the scheduling of nodes

Node affinity nodeAffinity It's also related to scheduling , Node affinity is divided into hard affinity and soft affinity , Hard affinity indicates that the conditions must be met , Soft affinity conditions shall be met as far as possible .

The stain

The stain Taint Is an attribute of a node

View stain information :

kubectl describe node node1 | grep Taint

The value is NoSchedule Indicates that it will not be called ,PreferNoSchedule Means try not to schedule ,NoExecute It means that the current node will not be scheduled at the same time pod Delete

Add stain information :

kubectl taint node node1 env_role=yes:NoSchedule

Delete tainted information :

kubectl taint node node1 env_role:NoSchedule-

Stain tolerance attribute , Indicates that a node may be scheduled to even if it is tainted

️ Thank you for your

If you think this is helpful for you :

  1. Welcome to follow me ️, give the thumbs-up , Comment on , forward
  2. Focus on Panpan small class , Push good articles for you regularly , There are also group chat and irregular lottery activities , You can say what you want , Communicate with the great gods , Learning together .
原网站

版权声明
本文为[Hua Weiyun]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261438086852.html

随机推荐