Skip to content
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

Closed

Conversation

derekwaynecarr
Copy link
Member

Pid limiting documentation for 1.14.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 6, 2019
@k8sio-netlify-preview-bot
Copy link
Collaborator

Deploy preview for kubernetes-io-vnext-staging processing.

Building with commit 7f3d0ef

https://app.netlify.com/sites/kubernetes-io-vnext-staging/deploys/5c7ff0111aab9b00083d1145

@k8s-ci-robot k8s-ci-robot added language/en Issues or PRs related to English language size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Mar 6, 2019
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
To fully approve this pull request, please assign additional approvers.
We suggest the following additional approver: cody-clark

If they are not already assigned, you can assign the PR to them by writing /assign @cody-clark in a comment when ready.

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@derekwaynecarr
Copy link
Member Author

/milestone 1.14

/cc @dashpole @RobertKrawitz

@k8s-ci-robot
Copy link
Contributor

@derekwaynecarr: GitHub didn't allow me to request PR reviews from the following users: robertkrawitz.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/milestone 1.14

/cc @dashpole @RobertKrawitz

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/test-infra repository.

{{% capture overview %}}
{{< feature-state state="beta" >}}

This page explains how to configure pid limiting with the `kubelet`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"pid (process ID)" the first time. Hopefully nobody's confused, but...

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`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resource name is pid, not pids kubernetes/kubernetes#73651 (comment)

Copy link
Contributor

Choose a reason for hiding this comment

The 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 ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, this is the documentation for #12932

@@ -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
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/pids/pid/


This page explains how to configure pid limiting with the `kubelet`.

Pids are a fundamental resource on Linux hosts. It is trivial to hit the task
Copy link
Contributor

Choose a reason for hiding this comment

The 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 kernel.pid_max via sysctl, modern kernels support 222-1 process IDs.

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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:

  • they can have kubelet & their container runtime limit how many pids are available to a pod
  • they can raise the system-wide pid ceiling from the default, which is typically quite low

and that making both changes together can work well.
(A high pid ceiling, system wide, helps avoid collisions when IDs are reused, and a low limit per pod protects the other pods and the rest of the system).

Copy link
Contributor

Choose a reason for hiding this comment

The 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.

@dashpole
Copy link
Contributor

dashpole commented Mar 6, 2019

looks good to me after you address @RobertKrawitz comments

- derekwaynecarr
- dashpole
- RobertKrawitz
title: Pid Limiting
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: Pid Limiting
title: Limit processes available to a pod

Copy link
Contributor

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).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If enabled, the kubelet argument for pod-max-pids will write out the configured

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?

  • one page about making sure a pod doesn't use too many process IDs
  • another page that describes how to ensure that there are process IDs free for kubelet / the rest of the OS?

Copy link
Contributor

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

@jimangel jimangel force-pushed the dev-1.14 branch 2 times, most recently from 2534806 to ead0a28 Compare March 14, 2019 03:47
@jimangel jimangel added this to the 1.14 milestone Mar 25, 2019
@mdlinville
Copy link
Contributor

1.14 was released today and is now master so please rebase this PR against master and address any pending feedback ASAP.

@jimangel jimangel modified the milestones: 1.14, 1.15 Mar 27, 2019
@jimangel
Copy link
Member

Cleaning things up post 1.14 release. Closing this PR on dev-1.14 due to no action - feel free to reopen against master! Thanks!

@jimangel jimangel closed this Mar 28, 2019
@derekwaynecarr derekwaynecarr mentioned this pull request Apr 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. language/en Issues or PRs related to English language size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants