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

ScaledObject Validating Webhook should support dry-run=server requests #5306

Closed
rodrigorfk opened this issue Dec 21, 2023 · 0 comments · Fixed by #5307
Closed

ScaledObject Validating Webhook should support dry-run=server requests #5306

rodrigorfk opened this issue Dec 21, 2023 · 0 comments · Fixed by #5307
Labels
bug Something isn't working

Comments

@rodrigorfk
Copy link
Contributor

Report

Certain use cases require the usage of server side dry-run request to validate manifests at Kubernetes API server side, a simple way of simulating that would be, when using a helm chart, to execute the following:

helm -n default template release-name some-chart-name |  kubectl -n default apply -f - --dry-run=server

Assuming the helm chart has the following:

  • A ScaledObject defined for a scaleTargetRef of the Deployment kind.
  • The ScaledObject is defining a cpu and/or memory trigger.

The kubectl command is going to fail with the following error:

Error from server (NotFound): error when creating "STDIN": admission webhook "vscaledobject.kb.io" denied the request: Deployment.apps "some-deployment" not found

Expected Behavior

I would expect, when in dry-run mode, the admission webhook to succeed without requiring the deployment to exist, meaning the webhook wouldn't check by a side effect during dry-run mode.

Actual Behavior

The admission webhook is failing due side effects when in dry-run mode, side effects should only be checked when the request is not in dry-run mode.

Steps to Reproduce the Problem

  1. Create a helm chart with a valid ScaledObject using a Deployment or StatefulSet as a target
  2. Define a cpu or memory trigger to the ScaledObject
  3. Execute helm -n default template release-name some-chart-name | kubectl -n default apply -f - --dry-run=server

Logs from KEDA operator

example

KEDA Version

2.12.1

Kubernetes Version

1.26

Platform

Amazon Web Services

Scaler Details

CPU, memory

Anything else?

No response

@rodrigorfk rodrigorfk added the bug Something isn't working label Dec 21, 2023
@zroubalik zroubalik moved this from To Triage to In Review in Roadmap - KEDA Core Dec 21, 2023
@github-project-automation github-project-automation bot moved this from In Review to Ready To Ship in Roadmap - KEDA Core Dec 21, 2023
@tomkerkhove tomkerkhove moved this from Ready To Ship to Done in Roadmap - KEDA Core Jan 19, 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
Projects
Archived in project
1 participant