-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Explain that static Pods never get evicted under node pressure #50569
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
base: main
Are you sure you want to change the base?
Changes from all commits
ce4f9b6
8cf6795
33c392f
1c4eeef
cf457bc
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 |
---|---|---|
|
@@ -354,8 +354,49 @@ will choose to evict pods of lowest Priority first. | |
|
||
If you are running a [static pod](/docs/concepts/workloads/pods/#static-pods) | ||
and want to avoid having it evicted under resource pressure, set the | ||
`priority` field for that Pod directly. Static pods do not support the | ||
`priorityClassName` field. | ||
`priorityClassName` field for that Pod directly. | ||
|
||
{{< note >}} | ||
>The kubelet considers all static pods as critical regardless of their `.spec.priorityClassName`. | ||
>Static pods also pass kubelet admission even if a node does not have enough resources; the kubelet may | ||
>instead evict another Pod (potentially even evicting a different Pod at a higher priority, if there is no better match). | ||
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. Can you give an example of the kubelet evicting a higher-priority, non static Pod? It will help folks decide whether to accept the changes in this PR. |
||
|
||
>You must ensure that you account for resource use when defining static pods on existing nodes. | ||
{{</ note >}} | ||
For example, you might follow the following steps to set the `priorityClassName` for a static pod as `xyz-priority`. | ||
|
||
```shell | ||
kubectl get priorityclass | ||
``` | ||
|
||
The output is similar to this: | ||
|
||
```console | ||
NAME VALUE GLOBAL-DEFAULT AGE | ||
system-cluster-critical 2000000000 false 2m2s | ||
system-node-critical 2000001000 false 2m2s | ||
xyz-priority 1000000 false 47s | ||
``` | ||
|
||
This is a definition for a static Pod. You would define this directly for the kubelet on a particular node (and not via kubectl) | ||
|
||
```yaml | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: static-web | ||
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. This is an interesting usage scenario ... Static pods are created by the 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 kubelet creates mirror Pods and responds to (externally managed) static pod manifests. But yes, I can't see how a static Pod can usefully have a |
||
labels: | ||
role: myrole | ||
spec: | ||
containers: | ||
- name: web | ||
image: nginx | ||
ports: | ||
- name: web | ||
containerPort: 80 | ||
protocol: TCP | ||
priorityClassName: xyz-priority | ||
``` | ||
|
||
When the kubelet evicts pods in response to inode or process ID starvation, it uses | ||
the Pods' relative priority to determine the eviction order, because inodes and PIDs have no | ||
|
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.
Are you sure about this?
My take is that static Pods can be evicted as just other Pods. They will never get admitted unless the kubelet is restarted.
Uh oh!
There was an error while loading. Please reload this page.
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.
Historical conversation and explanation here.
https://github.com/kubernetes/website/pull/47055/files#diff-56de0c49fa24aa21138c65e0b8a9d71ab70f48159fc8184d9fee6e82793418a2R360