Skip to content

Commit c7643ac

Browse files
author
angelnu
committed
Add some debug info
1 parent e3eb9b7 commit c7643ac

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

README.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
This container includes scripts used to route traafic from pods through another gateway pod. Typically
44
the gateway pod then runs a openvpn client to forward the traffic.
55

6+
This container is typically used by the [pod-gateway]()
7+
68
The connection between the pods is done via a vxlan. The gatway provides a DHCP server to let client
79
pods to get automatically an IP.
810

@@ -29,7 +31,7 @@ This container provides the required init/sidecar containers for clients and gat
2931
Optionally, if a VPN is used in the gateway, blocks non VPN outbound traffic.
3032
- [gateway_sidecar.sh](bin/gateway_sidecar.sh): deploys a DHCP and DNS server
3133

32-
Settings are expected in the `/config` folder - see examples [config](config):
34+
Settings are expected in the `/config` folder - see examples under [config](config):
3335
- [config/settings.sh](config/settings.sh): variables used by all helper scripts
3436
- [config/nat.sh](config/nat.sh): static IP and nat rules for PODs exposing ports through the gateway (and optional VPN) POD
3537
Default settings might be overwritten by attachin a container volume with the new values to the helper pods.

bin/client_init.sh

+18-1
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,23 @@ if ping -c 1 -W 1000 8.8.8.8; then
2828
exit 255
2929
fi
3030

31+
# For debugging reasons print some info
32+
ip addr
33+
ip route
34+
3135
# Derived settings
3236
K8S_DNS_IP="$(echo ${K8S_DNS_IPS} | cut -d ' ' -f 1)"
3337
GATEWAY_IP="$(dig +short ${GATEWAY_NAME} @${K8S_DNS_IP})"
3438
#GW_ORG=$(route |awk '$1=="default"{print $2}')
3539
NAT_ENTRY="$(grep $(hostname) /config/nat.conf||true)"
3640

41+
# For debugging reasons print some info
42+
ip addr
43+
ip route
44+
45+
# Check we can connect to the GATEWAY IP
46+
ping -c1 $GATEWAY_IP
47+
3748
# Create tunnel NIC
3849
ip link add vxlan0 type vxlan id $VXLAN_ID dev eth0 dstport 0 || true
3950
bridge fdb append to 00:00:00:00:00:00 dst $GATEWAY_IP dev vxlan0
@@ -63,7 +74,7 @@ interface \"vxlan0\"
6374
#Configure IP and default GW though the gateway docker
6475
if [ -z "$NAT_ENTRY" ]; then
6576
echo "Get dynamic IP"
66-
dhclient -cf /etc/dhclient.conf vxlan0
77+
dhclient -v -cf /etc/dhclient.conf vxlan0
6778
else
6879
IP=$(echo $NAT_ENTRY|cut -d' ' -f2)
6980
VXLAN_IP="${VXLAN_IP_NETWORK}.${IP}"
@@ -72,6 +83,12 @@ else
7283
route add default gw $VXLAN_GATEWAY_IP
7384
#echo "nameserver $VXLAN_GATEWAY_IP">/etc/resolv.conf.dhclient
7485
fi
86+
87+
# For debugging reasons print some info
88+
ip addr
89+
ip route
90+
91+
# Check we can connect to the gateway ussing the vxlan device
7592
ping -c1 $VXLAN_GATEWAY_IP
7693

7794
echo "Gateway ready and reachable"

0 commit comments

Comments
 (0)