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

CPU requests change to 0 when limits introduced. #15

Open
varditn opened this issue Dec 19, 2019 · 1 comment
Open

CPU requests change to 0 when limits introduced. #15

varditn opened this issue Dec 19, 2019 · 1 comment

Comments

@varditn
Copy link

varditn commented Dec 19, 2019

When setting k8s resources limits on AS pod that doesn't have requests configured manually, CPU requests change to 0 from the default 1 value.

resources:
    limits:
      cpu: 1300m
      memory: 1395864371200m
    requests:
      cpu: "0"
      memory: 1Gi
@pires
Copy link
Contributor

pires commented Dec 20, 2019

Yep, this was a bug introduced in #5. Basically, when computing requests the code evaluates if cpu and memory are set (each on their own function) by ensuring it's not nil when it should also ensure it's not zero.
Interestingly enough, the correct validation was implemented for limits. @FlavioF this should be trivial for you to fix. I recommend you add tests that cover the failure you are observing to ensure it never happens again :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants