File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change 3
3
This container includes scripts used to route traafic from pods through another gateway pod. Typically
4
4
the gateway pod then runs a openvpn client to forward the traffic.
5
5
6
+ This container is typically used by the [ pod-gateway] ( )
7
+
6
8
The connection between the pods is done via a vxlan. The gatway provides a DHCP server to let client
7
9
pods to get automatically an IP.
8
10
@@ -29,7 +31,7 @@ This container provides the required init/sidecar containers for clients and gat
29
31
Optionally, if a VPN is used in the gateway, blocks non VPN outbound traffic.
30
32
- [ gateway_sidecar.sh] ( bin/gateway_sidecar.sh ) : deploys a DHCP and DNS server
31
33
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 ) :
33
35
- [ config/settings.sh] ( config/settings.sh ) : variables used by all helper scripts
34
36
- [ config/nat.sh] ( config/nat.sh ) : static IP and nat rules for PODs exposing ports through the gateway (and optional VPN) POD
35
37
Default settings might be overwritten by attachin a container volume with the new values to the helper pods.
Original file line number Diff line number Diff line change @@ -28,12 +28,23 @@ if ping -c 1 -W 1000 8.8.8.8; then
28
28
exit 255
29
29
fi
30
30
31
+ # For debugging reasons print some info
32
+ ip addr
33
+ ip route
34
+
31
35
# Derived settings
32
36
K8S_DNS_IP=" $( echo ${K8S_DNS_IPS} | cut -d ' ' -f 1) "
33
37
GATEWAY_IP=" $( dig +short ${GATEWAY_NAME} @${K8S_DNS_IP} ) "
34
38
# GW_ORG=$(route |awk '$1=="default"{print $2}')
35
39
NAT_ENTRY=" $( grep $( hostname) /config/nat.conf|| true) "
36
40
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
+
37
48
# Create tunnel NIC
38
49
ip link add vxlan0 type vxlan id $VXLAN_ID dev eth0 dstport 0 || true
39
50
bridge fdb append to 00:00:00:00:00:00 dst $GATEWAY_IP dev vxlan0
@@ -63,7 +74,7 @@ interface \"vxlan0\"
63
74
# Configure IP and default GW though the gateway docker
64
75
if [ -z " $NAT_ENTRY " ]; then
65
76
echo " Get dynamic IP"
66
- dhclient -cf /etc/dhclient.conf vxlan0
77
+ dhclient -v - cf /etc/dhclient.conf vxlan0
67
78
else
68
79
IP=$( echo $NAT_ENTRY | cut -d' ' -f2)
69
80
VXLAN_IP=" ${VXLAN_IP_NETWORK} .${IP} "
72
83
route add default gw $VXLAN_GATEWAY_IP
73
84
# echo "nameserver $VXLAN_GATEWAY_IP">/etc/resolv.conf.dhclient
74
85
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
75
92
ping -c1 $VXLAN_GATEWAY_IP
76
93
77
94
echo " Gateway ready and reachable"
You can’t perform that action at this time.
0 commit comments