Replace localhost with 127.0.0.1 for healthcheck (#50)

Additionally change the commands in the pod probes from a single string to a list of strings.
This commit is contained in:
Lukas Grossar 2020-12-11 16:17:47 +01:00 committed by GitHub
parent 9f66388199
commit a956398b37
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 7 deletions

View file

@ -47,7 +47,7 @@ VOLUME [ "/var/spool/postfix", "/etc/postfix", "/etc/opendkim/keys" ]
USER root
WORKDIR /tmp
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD printf "EHLO healthcheck\n" | nc localhost 587 | grep -qE "^220.*ESMTP Postfix"
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 CMD printf "EHLO healthcheck\n" | nc 127.0.0.1 587 | grep -qE "^220.*ESMTP Postfix"
EXPOSE 587
CMD [ "/bin/sh", "-c", "/run.sh" ]

View file

@ -65,20 +65,29 @@ spec:
readinessProbe:
initialDelaySeconds: 5
periodSeconds: 60
command: >
sh -c 'printf "EHLO healthcheck\n" | nc localhost 587 | grep -qE "^220.*ESMTP Postfix"'
exec:
command:
- sh
- -c
- 'printf "EHLO healthcheck\n" | nc 127.0.0.1 587 | grep -qE "^220.*ESMTP Postfix"'
livenessProbe:
initialDelaySeconds: 5
periodSeconds: 5
failureThreshold: 1
command: >
sh -c 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "/usr/libexec/postfix/master"'
exec:
command:
- sh
- -c
- 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "/usr/libexec/postfix/master"'
startupProbe:
initialDelaySeconds: 2
periodSeconds: 5
failureThreshold: 12
command: >
sh -c 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "{postfix-script}" && ps axf | fgrep -v grep | fgrep -q "{opendkim.sh}"'
exec:
command:
- sh
- -c
- 'ps axf | fgrep -v grep | fgrep -q "{supervisord}" && ps axf | fgrep -v grep | fgrep -q "{postfix-script}" && ps axf | fgrep -v grep | fgrep -q "{opendkim.sh}"'
envFrom:
- configMapRef:
name: {{ $fullName | quote }}