kubernetes-sigs / descheduler

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

Fix the replicas value type for the descheduler helm-chart #1378

Closed hanyouqing closed 4 months ago

hanyouqing commented 5 months ago

Fix the replicas type for the helm chart (with terraform helm_release provider)

The errors details ```bash templates/: template: descheduler/templates/deployment.yaml:10:9: executing "descheduler/templates/deployment.yaml" at : error calling gt: incompatible types for comparison ```

How to re-produce

The environment

Client Version: version.Info{Major:"1", Minor:"24", GitVersion:"v1.24.13", GitCommit:"49433308be5b958856b6949df02b716e0a7cf0a3", GitTreeState:"clean", BuildDate:"2023-04-12T12:15:50Z", GoVersion:"go1.19.8", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.4
Server Version: version.Info{Major:"1", Minor:"26", GitVersion:"v1.26.15", GitCommit:"1649f592f1909b97aa3c2a0a8f968a3fd05a7b8b", GitTreeState:"clean", BuildDate:"2024-03-14T00:54:27Z", GoVersion:"go1.21.8", Compiler:"gc", Platform:"linux/amd64"}
Re-produce step by step 1. [Install Terraform](https://developer.hashicorp.com/terraform/install) 2. Create TF files ```bash $ mkdir test && cd test $ cat < providers.tf terraform { required_providers { helm = { source = "hashicorp/helm" version = "~> 2.13" } } } provider "helm" { kubernetes { config_path = "~/.kube/config" } } EOF $ cat < helm.tf # https://github.com/kubernetes-sigs/descheduler resource "helm_release" "descheduler" { repository = "https://kubernetes-sigs.github.io/descheduler/" name = "descheduler" chart = "descheduler" version = "0.29.0" namespace = "kube-system" set { name = "kind" value = "Deployment" type = "string" } set { name = "replicas" value = 2 type = "auto" } set { name = "leaderElection.enabled" value = true type = "auto" } } EOF ``` 3. Initilalize and apply ```bash $ terraform init $ terraform apply -auto-approve ... helm_release.descheduler: Creating... ╷ │ Error: template: descheduler/templates/deployment.yaml:10:9: executing "descheduler/templates/deployment.yaml" at : error calling gt: incompatible types for comparison │ │ with helm_release.descheduler, │ on helm.tf line 2, in resource "helm_release" "descheduler": │ 2: resource "helm_release" "descheduler" { │ ```
linux-foundation-easycla[bot] commented 5 months ago

CLA Signed

The committers listed above are authorized under a signed CLA.

k8s-ci-robot commented 5 months ago

Welcome @hanyouqing!

It looks like this is your first PR to kubernetes-sigs/descheduler 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/descheduler has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. :smiley:

k8s-ci-robot commented 5 months ago

Hi @hanyouqing. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.
a7i commented 5 months ago

/ok-to-test

a7i commented 5 months ago

can you please share your values file? are you using the default one?

a7i commented 5 months ago

When I use the default (which has replicas: 1) it works

helm template descheduler ./descheduler -f ./descheduler/values.yaml --set kind=Deployment
hanyouqing commented 5 months ago

Hi @a7i, I took some more tests, and you are right. It works well with the helm command. I finally found that the issues only occurred in my case. I've added the re-produce steps to the description. Thank you so much!

hanyouqing commented 4 months ago

Hi @a7i , any progress on this? Setting an int value for ' replicas` rather than float would be better. I see some similar problems 1 and 2. Thanks!

a7i commented 4 months ago

/approve

cc: @jklaw90

k8s-ci-robot commented 4 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: a7i

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/descheduler/blob/master/OWNERS)~~ [a7i] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
a7i commented 4 months ago

/cc @jklaw90

jklaw90 commented 4 months ago

/lgtm

a7i commented 4 months ago

/retest