Issue
I frequently do port-forward on my mac but when I hit the CMD + C on my terminal to quit the port-forward, the process didn't get killed. i have to kill it in order to do a new port-forward. Do you know how to solve this issue on mac?
[2] + 43679 suspended kubectl port-forward pod/pod-0 27017:27017
Re-try
kubectl port-forward pod/pod-2 27017:27017
Unable to listen on port 27017: Listeners failed to create with the following errors: [unable to create listener: Error listen tcp4 127.0.0.1:27017: bind: address already in use unable to create listener: Error listen tcp6 [::1]:27017: bind: address already in use]
error: unable to listen on any of the requested ports: [{27017 27017}]
➜ ~ kill -9 43679
Solution
On Mac, the command you want is CTRL+C
to quit/kill the process. The port forwarding is only in effect when the kubectl process is up.
Answered By - JasonY Answer Checked By - Timothy Miller (WPSolving Admin)