当前位置:网站首页>[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 .
边栏推荐
- Determine whether a sequence is a stack pop-up sequence
- A little experience of next (ITER (dataloader))
- Deep understanding of MySQL lock and transaction isolation level
- 临时关闭MySQL缓存
- ROS查询话题具体内容常用指令
- 判断某个序列是否为栈的弹出序列
- Enter n integers and output the number of occurrences greater than or equal to half the length of the array
- CD-CompactDisk
- Several delete operations in SQL
- 自己创建一个时间拦截器
猜你喜欢

Do you know how to compare two objects

In and exceptions, count (*) query optimization

成功解决之idea引用Lombok的@Slf4j后无法正常使用log

Detailed explanation of MySQL mvcc mechanism

ISO documents

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

Crawl Douban to read top250 and import it into SqList database (or excel table)

必须要掌握的面试重点——索引和事务(附讲B-树与B+树)

Row lock analysis and deadlock

Get and set settings in 26class
随机推荐
成功解决之微服务@Value获取配置文件乱码问题
判断某个序列是否为栈的弹出序列
Boyun, standing at the forefront of China's container industry
in和exsits、count(*)查询优化
Connected to surface test questions
Leetcode interview question 29 clockwise print matrix
Yujun product methodology
Several delete operations in SQL
Insert string B into string A. how many insertion methods can make the new string a palindrome string
VCD-影音光碟
Using recursion to find all gray codes with n bits
基于tensorflow的手写数字识别
In and exceptions, count (*) query optimization
VCD video disc
带你解决哈希冲突,并实现一个简单hash表,
Procedure steps for burning a disc
Padding percentage operation
临时关闭MySQL缓存
wm_ Concat() and group_ Concat() function
Tag dynamic programming - preliminary knowledge for question brushing -2 0-1 knapsack theory foundation and two-dimensional array solution template