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

Question: How to scale down without losing emails? #63

Closed
Nuru opened this issue Mar 19, 2021 · 4 comments
Closed

Question: How to scale down without losing emails? #63

Nuru opened this issue Mar 19, 2021 · 4 comments

Comments

@Nuru
Copy link

Nuru commented Mar 19, 2021

This wonderful chart supports autoscaling, but I do not see any provisions for scaling down without losing emails. Actually, they will not be totally lost, but if the replica set scales from 3 to 2, meaning replica-2 disappears, then if it is shut down before draining its queue there will be emails abandoned on persistent-volume-2 until the replica set scales back up. Is there a way to manage the scale-down so that the pod stops accepting new requests while the queue drains, and the pod is not terminated until the queue is empty?

@bokysan
Copy link
Owner

bokysan commented May 18, 2021

I'm leaving this issue open until we find an appropriate solution.

The image currently uses supervisord. Postfix call could be replaced by a bash script which catches SIGTERM and forces queue flush. If this sounds a bit sketch it's because it is -- I don't think we have a good way at this stage of waiting for the queue to clear.

Further exploration of this issue is needed. If anybody has any suggestions, I'm open to ideas.

@komasoftware
Copy link
Contributor

@bokysan
Copy link
Owner

bokysan commented Jun 5, 2021

This post is over three years old, which is ages in Kubernetes world. I'll talk with @luksa if he has any new ideas -- luckly he lives closeby. :-)

bokysan added a commit that referenced this issue Jun 5, 2021
Make sure the queue is flushed when the Postfix container is
shutdown through Kubernetes lifecycle hooks.
@bokysan
Copy link
Owner

bokysan commented Jun 6, 2021

I think the lifecycle definition should help fix this issue -- please check if the latest master works for you.

@bokysan bokysan closed this as completed Jun 30, 2021
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

3 participants