<p>I am looking for a way to limit the number of pids in the Kubernetes pod.</p>

<p>The following issue seems to be closed (already implemented) long time ago.</p>

<p><a href="https://github.com/kubernetes/kubernetes/issues/43783" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/issues/43783</a></p>

<p>But nothing seems to be there in the reference yet..</p>

<p><a href="https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/" rel="nofollow noreferrer">https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.14/</a></p>

<p>The pull request also seems to be merged</p>

<p><a href="https://github.com/kubernetes/kubernetes/commit/bf111161b7aa4a47cc42ee6061b6bd3e45872cc4" rel="nofollow noreferrer">https://github.com/kubernetes/kubernetes/commit/bf111161b7aa4a47cc42ee6061b6bd3e45872cc4</a></p>

<p>I would like to know if we can use this feature now. If so, how and where to set it in the yaml file?</p>

<p>The parameter (PodPidsLimit) is part of the kubelet configuration:
<a href="https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/config#KubeletConfiguration" rel="nofollow noreferrer">https://godoc.org/k8s.io/kubernetes/pkg/kubelet/apis/config#KubeletConfiguration</a></p>

<p>To see current configuration and if the parameter is available in your current version:
<a href="https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generate-the-configuration-file" rel="nofollow noreferrer">https://kubernetes.io/docs/tasks/administer-cluster/reconfigure-kubelet/#generate-the-configuration-file</a></p>

<p>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</p>
