kubernetes-sigs / descheduler

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

Something is wrong with Helm Chart v0.29.0... #1383

Closed timetofaceit closed 2 months ago

timetofaceit commented 2 months ago

Hi!

I'm trying to install descheduler using Helm Chart v0.29.0 and set policy profiles in my K8s cluster, but for some reason none of these are working when pods are up... 😢

I see that helm is still installing descheduler with v1alpha1 policy and not accepting v1alpha2. 🤔

Can this be updated / fixed? 🙏

a7i commented 2 months ago

Hi @timetofaceit

Please see duplicate issue here https://github.com/kubernetes-sigs/descheduler/issues/1268

As mentioned, you need to unset default value of strategies in order for profiles to take over

deschedulerPolicy:
  strategies:
a7i commented 2 months ago

/kind support

a7i commented 2 months ago

Going to close Issue, but please feel free to re-open if the mentioned solution does not work for you. Thanks!

/close

k8s-ci-robot commented 2 months ago

@a7i: Closing this issue.

In response to [this](https://github.com/kubernetes-sigs/descheduler/issues/1383#issuecomment-2081182388): >Going to close Issue, but please feel free to re-open if the mentioned solution does not work for you. Thanks! > >/close 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.
timetofaceit commented 2 months ago

Hi! @a7i

Yes, it works when you unset strategies, but the problem is that there is no support for minReplicas variable because I get this error:

I0429 08:30:02.818166 1 tlsconfig.go:240] "Starting DynamicServingCertificateController" E0429 08:30:02.819117 1 server.go:96] "descheduler server" err="failed decoding descheduler's policy config \"/policy-dir/policy.yaml\": strict decoding error: unknown field \"minReplicas\"" E0429 08:30:02.819145 1 run.go:74] "command failed" err="failed decoding descheduler's policy config \"/policy-dir/policy.yaml\": strict decoding error: unknown field \"minReplicas\""

Also topologySpreadConstraints is also not supported, because this helm version - 0.29.0 just doesn't have this variable and uses old helm config... 😢

Another question is why to make code updates to master branch but don't create a new release version?

/reopen

a7i commented 2 months ago

Hi @timetofaceit can you please share your policy yaml so I can guide you on setting it up for v1alpha2?

minReplicas is available, please see README.md

Example:

profiles:
  - name: default
    pluginConfig:
    - name: "DefaultEvictor"
      args:
        minReplicas: 2
timetofaceit commented 2 months ago

Hi! @a7i

Sure!

Yes I see that they are available, but I'm getting the same error that I mentioned previously. 😕

My helm chart values file config looks like this now:

deschedulerPolicyAPIVersion: descheduler/v1alpha2

deschedulerPolicy:
  strategies: {}
  profiles:
    - name: Default
      pluginConfig:
        - name: DefaultEvictor
          args:
            evictLocalStoragePods: false
            evictSystemCriticalPods: false
            ignorePvcPods: false
            evictFailedBarePods: false
            nodeFit: true
            minReplicas: 1
        - name: RemoveDuplicates
          args:
            excludeOwnerKinds:
              - ReplicaSet
        - name: LowNodeUtilization
          args:
            thresholds:
              cpu : 30
              memory: 30
              pods: 20
            targetThresholds:
              cpu : 80
              memory: 80
              pods: 50
        - name: HighNodeUtilization
          args:
            thresholds:
              cpu : 80
              memory: 80
              pods: 50
        - name: RemovePodsViolatingInterPodAntiAffinity
        - name: RemovePodsViolatingNodeAffinity
          args:
            nodeAffinityType:
              - requiredDuringSchedulingIgnoredDuringExecution
        - name: RemovePodsViolatingTopologySpreadConstraint
          args:
            topologyBalanceNodeFit: true
            constraints:
              - DoNotSchedule
              - ScheduleAnyway
      plugins:
        balance:
          enabled:
            - RemoveDuplicates
            - LowNodeUtilization
            - HighNodeUtilization
            - RemovePodsViolatingTopologySpreadConstraint
        deschedule:
          enabled:
            - RemovePodsViolatingInterPodAntiAffinity
            - RemovePodsViolatingNodeAffinity
a7i commented 2 months ago

oh right!

minReplicas capability was added by me here: https://github.com/kubernetes-sigs/descheduler/pull/1257

This is not part of release v0.29 and is scheduled for release v0.30 (should be out soon).

Please use the README from this release branch: https://github.com/kubernetes-sigs/descheduler/tree/release-1.29

timetofaceit commented 2 months ago

Ok, thanks for the info! 👍

Will close this now.