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

scaleTargetRef : Add label or enable regex for deploymentName #4188

Closed
nleconte-csgroup opened this issue Feb 1, 2023 · 3 comments
Closed
Labels
feature-request All issues for new features that have not been committed to needs-discussion

Comments

@nleconte-csgroup
Copy link

Proposal

I would like to be able to configure the target of the scaleTargetRef part for a deployment with a regex for the name or with label. For e.g. below with a regex:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: nginx
spec:
  scaleTargetRef:
    apiVersion:    apps/v1
    kind:          Deployment
    name:          nginx-*
[...]

And below with label:

apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
  name: nginx
spec:
  scaleTargetRef:
    apiVersion:    apps/v1
    kind:          Deployment
    label:         spring-group-id=nginx-part1
[...]

Use-Case

We are using spring cloud data flow (SCDF) in our environment and the operational team often updates the deployment in SCDF. The behaviour of SCDF is to add a suffix at the end of the deployment and incrementing it each time it is updated.

For e.g. if I updated 15 times the deployment, it would be named nginx-v16 and if I update it once more, it would be named nginx-v17.

So each time I want to update the deployment, I also have to update the nginx ScaledObject to match the new name.

If we could use regex for the deployment's name or label instead, it would be better.

Is this a feature you are interested in implementing yourself?

No

Anything else?

No response

@nleconte-csgroup nleconte-csgroup added feature-request All issues for new features that have not been committed to needs-discussion labels Feb 1, 2023
@JorTurFer
Copy link
Member

Hello,
I get your point, but we decided to not support this by design. The support for this regex could introduce side effects due to unexpected matching, and also would require that KEDA has permissions to watch all the possible workload types to detect when one is removed/added to remove/add the HPA for it.
To support this scenario, the HPA itself should support it, and it doesn't support it atm.
Just in case, WDYT @kedacore/keda-core-contributors ?

@zroubalik
Copy link
Member

Agree, we don't plan to implement this, because of the reasons mentioned by @JorTurFer.

@nleconte-csgroup you can implement a simple operator, that will generate ScaledObjects for your based on your requirements.

@nettrino
Copy link

@zroubalik could you provide an example of how to implement a simple operator for generating said ScaledObjects?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request All issues for new features that have not been committed to needs-discussion
Projects
Archived in project
Development

No branches or pull requests

4 participants