Skip to content

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

@ben-dov

Description

@ben-dov

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

Metadata

Metadata

Labels

bugSomething isn't workinggood first issueGood for newcomershelp wantedLooking for support from community

Type

No type

Projects

Status

Ready To Ship

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions