A loopback interface routes traffic within the same host or network namespace instead of sending it through an external network. The local address is commonly called localhost. section 5.3.1
In a pod, kubectl port-forward ultimately reaches the container through the pod’s loopback device. The application must listen on that interface; listening only on the pod’s eth0 interface prevents port forwarding from reaching it. section 5.3.1
Accessing a pod through localhost
Run kubectl port-forward kiada 8080, then curl localhost:8080. The local curl request travels through the port-forward proxy and reaches the application through the pod’s loopback device. section 5.3.1
$ kubectl port-forward kiada 8080 ... Forwarding from 127.0.0.1:8080 -> 8080 ... Forwarding from [::1]:8080 -> 8080
Shows kubectl port-forward binding local IPv4 and IPv6 loopback addresses to the pod’s application port. section 5.3.1
$ curl localhost:8080 Kiada version 0.1. Request processed by "kiada". Client IP: ::ffff:127.0.0.1
Shows localhost reaching the forwarded application and returning an HTTP response. section 5.3.1

