kube-forwarder
kube-forwarder copied to clipboard
Connection Problems after a upgrade (for example with helm upgrade) or rescaling
When I upgrade my Deployments for example with helm, I need to click on the connect play button for every updated service. The same when I Scale a Deployment to Zero and up again later(for example a lot to save resource costs).
Would be nice when there is a automatic refresh handling, so that the connection is still available after those events.
The problem is that the forwarder connects to a specific pod IP address instead of to the service. If that pod goes away it won't connect to a different one automatically. I'm not 100% sure why it does it this way. Perhaps it's a limitation of kubernetes or they just haven't gotten around to making it better.
After looking into this more, it's a problem with the way that kubernetes does port-forward. port-forward currently is tied to a specific port on a specific pod, so if that pod is killed, the port-forward becomes useless.
It would be really nice if kube-forwarder periodically checked whether the target pod was still valid and restarted the port-forward if necessary.
I misunderstood the README:
Auto-reconnect
Kube Forwarder watches for connection status and always tries reconnect on failure
to imply exactly this feature. Would be REALLY nice to have this. It may be worth updating the README to clarify what the Auto-reconnect actually means.
Yeah, I think it's possible to have it periodically update which pod it connects to, currently it picks one when you start forwarding. Just having a timer that restarts each forward every X seconds might be good enough.