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

[Feature request] add cluster mode #651

Open
Grommash9 opened this issue Oct 14, 2024 · 4 comments
Open

[Feature request] add cluster mode #651

Grommash9 opened this issue Oct 14, 2024 · 4 comments

Comments

@Grommash9
Copy link

Hello all! I want to make my project horizontally scalable.

I am trying to deploy my bot to kubernetes. I have local bot api instance what is calling a cluster of my bot's.

Webhook url is my cluster url, if I am doing any curl request manually from telegram bot api pod - it's working and I am able to see how balancer sending requests for different pods, but it's not working for telegram updates - all of them are going to same POD, I am not sure I understand how it's selected and why is it working like that. Is it like session or something like that?

People in chat's recommending to create a script what will get all the updates and put them into kafka for bot instances to pick them up, but it feels like reinventing the wheel.

Is there are any setting to allow telegram communications working in cluster mode or maybe a flag for it? And if there is nothing like that can it be added? Or it's a bad idea?

Thanks!

photo_2024-10-13_08-11-23
photo_2024-10-13_08-11-23 (2)
photo_2024-10-13_08-11-23 (3)

@EtnDiaz
Copy link

EtnDiaz commented Oct 14, 2024

We've run into the same issue when trying to scale our bot in Kubernetes. It would be great if the Telegram API could natively distribute updates across pods without needing to rely on custom solutions like Kafka. Could cluster mode support be considered in future updates?
@levlam

@LimLex
Copy link

LimLex commented Oct 15, 2024

+1

@levlam
Copy link
Contributor

levlam commented Oct 31, 2024

You can distribute the updates sent to webhook in any way you want. You can use a message broker, or a reverse proxy. There is no need to implement all these software in the Bot API server.

@Grommash9
Copy link
Author

Do you maybe know about any example or best practices about it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants