当前位置:网站首页>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
边栏推荐
- 怎样申购打新债 开户是安全的吗
- 11+! 结肠癌中基于 m6A 调节因子的甲基化修饰模式以不同的肿瘤微环境免疫谱为特征
- Concentrate on research preparation, Tencent cloud, see you next year!
- [day ui] alert component learning
- Is it safe to apply for new bonds to open an account
- Easynvr user login is modified to share the modification process of ip+ user name restriction
- 广发证券靠谱吗?开证券账户安全吗?
- Identification of new prognostic DNA methylation features in uveal melanoma by 11+ based on methylation group and transcriptome analysis~
- ArrayList # sublist these four holes, you get caught accidentally
- [2021 techo youth dry goods sorting post, there is always one you are interested in]
猜你喜欢

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

Ten thousand campus developers play AI in a fancy way. It's enough to see this picture!

New progress in the construction of meituan's Flink based real-time data warehouse platform
[Old Wei makes machines] issue 090: keyboard? host? Full function keyboard host!

Opencv learning notes - regions of interest (ROI) and image blending

我真傻,招了一堆只会“谷歌”的程序员!
Database migration tool flyway vs liquibase (II)

GTest从入门到入门
![[go language questions] go from 0 to entry 4: advanced usage of slice, elementary review and introduction to map](/img/7a/16b481753d7d57f50dc8787eec8a1a.png)
[go language questions] go from 0 to entry 4: advanced usage of slice, elementary review and introduction to map
Deep parsing and implementation of redis pub/sub publish subscribe mode message queue
随机推荐
How to check the situation that the national standard platform easygbs equipment video cannot be accessed by grabbing packets?
Adjustment method of easynvr video platform equipment channel page display error
Coinbase will launch the first encrypted derivative product for retail traders
Realization of alarm clock with AHK
Tsingsee green rhino video "cloud side end" +ai intelligent security system is integrated into the mainstream development trend
How to configure the national standard platform easygbs neutral version?
Insurance app aging service evaluation analysis 2022 issue 06
Single gene pan cancer + simple experiment can be published 7 points+
Jupyter notebook service installation and startup
不用做实验的6分+基因家族纯生信思路~
11+的基于甲基化组和转录组综合分析识别葡萄膜黑色素瘤中新的预后 DNA 甲基化特征~
Group planning - General Review
Easynvr user login is modified to share the modification process of ip+ user name restriction
Istio FAQ: istio init crash
A "full cloud" journey of a quasi financial system
Getting started with scrapy
Concentrate on research preparation, Tencent cloud, see you next year!
Opencv learning notes - regions of interest (ROI) and image blending
What are the software prototyping tools?
RTMP streaming platform easydss video on demand interface search bar development label fuzzy query process introduction