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

Add more verbose logging to IsEvictable checks #300

Merged
merged 1 commit into from
May 29, 2020

Conversation

damemi
Copy link
Contributor

@damemi damemi commented May 27, 2020

This makes the IsEvictable check more verbose at logLevel=4, but breaking each check into its own conditional and logging errors for each one, finally outputting the full list if the pod does not also have the "evictable" annotation.

This gives output like this:

I0529 16:14:06.044444       1 pods.go:60] Pod dedicated-nodes-vkr8s in namespace test-ns is not evictable: Pod lacks an eviction annotation and fails the following checks: [pod is critical, pod does not have any ownerrefs]

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels May 27, 2020
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: damemi

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label May 27, 2020
@damemi
Copy link
Contributor Author

damemi commented May 27, 2020

/hold
I haven't personally tested this yet to see what the error output looks like. If someone else gets to it before I do and it looks fine anyone can feel free to remove the hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 27, 2020
@seanmalloy
Copy link
Member

/kind cleanup

@k8s-ci-robot k8s-ci-robot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 29, 2020
@seanmalloy
Copy link
Member

@damemi I think it would be good to note in the Pod Evictions section of the README that using log level 4 will log the reason descheduler is not evicting a pod. I believe this would reduce the number of questions end users have about why pods are not being evicted.

@damemi
Copy link
Contributor Author

damemi commented May 29, 2020

@seanmalloy good idea, updated

@seanmalloy
Copy link
Member

/lgtm

The hold can be removed once someone has verified what the log output actually looks like.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 29, 2020
@damemi
Copy link
Contributor Author

damemi commented May 29, 2020

Finally got to test this and the output looks good to me:

I0529 16:14:06.044444       1 pods.go:60] Pod dedicated-nodes-vkr8s in namespace test-ns is not evictable: Pod lacks an eviction annotation and fails the following checks: [pod is critical, pod does not have any ownerrefs]

Note that this does log for a lot of pods (every pod that's not evictable) so to really debug it you need to grep the logs, but I think that's reasonable for v=4

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 29, 2020
@ingvagabund
Copy link
Contributor

/retest

@ingvagabund
Copy link
Contributor

/test pull-descheduler-verify

@k8s-ci-robot k8s-ci-robot merged commit bd412bf into kubernetes-sigs:master May 29, 2020
@damemi damemi deleted the refactor-is-evictable branch May 29, 2020 17:23
briend pushed a commit to briend/descheduler that referenced this pull request Feb 11, 2022
Add more verbose logging to IsEvictable checks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants