-
Notifications
You must be signed in to change notification settings - Fork 14.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pid limiting documentation #13006
pid limiting documentation #13006
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--- | ||
reviewers: | ||
- derekwaynecarr | ||
- dashpole | ||
- RobertKrawitz | ||
title: Pid Limiting | ||
content_template: templates/concept | ||
--- | ||
|
||
{{% capture overview %}} | ||
{{< feature-state state="beta" >}} | ||
|
||
This page explains how to configure pid limiting with the `kubelet`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "pid (process ID)" the first time. Hopefully nobody's confused, but... |
||
|
||
Pids are a fundamental resource on Linux hosts. It is trivial to hit the task | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we suggest ways to make more process IDs available? Eg, on Linux set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simply raising the process limit isn't necessarily the right answer either -- it probably means more time spent doing accounting, scanning the process table, etc. Not to mention the resources that are consumed by that many processes. Before we go into that, I think we want to decide what level of discussion we want here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The aim I'd have here is to let a less experienced administrator realize that:
and that making both changes together can work well. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The system-wide pid-max is typically 32K (bigger on machines with more than 32 CPU threads available). Whether that's too small on any given system depends, but I'm not convinced it would be a good idea for an inexperienced admin to simply raise the process limit without an understanding of the workload being run and analyzing the entire system's capacity. The per-pod limit only protects the system to the extent that the number of pods is limited. The node limit has nothing to do with collisions; it's simply a hard upper limit on the number of simultaneous tasks in existence on a node. |
||
limit without hitting any other resource limits and cause instability to a host | ||
machine. | ||
|
||
Administrators require mechanisms to ensure that user pods cannot induce pid | ||
exhaustion that prevents host daemons (runtime, kubelet, etc) from running. In | ||
addition, it is important to ensure that pids are limited among pods in order to | ||
ensure they have limited impact to other workloads on the node. | ||
|
||
{{% /capture %}} | ||
|
||
{{% capture body %}} | ||
|
||
## Pod to Pod Isolation of Pids | ||
|
||
The `SupportPodPidsLimit` feature gate is *beta*. | ||
|
||
If enabled, the `kubelet` argument for `pod-max-pids` will write out the configured | ||
pid limit to the pod level cgroup to the value specified on Linux hosts. If -1, | ||
the `kubelet` will default to the node allocatable pid capacity. | ||
|
||
## Node to Pod Isolation of Pids | ||
|
||
The `SupportNodePidsLimit` feature gate is *alpha*. | ||
|
||
If enabled, the node allocatable feature is able to reserve a number of pids for | ||
system components. The `pids` resource is supported when specifying `system-reserved` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Resource name is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @RobertKrawitz i suspect this feature is related to #12932 correct ? if so @derekwaynecarr would you mind cross linking the page here please ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is the documentation for #12932 |
||
and `kube-reserved` flags for the `kubelet`. | ||
|
||
{{% /capture %}} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -250,4 +250,7 @@ for `kube-reserved` and `system-reserved`. | |
As of Kubernetes version 1.8, the `storage` key name was changed to `ephemeral-storage` | ||
for the alpha release. | ||
|
||
As of Kubernetes version 1.14, the `kubelet` supports specifying `pids` as a resource | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. s/pids/pid/ |
||
for `kube-reserved` and `system-reserved`. | ||
|
||
{{% /capture %}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what this is; the functionality of limiting processes available to a pod is pod-max-pids. This is about limiting the number of pids available to all pods collectively (specifically, reserving a certain number of pids for system and/or kubelet use).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does look like limiting the processes available to a pod.
@derekwaynecarr - how would you feel about having two smaller pages, specific to the tasks they're explaining, and then hyperlinking between the two?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@RobertKrawitz reading the info as it is now i got into the same thinking like @sftim .
However your explanation in the comment does makes so would you or @derekwaynecarr mind adding that info in ?
I personally would like to see more detailed info rather than high level as not everyone knows the difference as you mentioned