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

out of resource killing (memory) #21274

Merged
merged 1 commit into from
May 17, 2016

Conversation

derekwaynecarr
Copy link
Member

@derekwaynecarr derekwaynecarr commented Feb 15, 2016

Adds the core framework for low-resource killing in the kubelet.

Implements support for out of memory killing.

Related:
#18724


This change is Reviewable

@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 15, 2016
@derekwaynecarr derekwaynecarr force-pushed the kubelet_eviction branch 3 times, most recently from b80c763 to 8bb4fed Compare February 15, 2016 22:33
@k8s-github-robot k8s-github-robot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Feb 20, 2016
return
}
glog.Infof("stability manager: kill pod %s", pod.Name)
err = podLifecycleManager.KillPod(pod)
Copy link
Member Author

Choose a reason for hiding this comment

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

recording a note here so when i get time to get back to this PR, but I will look to use kubelet.HandlePodDeletions

@k8s-github-robot k8s-github-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 4, 2016
}

// PodUsageInfo returns usage information for each container in a pod.
func (r *resourceAccountantImpl) PodUsageInfo(pod *api.Pod) (api.ResourceList, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

@k8s-github-robot k8s-github-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Apr 13, 2016
@derekwaynecarr derekwaynecarr force-pushed the kubelet_eviction branch 2 times, most recently from c03d24e to 9715e29 Compare April 18, 2016 21:42
@derekwaynecarr derekwaynecarr force-pushed the kubelet_eviction branch 2 times, most recently from 173ad77 to f482830 Compare April 25, 2016 17:00
@k8s-github-robot k8s-github-robot added kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/old-docs size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 25, 2016

// disk is best effort, so we don't measure relative to a request.
// TODO: add disk as a guaranteed resource
p1Disk := p1Usage[api.ResourceStorage]
Copy link
Contributor

@vishh vishh May 13, 2016

Choose a reason for hiding this comment

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

Resource storage is pretty generic and weirdly it only applies to volumes as per API comments. Should local-disk be a first class resource? For the purposes of this PR, this can be a kubelet internal type too..

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, I was unsure what resource to really use. Fine with that.

Copy link
Member Author

Choose a reason for hiding this comment

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

added internal type "disk".

@vishh
Copy link
Contributor

vishh commented May 13, 2016

I added a few comments. Overall this PR LGTM. @derekwaynecarr Thanks for coming up with super readable code :)

@derekwaynecarr
Copy link
Member Author

@vishh - updated code per your comments.

/cc @kubernetes/rh-cluster-infra @kubernetes/sig-node - if anyone wants to take a pass at memory eviction.

@derekwaynecarr derekwaynecarr added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels May 16, 2016
@vishh
Copy link
Contributor

vishh commented May 17, 2016

@derekwaynecarr I hope at-least one of the memory eviction PRs (ideally the PR that adds flags) has a release-note flag.

@vishh vishh added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 17, 2016
@vishh
Copy link
Contributor

vishh commented May 17, 2016

@derekwaynecarr Next step is to add a node e2e to test all this logic. The test might need some changes to the framework - setting eviction flags.

@derekwaynecarr
Copy link
Member Author

I have a follow on PR to enable the max pod eviction period and will have a release note for that PR that covers the feature.

@derekwaynecarr
Copy link
Member Author

@k8s-bot test this issue #25652

@k8s-bot
Copy link

k8s-bot commented May 17, 2016

GCE e2e build/test passed for commit edc76f6.

@k8s-github-robot
Copy link

@k8s-bot test this [submit-queue is verifying that this PR is safe to merge]

@k8s-bot
Copy link

k8s-bot commented May 17, 2016

GCE e2e build/test passed for commit edc76f6.

@k8s-github-robot
Copy link

Automatic merge from submit-queue

@k8s-github-robot k8s-github-robot merged commit 7b4851b into kubernetes:master May 17, 2016
type signalObservations map[Signal]resource.Quantity

// thresholdsObservedAt maps a threshold to a time that it was observed
type thresholdsObservedAt map[Threshold]time.Time
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this is broken, because you're assuming that resource.Quantity contributes to the uniqueness of the the threshold. It does not, because it's a pointer to an inf.Dec, which is only compared on pointer equality, not actual equality.

If you are depending on uniqueness of Quantity to signal value, you'll need to change your map keys.

Copy link
Contributor

Choose a reason for hiding this comment

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

Basically, map[Threshold1{Quantity: NewQuantity("1m")}] is not guaranteed to return the same value if you call it twice.

k8s-github-robot pushed a commit that referenced this pull request May 22, 2016
…to-scheduler

Automatic merge from submit-queue

Introduce node memory pressure condition to scheduler

Following the work done by @derekwaynecarr at #21274, introducing memory pressure predicate for scheduler.

Missing:

* write down unit-test
* test the implementation

At the moment this is a heads up for further discussion how the new node's memory pressure condition should be handled in the generic scheduler.

**Additional info**

* Based on [1], only best effort pods are subject to filtering.
* Based on [2], best effort pods are those pods "iff requests & limits are not specified for any resource across all containers".

[1] https://github.com/derekwaynecarr/kubernetes/blob/542668cc7998fe0acb315a43731e1f45ecdcc85b/docs/proposals/kubelet-eviction.md#scheduler
[2] #14943
michelleN pushed a commit to michelleN/community that referenced this pull request Nov 19, 2016
…to-scheduler

Automatic merge from submit-queue

Introduce node memory pressure condition to scheduler

Following the work done by @derekwaynecarr at kubernetes/kubernetes#21274, introducing memory pressure predicate for scheduler.

Missing:

* write down unit-test
* test the implementation

At the moment this is a heads up for further discussion how the new node's memory pressure condition should be handled in the generic scheduler.

**Additional info**

* Based on [1], only best effort pods are subject to filtering.
* Based on [2], best effort pods are those pods "iff requests & limits are not specified for any resource across all containers".

[1] https://github.com/derekwaynecarr/kubernetes/blob/542668cc7998fe0acb315a43731e1f45ecdcc85b/docs/proposals/kubelet-eviction.md#scheduler
[2] kubernetes/kubernetes#14943
openshift-publish-robot pushed a commit to openshift/kubernetes that referenced this pull request Nov 5, 2018
UPSTREAM: 69890: Run static pods before bootstrap

Origin-commit: db65ebbf04b82a420e88b7f870a3ec667dd69998
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants