1.kubelet参数解析:https://blog.csdn.net/qq_34857250/article/details/84995381node
2.如何在github中查找k8s代码关键字?linux
如今我想查找k8s源码中,关于kubelet参数pod-eviction-timeout的默认值是多少git
https://github.com/kubernetes/kubernetesgithub
先进入github对应的repository中,再Search关键字数据库
3.计算节点频繁发生OOM,linux中发生oom时,oom_killer如何决定首先杀掉哪一个进程:https://www.vpsee.com/2013/10/how-to-configure-the-linux-oom-killer/设计模式
为了防止它杀死关键的应用程序,例如数据库实例,能够手动调整分数。这能够经过/proc/[pid]/oom_score_adj(对于2.6.29以前的内核,使用/proc/[pid]/oom_adj)实现。oom_score_adj接受的值范围是-1000到1000,(oom_adj接受的值范围是-17到15)ide
在k8s的qos(quality of service)中,三个qos级别正是对应三个oom_score-adj值,经过调整该值来控制evict驱逐策略和system oom_killer的优先级。.net
guaranteed级别的pod的oom-score-adj= -998,而计算节点kubelet服务的oom-score-adi= -999设计
k8s doc: https://kubernetes.io/docs/tasks/administer-cluster/out-of-resource/3d
If the node experiences a system OOM (out of memory) event prior to the kubelet
being able to reclaim memory, the node depends on the oom_killer to respond.
The kubelet
sets a oom_score_adj
value for each container based on the quality of service for the Pod.
Quality of Service | oom_score_adj |
---|---|
Guaranteed |
-998 |
BestEffort |
1000 |
Burstable |
min(max(2, 1000 - (1000 * memoryRequestBytes) / machineMemoryCapacityBytes), 999),该值在2~999 |
4.容器设计模式:Sidecar
什么是 Sidecar?在 Pod 里面,能够定义一些专门的容器,来执行主业务容器所须要的一些辅助工做,好比Init Container,它就是一个 Sidecar,它能够将文件拷贝到共享目录里面,以便被同pod中的业务容器用起来。
优点就是在于其实将辅助功能从个人业务容器解耦了,因此我就可以独立发布 Sidecar 容器,而且更重要的是这个能力是能够重用的,即一样的一个监控 Sidecar 或者日志 Sidecar,能够被全公司的人共用的。这就是设计模式的一个威力。