mirror of
https://github.com/axllent/mailpit.git
synced 2026-04-26 00:35:51 +03:00
[GH-ISSUE #543] HA deployments? #350
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#350
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 @dkpat12 on GitHub (Jul 28, 2025).
Original GitHub issue: https://github.com/axllent/mailpit/issues/543
Hi there!
I'm managing a couple deployments of Mailpit in our shared development environment running on Kubernetes and I was curious if you think it is possible to have multiple instances of the app running and point to the same data to achieve High Availability. The Kubernetes cluster sometimes needs to move the container to a different node and we have some short outages because of that.
I think I saw that the database flag accepts a remote database, but didn't see any official mention of HA in the docs. Didn't wanna go too far down the road of trying it out without checking. Thanks for this brilliant tool!
@axllent commented on GitHub (Jul 28, 2025):
Hi @dkpat12. That's a very good question. Mailpit does allow you to use a remote database called rqlite which i designed for HA - however Mailpit itself is not. Kubernetes on the other hand should take care of that HA aspect in Mailpit, provided there is at any one time one Mailpit instance serving & receiving data. The reason is that websocket notifications within Mailpit are not database-driven, but rather directly from the running app as it performs actions and received mail.
I think it should work as you expect - provided Mailpit is using rqlite, and all nodes are running the same version of Mailpit. What you do not want to be doing is using a "local" physical database (which they all connect to) as sqlite by nature is not designed for multiple access (which is where rqlite comes in). I am a still somewhat of a novice with K8s, so that's about all I can say at this point.
Does that answer your question?
@otoolep commented on GitHub (Jul 29, 2025):
rqlite creator here.
I suggest you follow the directions for running rqlite on Kubernetes here. Then pass the address of the rqlite service (
rqlite-svcin the instructions) to Mailpit. Mailpit will then be backed by a highly-available system.You need to run a minimum of 3 rqlite replicas for HA. Or 5 if you want to tolerate the failure of 2 nodes. Such HA setups also make upgrading rqlite much easier, as you can perform rolling upgrades which should minimize downtime (less than a second), during the upgrade process.
@otoolep commented on GitHub (Jul 29, 2025):
https://mailpit.axllent.org/docs/configuration/email-storage/#remote-storage-rqlite
@dkpat12 -- if you go down the path of running rqlite on Kubernetes, add
disableClusterDiscovery=trueto the database name. For example if you follow the Kubernetes instructions on rqlite.io, you should set:--database http://rqlite-svc:4001?disableClusterDiscovery=truewhen you launch Mailpit.
@axllent commented on GitHub (Jul 30, 2025):
The documentation has now been updated with a note about
disableClusterDiscovery=truewhen using load balancers.