当前位置:网站首页>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不够用了
使用如下命令删除资源
边栏推荐
- Prediction and value evaluation of technology fusion relationship based on multiple features
- 2022-07-26 Daily: the first anniversary of the establishment of alphafold DB database, research on the lighting point of official promotion
- Research on prediction of user churn in online health community based on user portrait
- [mathematical modeling] summary of common basic models
- 『SignalR』. Net using signalr for real-time communication
- Latest battle report: Ten certifications and five best practices
- Flink SQL(三) 连接到外部系统System和JDBC
- [ostep] 03 virtualized CPU - restricted direct execution mechanism
- Detailed explanation of alter field of MySQL Foundation
- 多线程——线程池
猜你喜欢

redis学习笔记

Use cpolar to build a commercial website (apply for website security certificate)

基于多特征的技术融合关系预测及其价值评估

Technology evolution analysis framework based on two-level topic model and its application

多态案例-制作饮品

使用cpolar建立一个商业网站(申请网站安全证书)

@千行百业,一起乘云而上!

Comparison between agile development and Devops

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

IDEA(warning)No artifacts configured
随机推荐
Leetcode215 the kth largest element (derivation of quick sort partition function)
OA项目之会议排座和送审
1对1直播源码——1对1语音聊天源码
Install dexdump on win10 and remove the shell
Redis data operation
C语言_结构体和数组的结合
Learning basic knowledge of Android security
基于SPO语义三元组的疾病知识发现
Difference between base addressing and index addressing
IDEA(warning)No artifacts configured
[ostep] 03 virtualized CPU - restricted direct execution mechanism
12437 words, take you to explore the principle of RPC communication
『SignalR』. Net using signalr for real-time communication
[NOIP2003 普及组]栈
C语言_结构体指针来访问结构体数组
融合多自然语言处理任务的中医辅助诊疗方案研究——以糖尿病为例
关于存储芯片的入门基础知识
OpenCV中图像算术操作与逻辑操作
[deep learning] fully connected network
Basic syntax of MySQL DDL and DML and DQL