Problem Description
When a port-forward's target pod is deleted or restarted (e.g. during a rolling update or scaling event), Headlamp marks the port-forward as Stopped and the user must manually restart it. This is disruptive during active development/debugging sessions where pods frequently cycle, forcing the user to navigate back to the service and re-initiate the port-forward each time.
Solution
When a service-backed port-forward's pod dies, Headlamp should automatically resolve a new pod via the Kubernetes Endpoints API and re-establish the port-forward tunnel on the same local port. The reconnection should retry with exponential backoff (e.g. 3 attempts: 5s → 10s → 20s) and show a "Reconnecting" status in the UI. If all attempts fail, the port-forward should be marked as stopped with an error message.
Feature's Benefit
All Headlamp desktop (Electron) users who port-forward to Services during development or debugging. Particularly useful for users working with Deployments that undergo frequent rolling updates.
Additional context
- This only applies to Service-based port-forwards. Pod-only port-forwards lack the context to discover replacement pods.
- The backend already has the
service and serviceNamespace fields in the port-forward struct, so the Endpoints query is straightforward.
Problem Description
When a port-forward's target pod is deleted or restarted (e.g. during a rolling update or scaling event), Headlamp marks the port-forward as
Stoppedand the user must manually restart it. This is disruptive during active development/debugging sessions where pods frequently cycle, forcing the user to navigate back to the service and re-initiate the port-forward each time.Solution
When a service-backed port-forward's pod dies, Headlamp should automatically resolve a new pod via the Kubernetes Endpoints API and re-establish the port-forward tunnel on the same local port. The reconnection should retry with exponential backoff (e.g. 3 attempts: 5s → 10s → 20s) and show a "Reconnecting" status in the UI. If all attempts fail, the port-forward should be marked as stopped with an error message.
Feature's Benefit
All Headlamp desktop (Electron) users who port-forward to Services during development or debugging. Particularly useful for users working with Deployments that undergo frequent rolling updates.
Additional context
serviceandserviceNamespacefields in the port-forward struct, so the Endpoints query is straightforward.