nelm icon indicating copy to clipboard operation
nelm copied to clipboard

KEDA ScaledObject is trying to be deployed before deployment

Open berserker5000 opened this issue 6 months ago • 1 comments

Before proceeding

  • [x] I didn't find a similar issue

Version

1.16.0

How to reproduce

  1. use keda autoscaler in chart
  2. try to deply
  3. get error

Result

Unexpected error when reading response body: context canceled Error: install: failed release "r" (namespace: "ns"): 2 errors occurred: * execute release install plan: wait for operations completion: execute operation: create resource: server-side apply resource "ScaledObject/app-scaledobject": admission webhook "vscaledobject.kb.io" denied the request: Deployment.apps "app" not found

Expected result

Everything is deployed properly.

Additional information

No response

berserker5000 avatar Oct 29 '25 13:10 berserker5000

Express the dependency on Deployment/app for ScaledObject/app-scaledobject like this:

kind: ScaledObject
metadata:
  name: app-scaledobject
  annotations:
    werf.io/deploy-dependency-app: state=present,kind=Deployment,name=app

We could've detected these kinds of dependencies automatically though. To do this, we need to add a special case for ScaledObjects here: https://github.com/werf/nelm/blob/a4dbf2a20a395de33a050059facf697a77b51968/internal/resource/dependency.go#L94-L95

PRs welcome.

ilya-lesikov avatar Nov 05 '25 10:11 ilya-lesikov