当前位置:网站首页>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
边栏推荐
- Opencv learning notes - loading and saving images
- 嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
- Google hacking search engine attack and Prevention
- 2022年有什么低门槛的理财产品?钱不多
- How to check the situation that the national standard platform easygbs equipment video cannot be accessed by grabbing packets?
- Group planning - General Review
- 12+!不同癌症中TMB与ICI反应之间的免疫相关因素研究
- 链接器 --- Linker
- Practice of dynamic load balancing based on open source tars
- What is the reason why the video intelligent analysis platform easycvr is locally controllable but the superior equipment cannot control the subordinate equipment?
猜你喜欢
"Meng Hua Lu" is about to have a grand finale. It's better to learn it first than to look ahead!
GTest从入门到入门
Insurance app aging service evaluation analysis 2022 issue 06
How to write controller layer code gracefully?
GTEST from getting started to getting started
Group planning - General Review
Opencv learning notes - Discrete Fourier transform
电商红包雨是如何实现的?拿去面试用(典型高并发)
[go language questions] go from 0 to entry 4: advanced usage of slice, elementary review and introduction to map
Installation and operation of libuv
随机推荐
Opencv learning notes - cv:: mat class
单基因泛癌+简单实验就能发表7分+
Is it safe to open an account for how many new bonds you can apply for
打新债的条件 开户是安全的吗
5 points + single gene pan cancer pure Shengxin idea!
Opencv learning notes - regions of interest (ROI) and image blending
Identification of new prognostic DNA methylation features in uveal melanoma by 11+ based on methylation group and transcriptome analysis~
Reading at night -- about microservices and containers
Use the object selection tool to quickly create a selection in Adobe Photoshop
Easynvr user login is modified to share the modification process of ip+ user name restriction
Hardware enterprise website ranking, 8 commonly used processes
GLOG从入门到入门
The opportunity to teach cloud development a lesson has finally come!
不用做实验的6分+基因家族纯生信思路~
A "full cloud" journey of a quasi financial system
链接器 --- Linker
Flink snapshot analysis: operators for locating large states and data skew
11+文章-机器学习打造ProTICS框架-深度揭示了不同分子亚型中肿瘤浸润免疫细胞对预后的影响
嵌入式必学!硬件资源接口详解——基于ARM AM335X开发板 (下)
11+! 结肠癌中基于 m6A 调节因子的甲基化修饰模式以不同的肿瘤微环境免疫谱为特征