Now we can use that name to ask kubectl to set up a proxy that will forward all traffic from a local port we specify to a port associated with the Pod we determine. Get the full name of the Pod that was created with your deployment by looking at the Pods using the following command:
kubectl get pods
In my example, the result was flask-1599974757-b68pw, which can then be used with the port-forward command:
kubectl port-forward flask-1599974757-b68pw 5000:5000
The output should be something like the following:
Forwarding from 127.0.0.1:5000 -> 5000Forwarding from [::1]:5000 -> 5000
This is forwarding any and all traffic that gets created on your local machine at TCP port 5000 to TCP port 5000 on the Pod flask-1599974757-b68pw ...