moby / vpnkit

A toolkit for embedding VPN capabilities in your application
Apache License 2.0
1.09k stars 182 forks source link

Port <xxxx> for service <abc> is already opened by another service #576

Open LordReaver opened 2 years ago

LordReaver commented 2 years ago

Getting this error every 30 seconds the moment I inject a service in my kubernetes cluster. Using Docker Desktop on Windows 10, so vpnkit-controller is installed by the docker-desktop setup. I've already reset the cluster several times and tried to reproduce this step by step.

Applying deployments to my cluster is no problem at all but the moment I apply a service to expose my pods to the cluster via NodePort I'm seeing these errors in the log of the vpnkit-controller pod. Port-forwarding still works and my services are available on my host machine but I'd like to understand what is going wrong here.

Plus I'm having an issue with outbound ports. When a pod issues a lot of external requests it randomly gets timeouts, apparently because tcp sockets are exhausted at some point. When looking in the resource monitor of windows I can see that vpnkit opens a lot of ports but it seems to keep them open. I'm not sure if both issues are connected but something is going on here and I'm not sure how to analyse it any further.

If you have an idea what could cause this - let me know. If you want to dig deeper and reproduce this, also let me know - I could provide a detailed example then.