Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default Resource Requests and Limits overwrites empty/null value #353

Closed
felfa01 opened this issue Mar 4, 2022 · 6 comments
Closed

Default Resource Requests and Limits overwrites empty/null value #353

felfa01 opened this issue Mar 4, 2022 · 6 comments
Labels
Helm velero wontfix This will not be worked on

Comments

@felfa01
Copy link

felfa01 commented Mar 4, 2022

Describe the problem/challenge you have
You are not able to configure null values for restic daemonset or velero deployment containers. If left empty or with null/~ it will always use the default values. For some use cases you do not want to have e.g. CPU Limits.

Describe the solution you'd like
Allow empty values for CPU/Memory Requests/Limits.

Environment:

  • helm version (use helm version): version.BuildInfo{Version:"v3.6.2", GitCommit:"ee407bdf364942bcb8e8c665f82e15aa28009b71", GitTreeState:"clean", GoVersion:"go1.16.5"}
  • helm chart version and app version (use helm list -n <YOUR NAMESPACE>): 2.23.10
  • Kubernetes version (use kubectl version):v1.21.9
  • Kubernetes installer & version:
  • Cloud provider or hardware configuration: azure
  • OS (e.g. from /etc/os-release):
@jenting
Copy link
Collaborator

jenting commented Mar 5, 2022

@felfa01 I did a test with chart 2.28.0 by changing the resources from

resources:
  requests:
    cpu: 500m
    memory: 512Mi
  limits:
    cpu: 1000m
    memory: 1024Mi

to

resources: {}

The rendered manifest without the cpu/memory requests/limits.

Also, I configured resources.requests only (without limits), the rendered manifest is correct.

resources:
  requests:
    cpu: 500m
    memory: 512Mi

could you please check it?

@felfa01
Copy link
Author

felfa01 commented Mar 5, 2022

@jenting Yes you are correct that what you do works. However, if you are passing a value files with -f flag into e.g. helm upgrade that looks like this:

resources:
  requests:
    memory: 512Mi
  limits:
    cpu: 1000m
    memory: 1024Mi

or

resources:
  requests:
    cpu: 500m
    memory: 512Mi
  limits:
    cpu: ~
    memory: null

all empty or null/~ will be overwritten by the default value file from charts/velero/values.yaml.

@jenting
Copy link
Collaborator

jenting commented Mar 15, 2022

@felfa01 Please try this

resources:
  requests:
    cpu: null
    memory: 512Mi
  limits:
    cpu: 1000m
    memory: 1024Mi

or

resources:
  requests:
    cpu: 500m
    memory: 512Mi
  limits: null

I use the helm v3.7.1 for testing.

@felfa01
Copy link
Author

felfa01 commented Mar 15, 2022

@jenting
Sorry for not being more clear. What I have setup is a dependency to this repo:

dependencies:
  - name: velero
    version: 2.23.10
    repository: https://vmware-tanzu.github.io/helm-charts

If I in my sub-chart have a values.yaml and configure the following:

#values.yaml
  resources:
    requests:
      cpu: null
      memory: 1Gi
    limits:
      cpu: 1
      memory: 1Gi

and run helm template I get the following output:

  resources:
    requests:
      cpu: 500m
      memory: 1Gi
    limits:
      cpu: 1
      memory: 1Gi

However, if I add an additional test-values.yaml as input looking like this:

#test-values.yaml
  resources: 
    requests:
      cpu: null
      memory: null

and run helm template charts/ --values test-values.yaml I get this:

  resources:
    requests:
      memory: 1Gi
    limits:
      cpu: 1
      memory: 1Gi

I get the right value for requests.cpu but not for requests.memory.
My troubleshooting seems to point to some issue with chart dependencies. Something similar can be mentioned here: helm/helm#5184 (comment)

@jenting
Copy link
Collaborator

jenting commented Mar 15, 2022

I see.

It's the helm issue with sub-chart not Velero helm chart issue.
Therefore, your currently PR is a workaround way.

@jenting jenting added Helm wontfix This will not be worked on and removed bug Something isn't working pending user response labels Mar 15, 2022
@jenting
Copy link
Collaborator

jenting commented Jul 15, 2022

I'll close this issue because it's not Velero helm chart issue, but a helm issue.
Feel free to reopen it if you still have concerns.

@jenting jenting closed this as not planned Won't fix, can't repro, duplicate, stale Jul 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Helm velero wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants