kubernetes-sigs / descheduler

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

nodeFit doesn't handle preferredDuringSchedulingIgnoredDuringExecution (RemovePodsViolatingNodeAffinity) #1236

Closed antoinedeschenes closed 3 months ago

antoinedeschenes commented 10 months ago

There should be a way for nodeFit filtering to check for preferredDuringSchedulingIgnoredDuringExecution nodeAffinity terms https://github.com/kubernetes-sigs/descheduler/blob/master/pkg/utils/predicates.go#L48

What version of descheduler are you using?

descheduler version: 0.28.0

Does this issue reproduce with the latest release? Yes

Which descheduler CLI options are you using?

      --policy-config-file=/policy-dir/policy.yaml
      --descheduling-interval=1h
      --dry-run=true
      --v=-1
      --vmodule=evictions=1,profile=1

Please provide a copy of your descheduler policy config file

    apiVersion: "descheduler/v1alpha2"
    kind: "DeschedulerPolicy"
    profiles:
    - name: MigrateSpotNodeAffinity
      pluginConfig:
      - args:
          evictLocalStoragePods: true
          nodeFit: true
        name: DefaultEvictor
      - args:
          nodeAffinityType:
          - requiredDuringSchedulingIgnoredDuringExecution
          - preferredDuringSchedulingIgnoredDuringExecution
        name: RemovePodsViolatingNodeAffinity
      plugins:
        deschedule:
          enabled:
          - RemovePodsViolatingNodeAffinity

What k8s version are you using (kubectl version)?

kubectl version Output
$ kubectl version
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.12", GitCommit:"ba490f01df1945d0567348b271c79a2aece7f623", GitTreeState:"clean", BuildDate:"2023-07-19T12:23:43Z", GoVersion:"go1.20.6", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.10-gke.2700", GitCommit:"df2448d7739c44e41ee999b9065ce506cab86344", GitTreeState:"clean", BuildDate:"2023-06-22T09:25:37Z", GoVersion:"go1.19.9 X:boringcrypto", Compiler:"gc", Platform:"linux/amd64"}

What did you do?



**What did you expect to see?**
No pods being evicted as `nodeFit` is enabled

**What did you see instead?**
Pods not matching their `preferredDuringSchedulingIgnoredDuringExecution` nodeAffinity rules are evicted, while no nodes actually fit the `preferred` requirements.
k8s-triage-robot commented 5 months ago

The Kubernetes project currently lacks enough contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot commented 4 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.

This bot triages un-triaged issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot commented 3 months ago

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

You can:

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-ci-robot commented 3 months ago

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to [this](https://github.com/kubernetes-sigs/descheduler/issues/1236#issuecomment-2022293972): >The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. > >This bot triages issues according to the following rules: >- After 90d of inactivity, `lifecycle/stale` is applied >- After 30d of inactivity since `lifecycle/stale` was applied, `lifecycle/rotten` is applied >- After 30d of inactivity since `lifecycle/rotten` was applied, the issue is closed > >You can: >- Reopen this issue with `/reopen` >- Mark this issue as fresh with `/remove-lifecycle rotten` >- Offer to help out with [Issue Triage][1] > >Please send feedback to sig-contributor-experience at [kubernetes/community](https://github.com/kubernetes/community). > >/close not-planned > >[1]: https://www.kubernetes.dev/docs/guide/issue-triage/ 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.