kubernetes-sigs / descheduler

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

failed decoding descheduler's policy config \"/policy-dir/policy.yaml\": strict decoding error: unknown field \"evictableNamespaces.namespaces\" #1175

Closed iefc closed 1 year ago

iefc commented 1 year ago

What version of descheduler are you using?

descheduler version: from master

Does this issue reproduce with the latest release?

yes

Which descheduler CLI options are you using?

no

Please provide a copy of your descheduler policy config file

apiVersion: "descheduler/v1alpha2"
kind: "DeschedulerPolicy"
evictSystemCriticalPods: false
evictFailedBarePods: false
evictLocalStoragePods: false
ignorePvcPods: true
nodeSelector: "descheduler-ignore=false"
profiles:
  - name: ProfileName
    pluginConfig:
    - name: "HighNodeUtilization"
      args:
        evictableNamespaces:
          namespaces:
            exclude:
            - "kube-system"
            - "public-service"
            - "ingress-nginx"
            - "seaweedfs"
            - "monitoring"
        thresholds:
          "cpu" : 100
          "memory": 85
          "pods": 60
    plugins:
      balance:
        enabled:
          - "HighNodeUtilization"

What k8s version are you using (kubectl version)?

kubectl version Output
$ kubectl version
1.18.19

What did you do?

I0615 23:26:43.598442 1 healthz.go:176] Installing health checkers for (/healthz): "Descheduler" I0615 23:26:43.599384 1 named_certificates.go:53] "Loaded SNI cert" index=0 certName="self-signed loopback" certDetail="\"apiserver-loopback-client@1686871603\" [serving] validServingFor=[apiserver-loopback-client] issuer=\"apiserver-loopback-client-ca@1686871603\" (2023-06-15 22:26:43 +0000 UTC to 2024-06-14 22:26:43 +0000 UTC (now=2023-06-15 23:26:43.599322505 +0000 UTC))" I0615 23:26:43.599429 1 secure_serving.go:210] Serving securely on [::]:10258 I0615 23:26:43.599528 1 tlsconfig.go:240] "Starting DynamicServingCertificateController" E0615 23:26:43.600971 1 server.go:99] "descheduler server" err="failed decoding descheduler's policy config \"/policy-dir/policy.yaml\": strict decoding error: unknown field \"evictableNamespaces.namespaces\"" I0615 23:26:43.601036 1 tlsconfig.go:255] "Shutting down DynamicServingCertificateController" I0615 23:26:43.601086 1 secure_serving.go:255] Stopped listening on [::]:10258

What did you expect to see?

What did you see instead?

damemi commented 1 year ago

Looks like maybe the documentation is wrong? EvictableNamespaces just has sub Include and Exclude fields.

@iefc does it work if you drop the namespaces section and just have something like:

    - name: "HighNodeUtilization"
      args:
        evictableNamespaces:
          exclude:
          - "kube-system"
          - "public-service"
          - "ingress-nginx"
          - "seaweedfs"
          - "monitoring"