当前位置:网站首页>[kubernetes] kubernetes principle analysis and practical application (under update)
[kubernetes] kubernetes principle analysis and practical application (under update)
2022-06-26 18:25:00 【curd_ boy】
k8s The basic chapter
k8s The Internet
Kubernete How to control the resource level of the business ?

VPA

resource optimization :Kubernete in GC( Garbage collection )


K8S Scheduling priority and preemption mechanism of
Official documents https://kubernetes.io/docs/concepts/scheduling-eviction/pod-priority-preemption/
Under normal circumstances
When one Pod After scheduling failure , It will be temporarily “ Put on hold ” get up , until Pod Be updated , Or the cluster state changes , That's what the scheduler does to this Pod Reschedule
Priority and preemption mechanism , The solution is Pod What to do when scheduling fails
In the scheduling process , There will be various pre selection and optimization algorithms , After so many thresholds , One POD To complete the dispatch , Provide services , In the scheduling process , Suppose a very important system service fails to schedule , It caused a breakdown , To avoid that , We can set a relatively high priority for the app , After a scheduling failure , Some relatively low priority applications that are not so important ” Squeeze away “, This is it. K8S The priority of scheduling and the role of preemption .
Scenarios with special requirements :
When a high priority Pod After scheduling failure , The Pod It's not going to be “ Put on hold ”, But will “ Squeeze away ” Some Node Some of the lower priority ones on Pod. This ensures this high priority Pod Dispatch of succeeded
PriorityClass Parameter limits
apiVersion: scheduling.k8s.io/v1
kind: PriorityClass
metadata:
name: high-priority-nonpreempting
value: 1000000
preemptionPolicy: Never
globalDefault: false
description: "This priority class will not cause other pods to be preempted."
Kubernetes Setting priorities is a 32bit The integer of , The maximum value does not exceed 1000000000(10 Billion ,1 billion), And the higher the value, the higher the priority . And beyond 10 The value of 100 million , It's actually being Kubernetes Keep it and distribute it to the system Pod The use of . The purpose of this , It's the guarantee system Pod It won't be preempted by users .

tips:
K8S After a scheduling failure , Preemption will be based on priority , Preemption is not a simple way to Node Lower priority on pod” Squeeze away “, Preemptive design is relatively interesting .
https://blog.51cto.com/u_2010293/2781899
Kubernete Medium time task
https://kubernetes.io/zh-cn/docs/concepts/workloads/controllers/cron-jobs/
CronJob Spec
.spec.schedule: Dispatch , Required fields , Specify the task run cycle , Same format Cron
.spec.jobTemplate:Job Templates , Required fields , Specify the task to run , Same format Job
.spec.startingDeadlineSeconds : start-up Job Time limit of ( Second level ), This field is optional . If the scheduled time is missed for any reason , So what's missing execution time Job Will be considered a failure . If not specified , There is no deadline
.spec.concurrencyPolicy: Concurrency strategy , This field is also optional . It specifies how to deal with being Cron Job Created Job Concurrent execution of . Only one of the following policies is allowed to be specified :
- Allow( Default ): Allow concurrent runs Job
- Forbid: Prohibit concurrent running , If the previous one hasn't been completed yet , Then skip the next one
- Replace: Cancel the currently running Job, Replace... With a new one
Be careful , The current policy can only be applied to the same Cron Job Created Job. If there are multiple Cron Job, They were created Job Always allow concurrent runs between .
.spec.suspend : Hang up , This field is also optional . If set to true, All subsequent execution will be suspended . It's about what's already being done Job It doesn't work . The default value is false.
.spec.successfulJobsHistoryLimit and .spec.failedJobsHistoryLimit : Historical limitations , Is an optional field . They specify how many completions and failures can be reserved Job.
By default , They are set to 3 and 1. Set the limit to 0, Related types of Job It will not be retained after completion .
边栏推荐
- Publish message publishers and subscribe message subscribers of ROS
- 图像二值化处理
- Deep understanding of MySQL lock and transaction isolation level
- CLion断点单步调试
- 零时科技 | 智能合约安全系列文章之反编译篇
- Detailed explanation of asymmetric cryptosystem
- Request method 'POST' not supported
- Example of using QPushButton style (and method of adding drop-down menu to button SetMenu)
- LeetCode 128最长连续序列
- Get and set settings in 26class
猜你喜欢

Ethereum技术架构介绍

50 lines of code to crawl TOP500 books and import TXT documents

商品秒杀系统

MySQL download and configuration MySQL remote control

In and exceptions, count (*) query optimization

MYSQL的下载与配置 mysql远程操控

Image binarization

CD-CompactDisk

Let torch cuda. is_ Experience of available() changing from false to true

Do you know how to compare two objects
随机推荐
(必须掌握的多线程知识点)认识线程,创建线程,使用Thread的常见方法及属性,以及线程的状态和状态转移的意义
Connected to surface test questions
JVM入個門(1)
零时科技 | 智能合约安全系列文章之反编译篇
VCD-影音光碟
Li Kou daily question - day 28 -566 Reshape matrix
CLion断点单步调试
ROS的发布消息Publishers和订阅消息Subscribers
Detailed explanation of MySQL mvcc mechanism
Clion compiling catkin_ WS (short for ROS workspace package) loads cmakelists Txt problems
Enter n integers and output the number of occurrences greater than or equal to half the length of the array
wm_concat()和group_concat()函数
Union, intersection and difference operations in SQL
LeetCode 128最长连续序列
软考备战多媒体系统
RSA concept explanation and tool recommendation - LMN
Plt How to keep show() not closed
手机影像内卷几时休?
DAPP丨LP单双币流动性质押挖矿系统开发原理分析及源码
你了解如何比较两个对象吗