kubernetes-sigs / descheduler

Descheduler for Kubernetes
https://sigs.k8s.io/descheduler
Apache License 2.0
4.23k stars 645 forks source link

Allow eviction of DaemonSet pods #1342

Closed tioxy closed 2 months ago

tioxy commented 5 months ago

What type of PR is this?

/kind feature

What this PR does / why we need it:

Enables eviction of DaemonSet pods with the key evictDaemonSetPods: true for evictors

Which issue(s) this PR fixes:

NONE

Special notes for your reviewer:

By default, allowing eviction of pods from daemonsets may be dangerous if misconfigured.

With the release of v1alpha2 profiles, we got the ability to tune granular specs for eviction profiles. This means now that it is possible to select specific daemonset to allow pod eviction automatically. This is interesting because reduces toil of pod recreation for specific scenarios.

Does this PR introduce a user-facing change?

Allow eviction of daemonset pods by `evictDaemonSetPods` key

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:

NONE
k8s-ci-robot commented 5 months ago

Welcome @tioxy!

It looks like this is your first PR to kubernetes-sigs/descheduler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/descheduler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 5 months ago

Hi @tioxy. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes/test-infra](https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:) repository.
knelasevero commented 4 months ago

/ok-to-test

tioxy commented 4 months ago

One thing that I was thinking: should this key really be supported on v1alpha1? I ended up doing it for the sake of consistency between both versions, but I see some problems:

a7i commented 4 months ago

One thing that I was thinking: should this key really be supported on v1alpha1? I ended up doing it for the sake of consistency between both versions, but I see some problems:

As it's currently implemented, setting the value to true does not enable the feature since it's not implemented here in the conversion code.

a7i commented 4 months ago

@tioxy would you please add a unit and/or e2e test for this to verify that it's working as expected? Thank you!

tioxy commented 4 months ago

Thank you for the clarification @a7i, I will be trying to code these tests soon.

tioxy commented 4 months ago

I just added the missing E2E test. To be honest, I got no clue if this test is implemented properly 😅.

I based myself on the testEvictSystemCritical structure and followed it.

ingvagabund commented 3 months ago

@tioxy the PR looks good in overall. Would you please reduce the amount of commits in the PR? So it's easier to follow the changes. E.g. one commit for a new functionality, one for tests, one for documentation. Or, any reasonable distribution of changes.

Note: we are going to remove v1alpha1 type. So, any changes related to v1alpha1 can be safely dropped. Users are strongly recommended to migrate all their v1alpha1 policies to v1alpha2.

tioxy commented 3 months ago

Reorganized the commits 👍

Great review @ingvagabund , thanks

tioxy commented 2 months ago

Hi @a7i @ingvagabund 👋

Do I need to make any extra changes in the PR to be merged?

ingvagabund commented 2 months ago

Apologies for the delay. I will put it on my todo list for tomorrow.

ingvagabund commented 2 months ago

@tioxy this is on me. I did not realize v1alpha1 is already deprecated when I performed the first review by suggesting to provide testing for v1alpha1 -> v1alpha2 conversion. In the last descheduling community meeting we decided to remove v1alpha1 completely in the next release: https://groups.google.com/g/kubernetes-sig-scheduling/c/OyFjkDntuhg/m/GVjD4gpaBAAJ?utm_medium=email&utm_source=footer. Given v1alpha1 is already deprecated there's no point of extending the existing v1alpha1 type. Would you please drop any code related to v1alpha1 from your PR? Apologies for the unnecessary complications.

a7i commented 2 months ago

@ingvagabund your call, but happy to merge this as-is. Given that we're removing the code, this new addition will also be removed.

/approve /hold for Jan's final review

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a7i

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: - ~~[OWNERS](https://github.com/kubernetes-sigs/descheduler/blob/master/OWNERS)~~ [a7i] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
ingvagabund commented 2 months ago

/lgtm /hold cancel