Full lesson
Explore the full explanation, examples, and visuals at your own pace.
Part 1
You shared your app with port-forward. Then you closed your laptop. At first, your teammate opens the link, and it reaches the App Pod through your laptop, so the app page comes back. But once the terminal closes, they open it again, and the request fails. Nothing is listening anymore.
The tunnel lives only as long as the command
kubectl port-forward is a temporary tunnel from your laptop to one Pod, the container running your app. While the terminal is open, the tunnel exists and requests get through. Close it, and the command stops. The tunnel disappears, and the Pod is unreachable.
For other people: a Service with its own address
For teammates, use a Service instead. A Service is a stable entry point that routes to your Pods. Make it a LoadBalancer type, and it gets a public address. Your teammate hits that address, it reaches the Service, and the Service routes to the App Pod, no laptop involved.
port-forward is a peephole, not a front door.
port-forward is a peephole, not a front door. So when teammates need access, share a Service, not a localhost link.
