The problem:
kubectl port-forward was silently dropping the connection every ~60 seconds. No error message — just stops working.
The fix:
# Add keepalive flag
kubectl port-forward pod/mypod 8080:8080 --keepalive=60s
# Or just loop it
while true; do kubectl port-forward pod/mypod 8080:8080; doneWhy it happens: Load balancer in front of the Kubernetes API server has a 60s idle timeout. The connection looks idle (no traffic) and gets dropped.
The --keepalive flag sends periodic TCP keepalive packets to prevent the LB from killing the connection.