kubernetes-sigs / descheduler

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

Invalid Helm template in v0.30.1 #1453

Open drmaciej opened 5 months ago

drmaciej commented 5 months ago

What version of descheduler are you using?

descheduler version: v0.30.1

Does this issue reproduce with the latest release? Yes

Which descheduler CLI options are you using?

cmdOptions:
  v: 4

Please provide a copy of your descheduler policy config file

resources:
  requests:
    cpu: 250m
    memory: 256Mi
  limits:
    cpu: 250m
    memory: 256Mi

commonLabels:
  app: descheduler

podLabels:
  app: descheduler

schedule: "30 * * * *"

cmdOptions:
  v: 4

deschedulerPolicy:
  evictLocalStoragePods: true
  ignorePvcPods: true
  strategies:
    LowNodeUtilization:
      enabled: true
      params:
        nodeResourceUtilizationThresholds:
          thresholds:
            cpu: 80
            memory: null
            pods: null
          targetThresholds:
            cpu: 85
            memory: null
            pods: null
        namespaces:
          exclude:
            - kube-system
    RemoveDuplicates:
      enabled: false
    RemovePodsHavingTooManyRestarts:
      enabled: false
    RemovePodsViolatingNodeTaints:
      enabled: false
    RemovePodsViolatingNodeAffinity:
      enabled: false
    RemovePodsViolatingInterPodAntiAffinity:
      enabled: false
    RemovePodsViolatingTopologySpreadConstraint:
      enabled: false

tolerations:
  # redacted
  - key: "***"
    operator: "Equal"
    value: "true"
    effect: "NoSchedule"

What k8s version are you using (kubectl version)?

kubectl version Output
$ kubectl version
Client Version: v1.30.2
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.30.1-eks-1de2ab1

What did you do? Upgrade from 0.29.0 to 0.30.1

What did you expect to see? A working Helm deployment

What did you see instead?

│ Error: template: descheduler/templates/cronjob.yaml:84:23: executing "descheduler/templates/cronjob.yaml" at <ne $value nil>: error calling ne: incompatible types for comparison
│
│   with helm_release.descheduler,
│   on helm.tf line 196, in resource "helm_release" "descheduler":
│  196: resource "helm_release" "descheduler" {

appears to have been introduced in https://github.com/kubernetes-sigs/descheduler/commit/a09c4d2c61504d8fa926eab06c7070de96d1b0e0.

I had to downgrade to 0.29.0 because 0.30.0 didn't work due to https://github.com/kubernetes-sigs/descheduler/issues/1420.

a7i commented 5 months ago

Would you please try this and see if you get the same error?

cmdOptions:
  v: "4"
drmaciej commented 5 months ago

Yes, it results in the same error

a7i commented 4 months ago

I tried this using the helm CLI and no issues:

$ cat /tmp/values.yaml
cmdOptions:
  v: 4

$ helm template deschduler ./descheduler -f /tmp/values.yaml | grep bin/descheduler -A 3
                - /bin/descheduler
              args:
                - --policy-config-file=/policy-dir/policy.yaml
                - --v=4

What is your helm version? My Helm Version:

helm version
version.BuildInfo{Version:"v3.14.3", GitCommit:"f03cc04caaa8f6d7c3e67cf918929150cf6f3f12", GitTreeState:"clean", GoVersion:"go1.22.1"}
jordi-crespo commented 4 months ago

Same error for me.

My helm version is:

version.BuildInfo{Version:"v3.7.0", GitCommit:"eeac83883cb4014fe60267ec6373570374ce770b", GitTreeState:"clean", GoVersion:"go1.16.8"}
shahar-h commented 4 months ago

It works for helm >= 3.8.0.

a7i commented 4 months ago

Given that Helm v3.7.0 is almost 3 years old, we can close this issue? Thoughts @drmaciej and @jordi-crespo ?

drmaciej commented 4 months ago

I'm on Helm 3.15.3, but it turns out it wasn't the issue. The issue was in an old Terraform provider for Helm - I upgraded that to latest and the issue is now resolved.

Thanks for helping!

k8s-triage-robot commented 1 month 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 3 days 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