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

Provide support for stateful sets #497

Closed
sc7565 opened this issue Dec 5, 2019 · 19 comments
Closed

Provide support for stateful sets #497

sc7565 opened this issue Dec 5, 2019 · 19 comments
Labels
feature All issues for new features that have been committed to help wanted Looking for support from community

Comments

@sc7565
Copy link

sc7565 commented Dec 5, 2019

Wanted to know, if current setup also supports the statefulsets?

Use-Case

Autoscale - statefulsets

@sc7565 sc7565 added feature-request All issues for new features that have not been committed to needs-discussion labels Dec 5, 2019
@iyacontrol
Copy link
Contributor

iyacontrol commented Dec 5, 2019

@sc7565 , at now it not support statefulset.

@tomkerkhove Is it necessary to support sts? need discussion.

@iyacontrol
Copy link
Contributor

iyacontrol commented Dec 5, 2019

pr is #498.
I think we should discuss in detail whether statefullset is supported, then go to review the code.

hi @ahmelsayed . what is your idea ?

@zroubalik
Copy link
Member

It would be great to support StatefulSet, but I think it should be a part of a bigger discussion on supporting mulitple types and whether we should use one general CRD or multiple CRDs for particular types or another approach.

Solution in PR #498 is adding another complexity to the existing CRD.

@iyacontrol
Copy link
Contributor

hi @zroubalik

At first, the kubernetes native hpa support deployment and statefulset. so i think keda should support statefulset.

At last, I tend to choose general CRD. There is no particularly big difference in the logic of the code for deployment and statefulset. PR #498 , to compatible with previous versions. if you use keda for deployment, yaml is the same as before.

@zroubalik
Copy link
Member

@iyacontrol absolutely agree on supporting StatefulSet!

Don't take my comment wrong. To help understand me, we had the similar discussion with supporting Job before and I wanted to restart the discussion on this since we are gonna add another type :)

My concern is, that currently there are many combinations of properties in the yaml for different types which might be confusing for user. I'd prefer to have simple CRD for a particular type.

@iyacontrol
Copy link
Contributor

iyacontrol commented Dec 6, 2019

hi @zroubalik , I read your reply carefully.

you are right. many combinations of properties in the yaml might be confusing for user. so
I think the key point is how to use ScaledObjectScaleType filed. if user supply ScaledObjectScaleType filed , deploymentName or statefulSetName can merge into one filed, for example name or appName and so on. Of course these are just some of my personal understandings.

Nice to discuss with you!

@tomkerkhove
Copy link
Member

Frankly, I'm with @zroubalik on this and brought this up when we added jobs as well. While the code might not be different, from a consumer perspective they are different and so should the resources that we create.

Adding @jeffhollan @ahmelsayed @anirudhgarg to let them chime in on this as well as I know they're more on the ScaledObject side of the fence.

That said - Either way are fine for me, splitting just feels better from a consumer/ops standpoint.

@iyacontrol
Copy link
Contributor

Hope more people discuss.

I think we can get some inspiration from kubernetes native hpa, why is there only one type of kubernetes native hpa? Instead of statefulset hpa and deployment hpa.

@tomkerkhove
Copy link
Member

While I get your point, I think from a consumer perspective it's a lot easier if it just works with the things you need and you don't need to know when to use what.

But again, see your point - Just have mixed feelings with it

@sc7565
Copy link
Author

sc7565 commented Dec 14, 2019

do we think we can get traction on this, we feel statefulset scaling is very beneficial and we do have lot of use cases for same

@jeffhollan
Copy link
Member

@sc7565 I don't see a reason we wouldn't want to support this. I think there is fair discussion on if the implementation would vary enough to justify splitting out the CRDs - but fair points on both sides. It looks like hpa already works for stateful sets and assuming custom metrics and stuff works the same, so I don't imagine it would be a ton of work to add this (I'm a PM tho so who knows 😅). A lot of considerations on statefulsets but imagine KEDA should provide the capability, we document the considerations clearly, and let folks use it if it makes sense. That's my 2c. May be worth opening another issue or renaming this one to "add support for stateful sets" - providing a bit of an expected experience (should the scaledObject and hpa be the same as deployments, just that it now scales a StatefulSet?) and we could flag as help-wanted

@balchua
Copy link
Contributor

balchua commented Jan 8, 2020

Sorry, chiming in a little bit late here.
I like the idea of supporting sts. I also agree that the CRD can get confusing.

Take for example the Job type.
There are attributes (or fields) which are not relevant, for example minReplicas and maxReplicas for Job. Another field that we repurpose is the queueLength. It would have been easier to understand if it is named maxJobs.

In reality we have two types of workloads, those that are ephemeral in nature (i.e. they run to completion) like Job and those which are "always on" for as long as there is constant flow of messages/events.

Deployments and Statefulsets belong to that category.

@tomkerkhove tomkerkhove changed the title Does Keda support statefulsets? Provide support for stateful sets Jan 9, 2020
@tomkerkhove
Copy link
Member

tomkerkhove commented Jan 9, 2020

Fair point. But if we do split the CRDs, wouldn't it be best to have ScaledJob, ScaledDeployment & ScaledStatefulSet to make it super explicit & clear rather than ScaledJob & ScaledDeamon (or so)?

@balchua
Copy link
Contributor

balchua commented Jan 9, 2020

Naming is hard 😁

@jeffhollan jeffhollan added the help wanted Looking for support from community label Jan 9, 2020
@iyacontrol
Copy link
Contributor

the metaobject of deployment is

kind: Deployment
apiVersion: apps/v1

the metaobject of statefulset is

apiVersion: apps/v1
kind: StatefulSet

maybe ScaleJob and ScaleApp consistent with k8s?

@tomkerkhove
Copy link
Member

Is a Deployment an App? I'd say no, that's what https://oam.dev/ covers.

Frankly; I think we should align with OAM's Core Workload Types or if we split it, why not per type?

@balchua
Copy link
Contributor

balchua commented Jan 14, 2020

+1 on oam naming convention.
Perhaps like this?
ScaledTask = Job and ScaledWorker = always on.

@gbird3
Copy link

gbird3 commented Feb 28, 2020

Would love for this to get finalized soon. Tested out keda using deployments and it is working great but our main use case requires Statefulset support.

@tomkerkhove tomkerkhove added feature All issues for new features that have been committed to and removed feature-request All issues for new features that have not been committed to needs-discussion labels Feb 28, 2020
@zroubalik
Copy link
Member

Fixed by #731

preflightsiren pushed a commit to preflightsiren/keda that referenced this issue Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature All issues for new features that have been committed to help wanted Looking for support from community
Projects
None yet
Development

No branches or pull requests

7 participants