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

Keda Admission Webhook rejects ScaledObject requests that use Range Limit #5348

Closed
ben-dov opened this issue Jan 4, 2024 · 8 comments · Fixed by #5377
Closed

Keda Admission Webhook rejects ScaledObject requests that use Range Limit #5348

ben-dov opened this issue Jan 4, 2024 · 8 comments · Fixed by #5377
Assignees
Labels
bug Something isn't working good first issue Good for newcomers help wanted Looking for support from community

Comments

@ben-dov
Copy link

ben-dov commented Jan 4, 2024

Report

Keda Admission Webhook fails ScaledObject requests with memory/CPU triggers that don't have memory/CPU request defined although Range Limit is defined in the namespace.
This bug report is similar to #4802 , but if Range Limit is defined with defaults limit and requests for CPU and memory, then Admission Webhook should not reject workload that define only limit, or only requests, or a combination of both.

Expected Behavior

Based on Kubernetes documentation for default memory and CPU, ScaledObject with memory and/or CPU triggers of a deployment with no requests or limits on the relevant scaler, should not be rejected by Keda Admission Webhook if a Range Limit is define with default limit and requests (of the relevant memory/CPU metric)

Actual Behavior

Keda Admission Webhook rejects ScaledObject request with:
admission webhook ... denied the request: the scaledobject has a memory trigger but the container ... doesn't have the memory request defined

Steps to Reproduce the Problem

  1. Create a Range Limit with default limit and request of memory and CPU.
  2. Create a Deployment with no resource requests or limit (e.g CPU)
  3. Create a ScaledObject with CPU scaler that points to the Deployment.
  4. Get an error message on apply.

Logs from KEDA operator

No response

KEDA Version

2.12.1

Kubernetes Version

1.26

Platform

Amazon Web Services

Scaler Details

Memory, CPU

Anything else?

No response

@ben-dov ben-dov added the bug Something isn't working label Jan 4, 2024
@JorTurFer
Copy link
Member

Yeah, makes sense totally. The admission webhook should check if there is any default value set by Range Limit.
Are you willing to include the validation?

@ben-dov
Copy link
Author

ben-dov commented Jan 4, 2024

Unfortunately I don't have any experience in Go 😅

@JorTurFer JorTurFer added help wanted Looking for support from community good first issue Good for newcomers labels Jan 4, 2024
@asoundarya96
Copy link

@JorTurFer i would like to work on this issue

@JorTurFer
Copy link
Member

Nice!
Let me assign it to you ❤️

@Bhargav-InfraCloud
Copy link
Contributor

@asoundarya96 Are you working on this? Else, I want to give it a try.

@zroubalik
Copy link
Member

@Bhargav-InfraCloud I think you can proceed with this, we plan to do a new release later this week, we can include this if you are able to tackle it soon :)

@Bhargav-InfraCloud
Copy link
Contributor

Sure @zroubalik. Thanks! Working on it.

@Bhargav-InfraCloud
Copy link
Contributor

Bhargav-InfraCloud commented Jan 16, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers help wanted Looking for support from community
Projects
Archived in project
5 participants