angelnu / pod-gateway

Container image used to set a pod gateway
Apache License 2.0
56 stars 29 forks source link

Fix/gateway reconnect #2

Closed niki-on-github closed 2 years ago

niki-on-github commented 2 years ago

Description of the change:

To use the reconnect functionality I had to make a small adjustment otherwise the Sidecar stays in CrashLoopBackOff and restarts constantly. See log below:

ip route add 10.42.0.72 via ''
Error: inet address is expected rather than "".
Stream closed EOF for vpn-apps/vpn-terminal-848c69dbf9-htqjj (gateway-sidecar.

And as a result, a connection to the gateway can no longer be established.

Description: Because the pod already has the route setting the default route does not longer exist and the script is not able to determine the variable K8S_GW_IP. But we don't need this in this case anyway because the corresponding routing setting is already set.

Possible drawbacks:

None

justSem commented 2 years ago

I second this - somehow some of my pods started doing this since yesterday. Haven't been able to figure out the root cause just yet.

Edit: I'm gonna have to add in that after testing your PR, my containers still crash, but it's very inconsistent. For example: I have 5 services running in my vpn namespace. Two of which keep on crashing - the other 3 are fine. The crashing ones stay in CrashLoopBackoff untill I manually delete the pods and then they'll be fine for approx 8-ish hours. My logs are as of yet inconclusive to what exactly causes this, but my sidecar container is throwing the exact same error as @niki-on-github describes above.