Skip to content

Commit

Permalink
Merge pull request #37 from MichaelWasher/main
Browse files Browse the repository at this point in the history
Add retry to Pod-Gateway Client
  • Loading branch information
angelnu authored Aug 14, 2022
2 parents c8ed655 + ef275ed commit a9ba907
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/client_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ ip addr
ip route

# Check we can connect to the GATEWAY IP
ping -c1 "$GATEWAY_IP"
ping -c "${CONNECTION_RETRY_COUNT}" "$GATEWAY_IP"

# Create tunnel NIC
ip link add vxlan0 type vxlan id "$VXLAN_ID" dev eth0 dstport 0 || true
Expand Down Expand Up @@ -90,6 +90,6 @@ ip addr
ip route

# Check we can connect to the gateway ussing the vxlan device
ping -c1 "$VXLAN_GATEWAY_IP"
ping -c "${CONNECTION_RETRY_COUNT}" "$VXLAN_GATEWAY_IP"

echo "Gateway ready and reachable"
2 changes: 1 addition & 1 deletion bin/client_sidecar.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ while true; do
echo "Monitor connection to $VXLAN_GATEWAY_IP"

# Ping the gateway vxlan IP -> this only works when vxlan is up
while ping -c 1 "$VXLAN_GATEWAY_IP" > /dev/null; do
while ping -c "${CONNECTION_RETRY_COUNT}" "$VXLAN_GATEWAY_IP" > /dev/null; do
# Sleep while reacting to signals
sleep 10 &
wait $!
Expand Down
4 changes: 4 additions & 0 deletions config/settings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@ DNS_LOCAL_CIDRS="local"
# file system so it does not work. To circumvent this a copy is made using
# inotifyd
RESOLV_CONF_COPY=/etc/resolv_copy.conf

# ICMP heartbeats are used to ensure the pod-gateway is connectable from the clients.
# The following value can be used to to provide more stability in an unreliable network connection.
CONNECTION_RETRY_COUNT=1

0 comments on commit a9ba907

Please sign in to comment.