[GH-ISSUE #543] HA deployments? #350

Closed
opened 2026-03-15 14:02:33 +03:00 by kerem · 4 comments
Owner

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!

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!
kerem closed this issue 2026-03-15 14:02:38 +03:00
Author
Owner

@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?

<!-- gh-comment-id:3129263012 --> @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](https://rqlite.io/) 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?
Author
Owner

@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-svc in 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.

<!-- gh-comment-id:3132594761 --> @otoolep commented on GitHub (Jul 29, 2025): rqlite creator here. I suggest you follow the directions for running rqlite on Kubernetes [here](https://rqlite.io/docs/guides/kubernetes/). Then pass the address of the rqlite service (`rqlite-svc` in 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.
Author
Owner

@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=true to the database name. For example if you follow the Kubernetes instructions on rqlite.io, you should set:

--database http://rqlite-svc:4001?disableClusterDiscovery=true

when you launch Mailpit.

<!-- gh-comment-id:3133051354 --> @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=true` to the database name. For example if you follow the Kubernetes instructions on rqlite.io, you should set: `--database http://rqlite-svc:4001?disableClusterDiscovery=true` when you launch Mailpit.
Author
Owner

@axllent commented on GitHub (Jul 30, 2025):

The documentation has now been updated with a note about disableClusterDiscovery=true when using load balancers.

<!-- gh-comment-id:3134807042 --> @axllent commented on GitHub (Jul 30, 2025): The documentation has now been updated with a note about `disableClusterDiscovery=true` when using load balancers.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#350
No description provided.