KEP-6063: Update minimum per-pod PID limit from 1024 to 128 - #6217
Conversation
|
Hi @BhargaviGudi. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
2b7755c to
a77bda9
Compare
Any exec probes or exec pre-stop hooks? exec into container takes like surprisingly a lot of PIDs. |
Tested with exec probes and PreStop hooks - added details to description. |
17 is not divisible by 7. Was it perhaps 3 PIDs per probe as an absolute worst case than? If so, /lgtm |
The 17 is the measured overhead (47 peak - 30 baseline), not a per-container calculation.
Analysis:
|
|
yep, we are on the same page. |
|
/ok-to-test |
|
@BhargaviGudi: Cannot trigger testing until a trusted user reviews the PR and leaves an DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
|
/ok-to-test |
|
@haircommander @kannon92 @mrunalp Could you please help me to review this PR? Thanks |
|
/lgtm |
|
@mrunalp Could you please help to review this PR? Thanks |
|
The implementation PR (kubernetes/kubernetes#139277) has already been updated to use 128 as the minimum PID limit — all constants, validation, comments, and test cases reflect this change. |
harche
left a comment
There was a problem hiding this comment.
Verified against the implementation: the new bounds match both enforcement points, API validation (https://github.com/kubernetes/kubernetes/blob/f050421a6693073df402fde0cc9f3568087c2d1e/pkg/apis/core/validation/validation.go#L8279-L8280) and kubelet admission (https://github.com/kubernetes/kubernetes/blob/f050421a6693073df402fde0cc9f3568087c2d1e/pkg/kubelet/lifecycle/features_linux.go#L50-L51), and all five occurrences of 1024 in the doc are covered.
One sequencing note: this overlaps with #6258, both PRs delete the same Valid Values intro line and several lines touched here get the pid to pids rename there. Whichever merges second needs a rebase, and if this one goes second its reapplied lines should pick up the pids spelling.
a77bda9 to
c05d76b
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: BhargaviGudi, mrunalp The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
c05d76b to
72f675e
Compare
|
/lgtm |
Summary
Lowers the minimum allowed value for
spec.resources.limits.pidfrom 1024 to 128, based onempirical PID usage measurements on an OpenShift cluster.
KEP: #6064
Discussion regrading minimum PID limit: #6064 (comment)
Justification
Created a multi-container pod (
multi-container-pid-testin namespacepid-measure-test) with 7 containers: 3× busybox, nginx, alpine, redis, and curl. The pod was configured with exec liveness/readiness probes on all containers and PreStop hooks that spawn background processes. All seven containers ran successfully.Total PIDs used by the pod were measured from the pod cgroup on the worker node:
PID Usage Testing Results
Tested multi-container pods with exec probes and PreStop hooks on OpenShift cluster.
Test Configuration
Results (cgroup measurements)
Exec Probe/Hook Overhead
Pod-level cgroup (authoritative):
A minimum of 128 provides adequate headroom: ~2.7× over the observed maximum (47 PIDs peak) for a complex multi-container pod with exec probes and PreStop hooks, and ~5× for baseline multi-container workloads (25-30 PIDs). This is sufficient for any standard workload while still allowing meaningful restriction of PID-intensive or untrusted processes.