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

Admissions webhook rejects when helm upgrade done with renamed ScaledObject #5167

Closed
govindbalaji-s opened this issue Nov 8, 2023 · 6 comments
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity

Comments

@govindbalaji-s
Copy link

Report

Let's say I have a ScaledObject already installed with "name: initial-scaled-object", and it's target is a deployment with name "target-deployment".

Now, if I rename the ScaledObject in my helm charts to "name: renamed-scaled-object", admissions webhook starts failing the helm upgrade with:

upgrade.go:367: [debug] warning: Upgrade "<<RELEASE_NAME>>" failed: failed to create resource: admission webhook "vscaledobject.kb.io" denied the request: the workload 'target-deployment' of type 'apps/v1.Deployment' is already managed by the ScaledObject 'initial-scaled-object'

Expected Behavior

Scaled object with "renamed-scaled-object" name gets created, then "initial-scaled-object" gets deleted by helm upgrade.

Actual Behavior

Creation of "renamed-scaled-object" fails with above error.

Steps to Reproduce the Problem

  1. Install a scaledobject with some name targeting some deployment.
  2. Rename the scaledobject in your helm charts and do a helm upgrade.

Logs from KEDA operator

No response

KEDA Version

2.11.2

Kubernetes Version

1.25

Platform

Amazon Web Services

Scaler Details

No response

Anything else?

No response

@govindbalaji-s govindbalaji-s added the bug Something isn't working label Nov 8, 2023
@SpiritZhou
Copy link
Contributor

I think this is the correct behavior because the name is the identifier of the ScaledObject. Automatically replacing the current ScaledObject with another ScaledObject that has a new identifier can be a little tricky.

@govindbalaji-s
Copy link
Author

What's the right way to rename a ScaledObject when used with helm then?

@prajithp13
Copy link

We are also encountering a similar issue. In our case, the creation of the ScaledObject is failing because there is already an HPA for a deployment that we are attempting to update, as we are transitioning from native HPA to ScaledObject.

helm.go:84: [debug] admission webhook "vscaledobject.kb.io" denied the request: the workload 'app-prod-http' of type 'apps/v1.Deployment' is already managed by the hpa 'app-prod-http'

Copy link

stale bot commented Feb 13, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale All issues that are marked as stale due to inactivity label Feb 13, 2024
Copy link

stale bot commented Feb 20, 2024

This issue has been automatically closed due to inactivity.

@stale stale bot closed this as completed Feb 20, 2024
@lucyeun-alation
Copy link

We are also encountering a similar issue. In our case, the creation of the ScaledObject is failing because there is already an HPA for a deployment that we are attempting to update, as we are transitioning from native HPA to ScaledObject.

helm.go:84: [debug] admission webhook "vscaledobject.kb.io" denied the request: the workload 'app-prod-http' of type 'apps/v1.Deployment' is already managed by the hpa 'app-prod-http'

For anyone else running into this, this did the trick for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stale All issues that are marked as stale due to inactivity
Projects
Archived in project
Development

No branches or pull requests

4 participants