当前位置:网站首页>Kubernetes的pod调度
Kubernetes的pod调度
2022-06-26 14:38:00 【华为云】
Kubernetes的pod调度
创建pod流程
用户通过kubectl进入apiserver中,把相关信息存储到etcd中,scheduler进入apiserver中看有没有pod的创建,如果有,通过etcd读取到对应的pod,然后通过调度算法,把pod调度到某个node节点中,结果信息更新到API Server中,API Server更新到etcd存储系统。pod被调度到的node节点通过kubelet访问apiserver,从而在etcd中读取到pod信息,然后通过docker创建容器
创建pod命令:
kubectl create deployment web --image=nginx然后复制三次
kubectl scale deployment web --replicas=3查看pod在节点上的分配情况
kubectl get pods -o wide影响pod调度的属性
pod的yaml文件中对资源的限制影响pod的调度,节点选择器nodeSelector标签也会影响pod的调度
对于附带标签的资源对象,使用标签选择器挑选出符合条件的资源完成所需操作。创建资源的时候,可以直接在其metadata中的labels属性设置标签,标签以key-value形式设置,也可以使用下面的命令
对节点创建标签的命令:
kubectl label node node1 env_role=devscheduler守护进程负责在各工作节点中基于系统资源的可用性挑选一个来运行待创建的pod对象,Kubernetes将所有工作节点抽象成资源池的资源统一分配使用。
用户先为node资源对象设定标签,然后配置pod对象通过节点标签选择器进行匹配检测,完成节点的调度
节点亲和性nodeAffinity也是和调度有关,节点亲和性分为硬亲和性和软亲和性,硬亲和性表示条件必须满足,软亲和性条件尽量满足。
污点
污点Taint是节点的属性
查看污点信息:
kubectl describe node node1 | grep Taint值为NoSchedule表示不会被调用,PreferNoSchedule表示尽量不调度,NoExecute表示不会被调度的同时会把当前节点的pod删掉
添加污点信息:
kubectl taint node node1 env_role=yes:NoSchedule删除污点信息:
kubectl taint node node1 env_role:NoSchedule-有污点容忍属性,表示某个节点即使设置了污点也有可能被调度到
️ 感谢大家
如果你觉得这篇内容对你挺有有帮助的话:
- 欢迎关注我️,点赞,评论,转发
- 关注
盼盼小课堂,定期为你推送好文,还有群聊不定期抽奖活动,可以畅所欲言,与大神们一起交流,一起学习。
边栏推荐
- R语言使用glm函数构建泊松对数线性回归模型处理三维列联表数据构建饱和模型、使用step函数基于AIC指标实现逐步回归筛选最佳模型、使用summary函数查看简单模型的汇总统计信息
- 手机股票注册开户安全吗,有没有什么风险?
- Excel-VBA 快速上手(二、条件判断和循环)
- 备战数学建模30-回归分析2
- GDAL and opencv smooth and blur TIF images
- 【使用yarn运行报错】The engine “node“ is incompatible with this module.
- Deploy the flask environment using the pagoda panel
- Use abp Zero builds a third-party login module (I): Principles
- D - Face Produces Unhappiness
- Where do people get their top energy?
猜你喜欢

Caelus - full scene offline mixed Department solution

This is the graceful file system mounting method, which is effective through personal testing

Stream常用操作以及原理探索

View触摸分析

Combat readiness mathematical modeling 32 correlation analysis 2

NAACL2022:(代码实践)好的视觉引导促进更好的特征提取,多模态命名实体识别(附源代码下载)...

年薪50万是一条线,年薪100万又是一条线…...

Unity uses skybox panoramic shader to make panorama preview. There is a gap. Solution

详解C语言编程题:任意三条边能否构成三角形,输出该三角形面积并判断其类型

The engine "node" is inconsistent with this module
随机推荐
Electron
Correlation of XOR / and
Two point answer, 01 score planning (mean / median conversion), DP
The engine "node" is inconsistent with this module
Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
710. 黑名单中的随机数
ArcGIS secondary development -- arcpy batch automatic map publishing service
【雲原生】 ”人人皆可“ 編程的無代碼 iVX 編輯器
Stream常用操作以及原理探索
fileinput. js php,fileinput
ArcGIS batch render layer script
Mark: unity3d cannot select resources in the inspector, that is, project locking
备战数学建模32-相关性分析2
【云原生】 ”人人皆可“ 编程的无代码 iVX 编辑器
挖财注册开户安全吗,有没有什么风险?
Naacl2022: (code practice) good visual guidance promotes better feature extraction, multimodal named entity recognition (with source code download)
What is the ranking of Guosen Securities? Is it safe to open a stock account?
Complimentary Book Cognitive Control: how does our brain accomplish tasks?
Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决
手机股票注册开户安全吗,有没有什么风险?