diff --git a/.ci/scripts/kube-score.sh b/.ci/scripts/kube-score.sh index 1300673..12eac05 100755 --- a/.ci/scripts/kube-score.sh +++ b/.ci/scripts/kube-score.sh @@ -9,6 +9,7 @@ helm template --values charts/$chart/ci/ci-values.yaml charts/$chart | ${KUBE_SC --ignore-test deployment-has-poddisruptionbudget \ --ignore-test deployment-has-host-podantiaffinity \ --ignore-test pod-probes \ + --ignore-test pod-probes-identical \ --ignore-test container-image-tag \ --enable-optional-test container-security-context-privileged \ --ignore-test container-security-context \ diff --git a/charts/docker-mailserver/templates/deployment.yaml b/charts/docker-mailserver/templates/deployment.yaml index 1bc7d0a..8b9dce5 100644 --- a/charts/docker-mailserver/templates/deployment.yaml +++ b/charts/docker-mailserver/templates/deployment.yaml @@ -184,22 +184,28 @@ spec: {{- toYaml . | nindent 12 }} {{- end }} + # check every 10s for startup, 90s for pod restart + startupProbe: + exec: + command: + - dms-healthcheck + periodSeconds: 10 + timeoutSeconds: 5 + failureThreshold: 9 + # check every 30s for liveness, 90s for pod restart livenessProbe: exec: - command: - - /bin/bash - - -c - - supervisorctl status | grep -E "amavis|clamav|cron|dovecot|mailserver|opendkim|opendmarc|postfix|rsyslog" | grep RUNNING - initialDelaySeconds: 10 + command: + - dms-healthcheck + periodSeconds: 30 timeoutSeconds: 5 failureThreshold: 3 + # check every 10s for readiness, 30s for service removal readinessProbe: exec: - command: - - /bin/bash - - -c - - supervisorctl status | grep -E "mailserver|postfix" | grep RUNNING - initialDelaySeconds: 10 + command: + - dms-healthcheck + periodSeconds: 10 timeoutSeconds: 5 failureThreshold: 3 ports: diff --git a/charts/docker-mailserver/tests/__snapshot__/deployment_test.yaml.snap b/charts/docker-mailserver/tests/__snapshot__/deployment_test.yaml.snap index 79138cf..1bf76a6 100644 --- a/charts/docker-mailserver/tests/__snapshot__/deployment_test.yaml.snap +++ b/charts/docker-mailserver/tests/__snapshot__/deployment_test.yaml.snap @@ -248,11 +248,9 @@ manifest should match snapshot: livenessProbe: exec: command: - - /bin/bash - - -c - - supervisorctl status | grep -E "amavis|clamav|cron|dovecot|mailserver|opendkim|opendmarc|postfix|rsyslog" | grep RUNNING + - dms-healthcheck failureThreshold: 3 - initialDelaySeconds: 10 + periodSeconds: 30 timeoutSeconds: 5 name: docker-mailserver ports: @@ -281,11 +279,9 @@ manifest should match snapshot: readinessProbe: exec: command: - - /bin/bash - - -c - - supervisorctl status | grep -E "mailserver|postfix" | grep RUNNING + - dms-healthcheck failureThreshold: 3 - initialDelaySeconds: 10 + periodSeconds: 10 timeoutSeconds: 5 resources: limits: @@ -299,6 +295,13 @@ manifest should match snapshot: securityContext: privileged: false readOnlyRootFilesystem: false + startupProbe: + exec: + command: + - dms-healthcheck + failureThreshold: 9 + periodSeconds: 10 + timeoutSeconds: 5 volumeMounts: - mountPath: /tmp/docker-mailserver/dovecot.cf name: dovecot-cf diff --git a/charts/docker-mailserver/tests/__snapshot__/secret_test.yaml.snap b/charts/docker-mailserver/tests/__snapshot__/secret_test.yaml.snap index 3c4b4f3..c8da882 100644 --- a/charts/docker-mailserver/tests/__snapshot__/secret_test.yaml.snap +++ b/charts/docker-mailserver/tests/__snapshot__/secret_test.yaml.snap @@ -248,11 +248,9 @@ manifest should match snapshot: livenessProbe: exec: command: - - /bin/bash - - -c - - supervisorctl status | grep -E "amavis|clamav|cron|dovecot|mailserver|opendkim|opendmarc|postfix|rsyslog" | grep RUNNING + - dms-healthcheck failureThreshold: 3 - initialDelaySeconds: 10 + periodSeconds: 30 timeoutSeconds: 5 name: docker-mailserver ports: @@ -281,11 +279,9 @@ manifest should match snapshot: readinessProbe: exec: command: - - /bin/bash - - -c - - supervisorctl status | grep -E "mailserver|postfix" | grep RUNNING + - dms-healthcheck failureThreshold: 3 - initialDelaySeconds: 10 + periodSeconds: 10 timeoutSeconds: 5 resources: limits: @@ -299,6 +295,13 @@ manifest should match snapshot: securityContext: privileged: false readOnlyRootFilesystem: false + startupProbe: + exec: + command: + - dms-healthcheck + failureThreshold: 9 + periodSeconds: 10 + timeoutSeconds: 5 volumeMounts: - mountPath: /tmp/docker-mailserver/dovecot.cf name: dovecot-cf