current position:Home>Kubernetes practical technique: setting kernel parameters for pod
Kubernetes practical technique: setting kernel parameters for pod
2022-06-24 12:33:21【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
copyright notice
author[imroc],Please bring the original link to reprint, thank you.
https://en.chowdera.com/2022/175/20210531214549556g.html
The sidebar is recommended
- Examples of AES and RSA encryption operations implemented by php7.1
- Discussion on redis communication protocol
- Difference between X12 830 and 862 messages
- Can Tencent's tendis take the place of redis?
- As one of the bat, what open source projects does Tencent have?
- Programmer: after 5 years in a company with comfortable environment, do you want to continue to cook frogs in warm water or change jobs?
- Install MySQL in docker and modify my CNF profile
- 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.
- Concentrate on research preparation, Tencent cloud, see you next year!
- Cryptography series: collision defense and collision attack
guess what you like
How to make Baidu quickly include its own personal website?
The operation and maintenance boss laughed at me. Don't you know that?
Practice of dynamic load balancing based on open source tars
Use the object selection tool to quickly create a selection in Adobe Photoshop
The world's largest meat processor has been "blackmailed", how many industries will blackmail virus poison?
Istio FAQ: istio init crash
Clickhouse uses distributed join of pose series
[day ui] alert component learning
Do you really know "open source"? Please check [nanny level] open source Encyclopedia
Continuous testing | making testing more free: practicing automated execution of use cases in coding
Random recommended
- Pipeline shared library
- [2021 techo youth dry goods sorting post, there is always one you are interested in]
- pipeline groovy
- Pipeline post instruction
- Jenkins pipeline syntax
- How does the video networking / network penetration tool easynts permanently delete one of the devices?
- National standard platform easygbs administrator assigns roles to sub users and troubleshooting of invalid channels
- What is the reason why the video intelligent analysis platform easycvr is locally controllable but the superior equipment cannot control the subordinate equipment?
- RTMP streaming platform easydss video on demand interface search bar development label fuzzy query process introduction
- Conceptual analysis of DDD Domain Driven Design
- Process of solving easydss virtual live video jam and instability problems by replacing push-pull stream Library
- How to configure the national standard platform easygbs neutral version?
- How to evaluate software development projects reasonably?
- Smart photovoltaic energy - visualization of photovoltaic power generation energy management and control in the park
- A "full cloud" journey of a quasi financial system
- Automatic reconstruction of pod after modifying resource object
- Tencent security monthly report - zero trust development trend forum, digital Expo Technology Award, Mercedes Benz security research results
- Kubernetes log viewer - kubetail
- [5 minutes to play lighthouse] create an immersive markdown writing environment
- Tencent Youtu, together with Tencent security Tianyu and wechat, jointly launched an infringement protection scheme
- Hardware enterprise website ranking, 8 commonly used processes
- Fbnet/fbnetv2/fbnetv3: Facebook's lightweight network exploration in NAS | lightweight network
- A flaw in R markdown: folders cannot have Chinese
- Getting started with scrapy
- Detailed explanation of the execution order of the expression and loop body in the for loop
- Remote terminal RTU slope monitoring and early warning
- Jupyter notebook service installation and startup
- About Adobe Photoshop adjusting selection
- Kubernetes practical skills: use cert manager to issue free certificates for DNSPod domain names
- In depth analysis, from ordinary clock system to various time service modes
- What are the software prototyping tools?
- [tke] GPU node NVIDIA Tesla driver reinstallation
- A good habit that makes your programming ability soar
- Google hacking search engine attack and Prevention
- Data stack technology sharing: open source · data stack - extend flinksql to realize the join of flow and dimension tables
- Pinduoduo press the user accelerator key
- Installing sqlserver extension PDO of PHP under Linux_ sqlsrv
- Go basic series | 1 Leading
- Node cache vs browser cache
- Istio practical skills: implement header based authorization