当前位置:网站首页>Kubernetes----Pod配置资源配额
Kubernetes----Pod配置资源配额
2022-07-26 14:11:00 【51CTO】
一、Pod资源配额
1.1 资源配额配置简介
容器中的程序要运行,肯定是要占用一定资源的,比如CPU和内存等,如果不对某个容器的资源做限制,那么它就可能吃掉大量资源,导致气他容器无法运行,针对这种情况,kubernetes提供了对内存和CPU的资源进行配额的机制,这种机制主要通过resources选项类实现,它有两个子选项
- limits:用于限制运行时容器的最大占用资源,当容器占用资源超过limits时会被终止,并进行重启
- requests:用于设置容器需要的最小资源,如果环境资源不够,容器就无法启动
1.2 资源配额配置
如下,编辑pod_base.yaml文件,对nginx容器设置资源上限和下限设置
使用如下命令创建pod
使用如下命令查询pod,发现此时的配额配置,环境是满足要求的,pod是能正常启动的
使用如下命令删除资源
1.3 配额超额配置测试
这里可以做个实验,将cpu下限修改为10,上限修改为20,然后再次尝试,因为这里虚拟机的核数是4,下限修改为10后是明显不能满足要求的
然后使用如下命令创建:
再次重新创建后通过如下命令可以看到这里提示cpu不够用了
使用如下命令删除资源
边栏推荐
- Annotation and reflection
- 作业7.25 排序与查找
- 基于SPO语义三元组的疾病知识发现
- 【论文阅读】GRAW+:A Two-View Graph Propagation Method With Word Coupling for Readability Assessment
- First knowledge of opencv4.x --- image perspective transformation
- Construction practice of pipeline engine of engineering efficiency ci/cd
- 基于多特征的技术融合关系预测及其价值评估
- My creation Anniversary - from the heart
- 【深度学习】全连接网络
- Technology sharing | gtid that needs to be configured carefully_ mode
猜你喜欢

【深度学习】全连接网络

"Intermediate and advanced test questions": what is the implementation principle of mvcc?

Digital collections accelerate the breaking of the circle and help the industry find new opportunities

IDEA(warning)No artifacts configured

基于用户画像的在线健康社区用户流失预测研究

gdb常用命令

First knowledge of opencv4.x --- image perspective transformation

redis学习笔记

1对1直播源码——1对1语音聊天源码

My creation Anniversary - from the heart
随机推荐
JS submit the form to determine whether the user name and password are empty
~6. CCF 2021-09-1 array derivation
Understand the meaning of length in MySQL data types
如何评价测试质量?
[GYCTF2020]FlaskApp
Comparison between agile development and Devops
手持振弦采集仪VH03各种接口使用说明
C language_ Structure pointer to access structure array
2022-07-26日报:Alphafold DB数据库建立一周年,官推盘点亮点研究
【数学建模】常用基本模型总结
Install dexdump on win10 and remove the shell
.net6与英雄联盟邂逅之——根据官方LCU API制作游戏助手
Annotation and reflection
Leetcode215 the kth largest element (derivation of quick sort partition function)
Rotation of 2D conversion, transform origin of 2D conversion center point and scale of 2D conversion
我的创作纪念日-从心出发
Use of URL download resources
URL的使用下载资源
Digital collections accelerate the breaking of the circle and help the industry find new opportunities
Circular queue (implemented in C language)