Headlamp port-forward works locally but returns 404 through a hostname
Asked by
BUDGET_meeting
I can port-forward Headlamp and access it locally, but trying to open it through my hosts-file entry still returns a 404. I've tried both http://headlamp.my.local and the forwarded address on port 8080. The hostname points to my Raspberry Pi, and I'm wondering whether the port-forward is only listening on localhost or whether my ingress configuration is incorrect.
Answers
kubectl port-forward normally binds only to localhost, so start by testing http://127.0.0.1:8080 or http://localhost:8080 on the machine running the command. A 192.168.x.x address wonโt work from another device unless the port-forward is explicitly bound to that interface. For remote access, expose Headlamp through a Service and Ingress instead of relying on kubectl port-forward.
Reply to this answer
This may be an ingress or routing issue rather than a Headlamp issue. Check that the ingress points to the correct Headlamp service and port, and verify that the hostname youโre using matches the ingress rule. An ingress diagnostic tool can also check the namespace, service, port, and URL configuration for you.
Reply to this answer
Add your answer
Answers are reviewed before publication.
BUDGET_meeting: I added the Raspberry Piโs address and the hostname from the example to my hosts file, but Iโll test localhost directly and check how the port-forward is bound.