当前位置:网站首页>Kubernetes practical technique: setting kernel parameters for pod
Kubernetes practical technique: setting kernel parameters for pod
2022-06-24 12:33:00 【imroc】
This article excerpts from kubernetes Learning notes
summary
This article is introduced as Pod Several ways to set kernel parameters .
stay securityContext It is specified in sysctls
since k8s 1.12 rise ,sysctls characteristic beta And it turns on by default , Allow users to pod Of securityContext Setting kernel parameters in , Usage examples :
apiVersion: v1
kind: Pod
metadata:
name: sysctl-example
spec:
securityContext:
sysctls:
- name: net.core.somaxconn
value: "1024"
- name: net.core.somaxconn
value: "1024"
... But using this method , By default, some people think it is unsafe The parameter of cannot be changed , It needs to be configured to kubelet Of --allowed-unsafe-sysctls Medium .
Use initContainers
If you want to make setting kernel parameters easier and more general , Can be in initContainer Set in , But this request is for initContainer open privileged jurisdiction . Example :
apiVersion: v1
kind: Pod
metadata:
name: sysctl-example-init
spec:
initContainers:
- image: busybox
command:
- sh
- -c
- |
sysctl -w net.core.somaxconn=65535
sysctl -w net.ipv4.ip_local_port_range="1024 65535"
sysctl -w net.ipv4.tcp_tw_reuse=1
sysctl -w fs.file-max=1048576
imagePullPolicy: Always
name: setsysctl
securityContext:
privileged: true
containers:
...Use tuning CNI Unified plug-in settings sysctl
If you want for all Pod Uniformly configure some kernel parameters , have access to tuning This CNI Plug in to do :
{
"name": "mytuning",
"type": "tuning",
"sysctl": {
"net.core.somaxconn": "500",
"net.ipv4.tcp_tw_reuse": "1"
}
}Reference material
边栏推荐
- Can Tencent's tendis take the place of redis?
- GTest从入门到入门
- The operation and maintenance boss laughed at me. Don't you know that?
- 哪个商业保险养老险好?2022年商业养老保险产品排名
- Tencent Youtu, together with Tencent security Tianyu and wechat, jointly launched an infringement protection scheme
- 可变参数模板实现max(接受多个参数,两种实现方式)
- How to write controller layer code gracefully?
- Speculation London gold short-term stable money making skills? Where is it safe to fry London gold?
- Conceptual analysis of DDD Domain Driven Design
- GLOG从入门到入门
猜你喜欢

Insurance app aging service evaluation analysis 2022 issue 06

万名校园开发者花式玩AI,亮点看这张图就够啦!

Linker --- linker
![[digital ic/fpga] booth multiplier](/img/42/3da3b1d3cc82cb9c0694241148011b.png)
[digital ic/fpga] booth multiplier

Install Kali on the U disk and persist it

文本转语音功能上线,可以体验专业播音员的服务,诚邀试用

FreeRTOS overview and experience
Deep parsing and implementation of redis pub/sub publish subscribe mode message queue
[mysql_16] variables, process control and cursors
[Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!
随机推荐
怎样购买打新债 开户是安全的吗
Can Tencent's tendis take the place of redis?
[live review] battle code pioneer phase 7: how third-party application developers contribute to open source
2022年有什么低门槛的理财产品?钱不多
Kubernetes best practice: graceful termination
mRNA疫苗的研制怎么做?27+ 胰腺癌抗原和免疫亚型的解析来告诉你答案!
Cryptography series: collision defense and collision attack
12+!不同癌症中TMB与ICI反应之间的免疫相关因素研究
[mysql_16] variables, process control and cursors
Use go to process millions of requests per minute
Coinbase will launch the first encrypted derivative product for retail traders
Is it safe to open an account for how many new bonds you can apply for
Opencv learning notes - regions of interest (ROI) and image blending
我在深圳,到哪里开户比较好?现在网上开户安全么?
National standard platform easygbs administrator assigns roles to sub users and troubleshooting of invalid channels
How to open a new bond? Is it safe to open an account
How is the e-commerce red envelope realized? For interview (typical high concurrency)
2021-06-02: given the head node of a search binary tree, it will be transformed into an ordered two-way linked list with head and tail connected.
Tencent Youtu, together with Tencent security Tianyu and wechat, jointly launched an infringement protection scheme
怎样打新债具体操作 开户是安全的吗