From 1ea1f7bf6ec3df6b2c5d06ce6150fb7528d3e29d Mon Sep 17 00:00:00 2001 From: Nick Pappas Date: Wed, 4 Sep 2024 19:08:47 -0500 Subject: [PATCH 1/3] 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/3] 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/3] 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