macos – kubectl port-forward multiple services

I have been trying to forward multiple ports with these commands:

kubectl port-forward deployment/service1 8080:8080 && kubectl port-forward deployment/service2 8081:8081

and

kubectl port-forward deployment/service1 8080:8080 || kubectl port-forward deployment/service2 8081:8081

it seems like it’s only forwarding the first one with this output:

Forwarding from 127.0.0.1:8080 -> 8080
Forwarding from [::1]:8080 -> 8080

how can I make it to listen in the background and run the second command?

Read more here: Source link