当前位置:网站首页>Kubernetes的pod
Kubernetes的pod
2022-06-26 14:38:00 【华为云】
Kubernetes的pod
pod是k8s的最小部署单元,本质是共享Network、IPC和UTS名称空间以及存储资源的容器集合,pod个进程运行在相互隔离的容器中,而各个容器是共享网络资源和存储资源的,每个pod都有个根容器pause,pod中有多个容器,容器之间共享网络和资源,pause容器管理着所有容器。pod中的多个应用更加方便交互。
网络共享
通过pause容器,把其他业务容器加入到pause容器中,让所有业务容器在同一个namespace下,从而实现网络共享。
资源共享
所有资源共享,就是pod进行持久化,当前pod被移除后,新的pod也能读到之前的数据,原理就是pod的持久化的时候把数据存储在volume数据卷中
拉取策略
IfNotPresent:镜像不存在的时候拉取
Always:每次创建pod的时候都拉取镜像
Never:永远不会主动拉取镜像
资源限制
pod可以设置资源限制,对于不符合资源限制大小的资源不进行调度
重启策略
pod的restartPolicy策略配置重启策略,Always表示容器终止退出的时候总是进行重启,默认是自动重启的,OnFailure表示当容器异常退出的时候才进行重启,Never表示不进行重启
健康检查
pod可以对服务进行健康检查,可以通过访问服务的接口或者与服务建立连接来判断服务是否健康,健康检测策略有存活检查livenessProbe和就绪检查readinessProbe
存活检查是如果检查失败的话会杀死容器,然后根据重启策略来进行操作
就绪检查是如果检查失败的话,kubernetes会把pod从service endpoints中移除
probe探针支持三种检测方式:
- httpget:发送http请求,返回200-400范围内的状态码即为成功
- exec:执行shell命令返回状态码是0即为成功
- tcpSocket:发起TCP Socket建立连接成功
️ 感谢大家
如果你觉得这篇内容对你挺有有帮助的话:
- 欢迎关注我️,点赞,评论,转发
- 关注
盼盼小课堂
,定期为你推送好文,还有群聊不定期抽奖活动,可以畅所欲言,与大神们一起交流,一起学习。
边栏推荐
- NVIDIA SMI error
- Informatics Olympiad all in one 1400: count the number of words (string matching)
- 房东拿租金去还房贷是天经地义的嘛
- Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
- Informatics Olympiad 1405: sum and product of prime numbers (thinking problem)
- Notes on writing questions in C language -- table tennis competition
- C语言基础知识入门(大全)「建议收藏」
- Caelus - full scene offline mixed Department solution
- MySQL master-slave replication and read-write separation
- Mathematical modeling of war preparation 30 regression analysis 2
猜你喜欢
Minister of investment of Indonesia: Hon Hai is considering establishing electric bus system and urban Internet of things in its new capital
'coach, I want to play basketball!'—— AI Learning Series booklet for system students
年薪50万是一条线,年薪100万又是一条线…...
TS常用数据类型总结
How to mount cloud disks in ECS
【 Native cloud】 Éditeur ivx Programmable par tout le monde
Matplotlib common operations
One copy ten, CVPR oral was accused of plagiarizing a lot, and it was exposed on the last day of the conference!
PostGIS create spatial database
赠书 | 《认知控制》:我们的大脑如何完成任务?
随机推荐
K gold Chef (two conditions, two points and difference)
年薪50万是一条线,年薪100万又是一条线…...
手机股票注册开户安全吗,有没有什么风险?
R语言dplyr包bind_rows函数把两个dataframe数据的行纵向(竖直)合并起来、最终行数为原来两个dataframe行数的加和(Combine Data Frames)
Error when redis is started: could not create server TCP listening socket *: 6379: bind: address already in use - solution
feil_uVission4左侧工目录消失
MHA high availability coordination and failover
NVIDIA SMI error
印尼投资部长:鸿海考虑在其新首都建立电动公交系统、城市物联网
Chinese output of PostGIS console is garbled
信息学奥赛一本通 1405:质数的和与积 (思维题)
R语言glm函数逻辑回归模型、使用epiDisplay包logistic.display函数获取模型汇总统计信息(自变量初始和调整后的优势比及置信区间,回归系数的Wald检验的p值)、结果保存到csv
Transformers datacollatorwithpadding class
Flex & bison start
Solution to the upper limit of TeamViewer display devices
15 bs对象.节点名称.节点名称.string 获取嵌套节点内容
VMware partial settings
Attention meets geometry: geometry guided spatiotemporal attention consistency self supervised monocular depth estimation
Caelus - full scene offline mixed Department solution
Complimentary Book Cognitive Control: how does our brain accomplish tasks?