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 scaler for NATS Jetstream #2391

Closed
shaunc opened this issue Dec 7, 2021 · 20 comments · Fixed by #3468
Closed

Provide scaler for NATS Jetstream #2391

shaunc opened this issue Dec 7, 2021 · 20 comments · Fixed by #3468
Assignees
Labels
feature All issues for new features that have been committed to help wanted Looking for support from community scaler scaler-nats

Comments

@shaunc
Copy link

shaunc commented Dec 7, 2021

Proposal

Currently keda supports NATS streaming. However, NATS Streaming has been deprecated in favor of NATS Jetstream. NATS is simpler to run in-cluster than Kafka, and jetstream scales well. I hope that Keda will support it?

Use-Case

I hope to use in conjunction with fission

Anything else?

No response

@shaunc shaunc added feature-request All issues for new features that have not been committed to needs-discussion labels Dec 7, 2021
@JorTurFer JorTurFer changed the title Feature: support nats/jetstream Provide scaler for NATS Jetstream Dec 7, 2021
@JorTurFer JorTurFer added help wanted Looking for support from community scaler needs-discussion and removed needs-discussion feature-request All issues for new features that have not been committed to labels Dec 7, 2021
@JorTurFer
Copy link
Member

Hi @shaunc
Thanks for notify this. I think that KEDA should support NATS Jetstream being this the successor of NATS Streaming.
Are you willing to contribute with this?

@shaunc
Copy link
Author

shaunc commented Dec 7, 2021

Thank you, @JorTurFer!

I'm not familiar with the codebase, and have many things to do. That said, getting this working would simplify a number of other things (like having to maintain a Kafka cluster). If you could give some pointers/a checklist, I can investigate, and depending on how much work there is make some contributions if not the full feature.

@JorTurFer
Copy link
Member

JorTurFer commented Dec 7, 2021

hi @shaunc ,
As I understand this, it's basically another new scaler (because STAN is deprecated but still be there). This means that this guide could be useful.
Probably the majority of the code will be similar to already existing STAN scaler, also from unit/e2e tests
Thanks in advance in any case :)

@tomkerkhove tomkerkhove added feature All issues for new features that have been committed to scaler-nats and removed needs-discussion labels Dec 8, 2021
@tomkerkhove tomkerkhove moved this to Backlog in Roadmap - KEDA Core Feb 10, 2022
@tomkerkhove tomkerkhove moved this from To Do to Proposed in Roadmap - KEDA Core Feb 11, 2022
@goku321
Copy link
Contributor

goku321 commented Mar 31, 2022

I can take this up in coming weeks

@JorTurFer
Copy link
Member

JorTurFer commented Mar 31, 2022

Thanks!!
I'll assign it to you just for having a reference person.
Don't be afraid about request the reassignment if you finally don't do it

@JorTurFer JorTurFer moved this from Proposed to To Do in Roadmap - KEDA Core Mar 31, 2022
@shaunc
Copy link
Author

shaunc commented Mar 31, 2022

Very good! ... (currently very busy :( )....

@xgenvn
Copy link

xgenvn commented Apr 4, 2022

@goku321 do you have a plan or task board, and repository to contribute on? I think there are some people having the same interest in this.

@goku321
Copy link
Contributor

goku321 commented Apr 4, 2022

Hi @xgenvn I didn't plan anything yet. I believe it will be like any other scalers that we already have. I will start on this today/tomorrow and will try to keep you in loop.

@xgenvn
Copy link

xgenvn commented Apr 4, 2022

@goku321 I did a check on the scalers of STAN and a bit on the JetStream metrics endpoint. It seems there are many differences with /jsz endpoint compared to /channelsz. If we can conclude the IsActive implementation which currently has hasPendingMessage, the implementation should be straight-forward.

@leopoldodonnell
Copy link

@xgenvn I'm interested in being able to scale using JetStream metrics as well. Is this something that is being considered, if so what is the timeframe?

Re the /jsz endpoint, which specific Nats server issue were you referencing. We might be willing to do some work here.

@goku321
Copy link
Contributor

goku321 commented Apr 17, 2022

@leopoldodonnell I've started working on the scaler. Will try my best to conclude it in a couple of weeks. And, yes the scaler will consider the JetStream metrics

@tomkerkhove tomkerkhove moved this from To Do to In Progress in Roadmap - KEDA Core Apr 19, 2022
@leopoldodonnell
Copy link

@goku321 No pressure (really) Just checking to see if you were able to make any progress towards a JetStream scaler?

@goku321
Copy link
Contributor

goku321 commented May 4, 2022

@leopoldodonnell @xgenvn Got delayed due to some pre-commit issues

Here's the commit: goku321@126130b (Didn't test it yet)

I'm not sure how accurate is getMaxMsgLag

Would really appreciate your input and help 🙂

@leopoldodonnell
Copy link

@goku321 I will build it and have a look - its not my top priority, but I'd like to see this working and really appreciate that someone is giving it a try.

@gcameo
Copy link

gcameo commented Jul 3, 2022

Any updates?

@tomkerkhove
Copy link
Member

Let's see where @goku321 is at and if he wants to contribute it.

@goku321
Copy link
Contributor

goku321 commented Jul 4, 2022

@gcameo @tomkerkhove I still want to contribute. I had already started with the tests couple of weeks back but a bit caught up with production deployments these days. Will try to wrap up in the coming weekends or so. Appreciate your patience :)

@JorTurFer
Copy link
Member

hey @goku321
Any update? we aim to do a release next week

@goku321
Copy link
Contributor

goku321 commented Aug 1, 2022

Hi @JorTurFer In the process of testing the scaler. Will try to create a PR by today.

@goku321 goku321 mentioned this issue Aug 2, 2022
4 tasks
@goku321
Copy link
Contributor

goku321 commented Aug 8, 2022

Hi all. Can anyone from this thread with JetStream experience please review this scaler (#3468)? Would really appreciate the help :)

Repository owner moved this from In Progress to Ready To Ship in Roadmap - KEDA Core Aug 8, 2022
@tomkerkhove tomkerkhove moved this from Ready To Ship to Done in Roadmap - KEDA Core Dec 9, 2022
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 scaler scaler-nats
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

7 participants