Skip to content

Commit

Permalink
Disable liveness probe until keepalived.conf exists
Browse files Browse the repository at this point in the history
Keepalived doesn't necessarily start immediately when its container
is created. It waits until keepalived.conf exists. In some case,
it takes longer for the config file to be created than for the
liveness probe to time out, which triggers unnecessary restarts of
the container. Once the monitor populates keepalived.conf it will
send the reload command, which starts keepalived.

This change just adds a check for the keepalived.conf file to the
liveness probe. This way, the liveness probe will always succeed
until keepalived.conf is created.
  • Loading branch information
cybertron authored and openshift-cherrypick-robot committed Sep 14, 2021
1 parent b95e354 commit 221a6b7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion templates/common/baremetal/files/baremetal-keepalived.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ contents:
- /bin/bash
- -c
- |
echo "State = FAULT" > /tmp/keepalived.data && kill -s SIGUSR1 "$(pgrep -o keepalived)" && for i in $(seq 5); do grep -q "State = FAULT" /tmp/keepalived.data && sleep 1 || exit 0; done && exit 1
[ ! -s "/etc/keepalived/keepalived.conf" ] || (echo "State = FAULT" > /tmp/keepalived.data && kill -s SIGUSR1 "$(pgrep -o keepalived)" && for i in $(seq 5); do grep -q "State = FAULT" /tmp/keepalived.data && sleep 1 || exit 0; done && exit 1)
initialDelaySeconds: 20
terminationMessagePolicy: FallbackToLogsOnError
imagePullPolicy: IfNotPresent
Expand Down

0 comments on commit 221a6b7

Please sign in to comment.