From 1ea1f7bf6ec3df6b2c5d06ce6150fb7528d3e29d Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Wed, 4 Sep 2024 19:08:47 -0500 Subject: [PATCH 1/6] fix(probes): rely on supervisorctl native exit codes for status The double-grep behavior led to the command unintentionally hanging in some cases, prompting k8s to continually restart the pod without valid reason. --- charts/docker-mailserver/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 2382179..9a65340 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -184,7 +184,7 @@ spec: command: - /bin/bash - -c - - supervisorctl status | grep -E "amavis|clamav|cron|dovecot|mailserver|opendkim|opendmarc|postfix|rsyslog" | grep RUNNING + - supervisorctl status amavis clamav cron dovecot mailserver opendkim opendmarc postfix rsyslog initialDelaySeconds: 10 timeoutSeconds: 5 failureThreshold: 3 @@ -193,7 +193,7 @@ spec: command: - /bin/bash - -c - - supervisorctl status | grep -E "mailserver|postfix" | grep RUNNING + - supervisorctl status mailserver postfix initialDelaySeconds: 10 timeoutSeconds: 5 failureThreshold: 3 From b4d3ea30a0bd723503276bc499e333d64b75da7f Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Wed, 4 Sep 2024 19:35:44 -0500 Subject: [PATCH 2/6] wip: reduce to minimum checks --- charts/docker-mailserver/templates/deployment.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 9a65340..300a4a4 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -184,7 +184,7 @@ spec: command: - /bin/bash - -c - - supervisorctl status amavis clamav cron dovecot mailserver opendkim opendmarc postfix rsyslog + - supervisorctl status cron mailserver postfix rsyslog # - supervisorctl status amavis clamav cron dovecot mailserver opendkim opendmarc postfix rsyslog initialDelaySeconds: 10 timeoutSeconds: 5 failureThreshold: 3 From a91243da64d11acbbe73d15955c78a79cb8b864a Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Sat, 7 Sep 2024 13:01:31 -0500 Subject: [PATCH 3/6] chore(deployment): clean up simplified probes note: there is optional work remaining to conditionally add more services to liveness probe based on what the user has chosen to enable (or things that may perhaps always be runnig). --- charts/docker-mailserver/templates/deployment.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 300a4a4..30c4694 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -184,7 +184,8 @@ spec: command: - /bin/bash - -c - - supervisorctl status cron mailserver postfix rsyslog # - supervisorctl status amavis clamav cron dovecot mailserver opendkim opendmarc postfix rsyslog + - supervisorctl status cron mailserver postfix rsyslog + # TODO: conditionally? add 'amavis changedetector clamav cron dovecot fail2ban fetchmail mta-sts-daemon opendkim opendmarc postgrey postsrsd rspamd rspamd-redis saslauthd_ldap saslauthd_mysql saslauthd_pam saslauthd_rimap saslauthd_shadow' initialDelaySeconds: 10 timeoutSeconds: 5 failureThreshold: 3 From c1b745f3afbdf5325c7b7da5d6c0491dacb17930 Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Tue, 3 Mar 2026 22:51:45 -0600 Subject: [PATCH 4/6] Increase readiness and liveness probe parameters --- charts/docker-mailserver/templates/deployment.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 2aedcb3..eb074de 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -187,18 +187,18 @@ spec: - -c - supervisorctl status cron mailserver postfix rsyslog # TODO: conditionally? add 'amavis changedetector clamav cron dovecot fail2ban fetchmail mta-sts-daemon opendkim opendmarc postgrey postsrsd rspamd rspamd-redis saslauthd_ldap saslauthd_mysql saslauthd_pam saslauthd_rimap saslauthd_shadow' - initialDelaySeconds: 10 - timeoutSeconds: 5 - failureThreshold: 3 + initialDelaySeconds: 30 + timeoutSeconds: 15 + failureThreshold: 5 readinessProbe: exec: command: - /bin/bash - -c - supervisorctl status mailserver postfix - initialDelaySeconds: 10 - timeoutSeconds: 5 - failureThreshold: 3 + initialDelaySeconds: 30 + timeoutSeconds: 15 + failureThreshold: 5 ports: - name: smtp containerPort: 25 From 578f21f9a8bdad661e80f0c2fdabb306b6c505e9 Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Tue, 3 Mar 2026 22:56:08 -0600 Subject: [PATCH 5/6] Increase timeout and failure threshold for health check --- charts/docker-mailserver/templates/deployment.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index eb074de..1461376 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -197,8 +197,8 @@ spec: - -c - supervisorctl status mailserver postfix initialDelaySeconds: 30 - timeoutSeconds: 15 - failureThreshold: 5 + timeoutSeconds: 30 + failureThreshold: 10 ports: - name: smtp containerPort: 25 From e5cc9923eefaedaf2cbde3fcbddcfd847a255e57 Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Tue, 3 Mar 2026 23:09:07 -0600 Subject: [PATCH 6/6] Increase initial delay and timeout for probes --- charts/docker-mailserver/templates/deployment.yaml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 1461376..fe45442 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -187,8 +187,8 @@ spec: - -c - supervisorctl status cron mailserver postfix rsyslog # TODO: conditionally? add 'amavis changedetector clamav cron dovecot fail2ban fetchmail mta-sts-daemon opendkim opendmarc postgrey postsrsd rspamd rspamd-redis saslauthd_ldap saslauthd_mysql saslauthd_pam saslauthd_rimap saslauthd_shadow' - initialDelaySeconds: 30 - timeoutSeconds: 15 + initialDelaySeconds: 60 + timeoutSeconds: 60 failureThreshold: 5 readinessProbe: exec: @@ -196,8 +196,8 @@ spec: - /bin/bash - -c - supervisorctl status mailserver postfix - initialDelaySeconds: 30 - timeoutSeconds: 30 + initialDelaySeconds: 60 + timeoutSeconds: 60 failureThreshold: 10 ports: - name: smtp