We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Port Forwarding

Time to see the SynergyChat website in an actual browser!

By default, resources inside of Kubernetes run on a private, isolated network. They're visible to other resources within the cluster, but not to the outside world.

So that you can access the application from your machine, you'll need to use kubectl port-forward to forward a port on your machine to a port in the cluster. You can forward to a pod or to a service. The service is usually easier, because you don't need to look up a pod's name, because kubectl picks one of the service's pods for you.

Assignment

  1. kubectl port-forward service/web-service 8080:80

    Like kubectl proxy, it keeps running until you stop it with Ctrl+C.

    The command says "forward port 8080 on my machine to port 80 of the service named web-service".

Run and submit the CLI tests while the port is forwarded. Then stop the port forward with Ctrl+C. You won't need it again.