keda
keda copied to clipboard
Admissions webhook rejects when helm upgrade done with renamed ScaledObject
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
- Install a scaledobject with some name targeting some deployment.
- 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
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.
What's the right way to rename a ScaledObject when used with helm then?
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'
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.
This issue has been automatically closed due to inactivity.
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.