当前位置:网站首页>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不够用了
使用如下命令删除资源
边栏推荐
猜你喜欢

How to quickly design a set of cross end components that support rendering rich text content

Multi task text classification model based on tag embedded attention mechanism

基于双层主题模型的技术演化分析框架及其应用

OpenCV中图像算术操作与逻辑操作

PHP uses sqlserver

【深度学习】全连接网络

Mysql-03 database operation

1-to-1 live broadcast source code - 1-to-1 voice chat source code

基于专利多属性融合的技术主题划分方法研究

Large and small end mode
随机推荐
Construction practice of pipeline engine of engineering efficiency ci/cd
手持振弦采集仪VH03各种接口使用说明
2022-07-26 Daily: the first anniversary of the establishment of alphafold DB database, research on the lighting point of official promotion
什么是Restful风格以及它的四种具体实现形式
How to quickly design a set of cross end components that support rendering rich text content
The difference between V-model and.Sync modifier
DP sword finger offer II 100. sum of minimum paths in triangle
Some lightweight network models in detection and segmentation (share your own learning notes)
[deep learning] fully connected network
【论文阅读】GRAW+:A Two-View Graph Propagation Method With Word Coupling for Readability Assessment
Meeting seating and submission for approval of OA project
基于双层主题模型的技术演化分析框架及其应用
Leetcode148 sort linked list (merge method applied to merge)
Technology sharing | gtid that needs to be configured carefully_ mode
"Baget" takes you one minute to build your own private nuget server
当AI邂逅生命健康,华为云为他们搭建三座桥
请问下大家,flink sql有没有办法不输出update_before?
多线程——线程池
[ostep] 03 virtualized CPU - restricted direct execution mechanism
UDP multithreaded online chat