mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 16:56:00 +03:00
[GH-ISSUE #544] Set disableClusterDiscovery=true when using rqlite and Kubernetes #349
Labels
No labels
awaiting feedback
bug
docker
documentation
enhancement
github_actions
invalid
pull-request
question
stale
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/mailpit#349
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @otoolep on GitHub (Jul 29, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/544
As per https://github.com/rqlite/gorqlite it's recommended to disable set this flag when talking to Kubernetes-based rqlite. Why? Because not doing so will mean that gorqlite will attempt to circumvent the load-balancing done by Kubernetes. This is because gorqlite was not built with Kubernetes-based deployments in mind.
I expect that users who have Mailpit talking to Kubernetes-based rqlite deployments may encounter connection issues.
@axllent -- I see you are using the stdlib version of gorqlite. How would you expect to configure it, so that this flag is set when necessary? There are a few issues here that I see:
WDYT?
(I'm going to look into a way for gorqlite to handle this situation automatically, BTW, so I might have solution -- this is just about the discussion right now)
@otoolep commented on GitHub (Jul 29, 2025):
The key section from the gorqlite readme:
disableClusterDiscovery=trueas a URL Query Parameter when connecting to rqlite e.g.http://localhost:14001?disableClusterDiscovery=true.@otoolep commented on GitHub (Jul 29, 2025):
https://github.com/axllent/mailpit/issues/543 is what triggered this issue.
@otoolep commented on GitHub (Jul 29, 2025):
(BTW I never liked the way gorqlite tried to find other nodes in the cluster. It was trying to help, but it ended up confusing things. But that behaviour is now relied on, most likely, so I can't change its default)
@otoolep commented on GitHub (Jul 29, 2025):
At this point if we just update the Mailpit docs we're probably covered until I come up with a better solution.
@axllent commented on GitHub (Jul 29, 2025):
Hey @otoolep - thanks for the info, appreciated. Yeah, the way to configure it would be via the
--databaseflag/environment, and I don't think there is (or should be) any way I try detect that automatically and set it from within Mailpit, as a kubernetes deployment can be set up multiple ways such as number of nodes, auto-scaling etc. I'm not even sure an app could auto-detect if it's being run on k8s (which would be the other potential way). I think just a note in the docs should be sufficient (thank you for the PR btw), as anyone wanting to deploy to such an environment would likely (hopefully) have done some research beforehand and understand what they are doing, or at least investigate it further if it goes wrong.I'll hopefully look into your PR later today (I'm away for work at the moment but will be back tonight [NZ time]).
@otoolep commented on GitHub (Jul 29, 2025):
Yeah, I would merge the docs PR now and leave it at that. Don't worry about any code changes to Mailpit. I'm thinking about ways to have gorqlite to just "do the right thing" automatically.
@axllent commented on GitHub (Jul 30, 2025):
Great, and thanks. I've merged in that PR and deployed to the website. I agree, there are a couple of things that could be improved in gorqlite, but (as far as I'm aware), it is for the most part a pretty robust integration with Mailpit which is being used by a (growing?) number of users.
Anyway, nice to see you're keeping tabs on rqlite topics, and always good to get your input in times like this 👍