如何在Kubernetes Pod中设置pid限制? [英] How to set pid limit in Kubernetes pod?
问题描述
我正在寻找一种限制Kubernetes窗格中的pid数量的方法.
I am looking for a way to limit the number of pids in the Kubernetes pod.
以下问题似乎很久以前已经解决(已经实施).
The following issue seems to be closed (already implemented) long time ago.
https://github.com/kubernetes/kubernetes/issues/43783
但是参考文献中似乎还什么都没有.
But nothing seems to be there in the reference yet..
https://kubernetes.io/docs/reference/生成的/kubernetes-api/v1.14/
拉取请求似乎也已合并
https://github.com/kubernetes/kubernetes/commit/bf111161b7aa4a47cc42d606>
https://github.com/kubernetes/kubernetes/commit/bf111161b7aa4a47cc42ee6061b6bd3e45872cc4
我想知道我们现在是否可以使用此功能.如果是这样,如何在yaml文件中进行设置?
I would like to know if we can use this feature now. If so, how and where to set it in the yaml file?
推荐答案
参数(PodPidsLimit)是kubelet配置的一部分: https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/config#KubeletConfiguration
The parameter (PodPidsLimit) is part of the kubelet configuration: https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/config#KubeletConfiguration
要查看当前配置以及该参数在当前版本中是否可用: https://kubernetes.io/docs /tasks/administer-cluster/reconfigure-kubelet/#generate-the-configuration-file
To see current configuration and if the parameter is available in your current version: https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generate-the-configuration-file
请记住,这意味着您无法在Pod中配置限制,您需要为节点中的所有Pod设置限制
Keep in mind that this means you can't configure the limit in a pod, you need set the limits for all the pods in the node
这篇关于如何在Kubernetes Pod中设置pid限制?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!