kubernetes-sigs / descheduler

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

Using ignorePodsWithoutPDB results in pod error #1552

Open kreeuwijk opened 1 week ago

kreeuwijk commented 1 week ago

What version of descheduler are you using?

descheduler version: 0.31.0

Does this issue reproduce with the latest release? Yes

Which descheduler CLI options are you using?

- args:                                                                                                                                                                                                                                
   - --policy-config-file=/policy-dir/policy.yaml                                                                                                                                                                                       
   - --v=3

Please provide a copy of your descheduler policy config file

    apiVersion: "descheduler/v1alpha2"
    kind: "DeschedulerPolicy"
    profiles:
    - name: default
      pluginConfig:
      - args:
          evictLocalStoragePods: true
          ignorePodsWithoutPDB: true
          ignorePvcPods: true
        name: DefaultEvictor
      - name: RemoveDuplicates
      - args:
          includingInitContainers: true
          podRestartThreshold: 100
        name: RemovePodsHavingTooManyRestarts
      - args:
          nodeAffinityType:
          - requiredDuringSchedulingIgnoredDuringExecution
        name: RemovePodsViolatingNodeAffinity
      - name: RemovePodsViolatingNodeTaints
      - name: RemovePodsViolatingInterPodAntiAffinity
      - name: RemovePodsViolatingTopologySpreadConstraint
      - args:
          targetThresholds:
            cpu: 50
            memory: 50
            pods: 50
          thresholds:
            cpu: 20
            memory: 20
            pods: 20
        name: LowNodeUtilization
      plugins:
        balance:
          enabled:
          - RemoveDuplicates
          - RemovePodsViolatingTopologySpreadConstraint
          - LowNodeUtilization
        deschedule:
          enabled:
          - RemovePodsHavingTooManyRestarts
          - RemovePodsViolatingNodeTaints
          - RemovePodsViolatingNodeAffinity
          - RemovePodsViolatingInterPodAntiAffinity

What k8s version are you using (kubectl version)?

kubectl version Output
$ kubectl version
Server Version: v1.30.5

What did you do?

I added ignorePvcPods: true to the DefaultEvictor args.

What did you expect to see? Pod to start normally and not error.

What did you see instead?

I1114 16:20:41.048491       1 secure_serving.go:57] Forcing use of http/1.1 only                                                                                                                                                     I1114 16:20:41.059664       1 named_certificates.go:53] "Loaded SNI cert" index=0 certName="self-signed loopback" certDetail="\"apiserver-loopback-client@1731601241\" [serving] validServingFor=[apiserver-loopback-client] issuer=\"apiserver-loopback-client-ca@1731601240\" (2024-11-14 15:20:39 +0000 UTC to 2025-11-14 15:20:39 +0000 UTC (now=2024-11-14 16:20:41.059620547 +0000 UTC))"                                                                           I1114 16:20:41.059706       1 secure_serving.go:213] Serving securely on :10258                                                                                                                                                      I1114 16:20:41.059726       1 tracing.go:87] Did not find a trace collector endpoint defined. Switching to NoopTraceProvider                                                                                                         I1114 16:20:41.059791       1 tlsconfig.go:243] "Starting DynamicServingCertificateController"                                                                                                                                       E1114 16:20:41.061107       1 server.go:96] "descheduler server" err="failed decoding descheduler's policy config \"/policy-dir/policy.yaml\": strict decoding error: unknown field \"ignorePodsWithoutPDB\""                        E1114 16:20:41.061128       1 run.go:72] "command failed" err="failed decoding descheduler's policy config \"/policy-dir/policy.yaml\": strict decoding error: unknown field \"ignorePodsWithoutPDB\""
kreeuwijk commented 1 week ago

@john7doe FYI, some issue with trying to activate this new ignorePodsWithoutPDB feature

kreeuwijk commented 1 week ago

It seems that this works:

    apiVersion: "descheduler/v1alpha2"
    kind: "DeschedulerPolicy"
    ignorePodsWithoutPDB: true
    profiles:
    - name: default
      pluginConfig:
      - args:
          evictLocalStoragePods: true
          ignorePvcPods: true
        name: DefaultEvictor

while this does not:

    apiVersion: "descheduler/v1alpha2"
    kind: "DeschedulerPolicy"
    profiles:
    - name: default
      pluginConfig:
      - args:
          evictLocalStoragePods: true
          ignorePvcPods: true
          ignorePodsWithoutPDB: true
        name: DefaultEvictor
john7doe commented 1 week ago

ignorePodsWithoutPDB was added after 0.31.0 was released, so if you are using 0.31.0 I would expect it to error out and complaint about ignorePodsWithoutPDB being an unknown option

kreeuwijk commented 1 week ago

Ah I see, any idea which release will have this feature?

john7doe commented 1 week ago

@ingvagabund or @a7i do you know when next release is planned for?