kubernetes-sigs / kind

Kubernetes IN Docker - local clusters for testing Kubernetes
https://kind.sigs.k8s.io/
Apache License 2.0
13.49k stars 1.56k forks source link

KinD, Docker Desktop and VPN #3198

Closed jack1902 closed 1 year ago

jack1902 commented 1 year ago

What happened:

I have successfully created a kind cluster using the simple commands of kind create cluster which i can happily deploy pods too and happily get to the internet from within a container running within the kind node. My issue is that i am hoping to access private-ips which are added to my host' route tables (MacOS) by a Mesh Network VPN Client (Fortinet ZTNA / Fortinet VPN).

I can successfully get to the service exposed by the VPN Client on the following:

What you expected to happen:

I was hoping that i could simply do the following:

Considering i can hit the service exposed by the VPN within a container running within the Linux VM which backs docker-desktop and even from the container which acts as the kind-control-plane, i assumed a container running inside of the kind-control-plane might of been able to reach the same service.

I might very well be missing something additional to configure to enable the private-ip to be accessible from within the container running inside of kind, inside of docker-dekstop (i appreciate this is a complex networking setup and not the usual path of running kind)

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

jack1902 commented 1 year ago

To add, i checked some routes from the container running within the kind container and can now see the ip which maps to the service exposed by the VPN.

Even though the default route is present no matter what, seemed odd that only the container running inside kind had issues.

Issue has been addressed at the moment but will monitor it closely to see if the issue comes back after restarts etc

aojea commented 1 year ago

this is more a networking. problem than a kind problem

BenTheElder commented 1 year ago

KIND pod containers have "masqueraded" traffic that should appear as the "node" container IP, and exit the node container the same as any other traffic 🤔

To clarify: this VPN runs entirely on the host mac, nothing special in the docker desktop VM?

Can you try a pod with hostNetwork: true instead of on the kind node container directly?

jack1902 commented 1 year ago

Will try this now as since restarting the issue has re-appeared.

annoyingly i can see a "route" with ip route get <IP>. It might be down to the application itself as curl for example from a container within a pod can get to the <IP>.

Will add hostNetwork: true to the pod and see if that changes things (hostNetwork would in this instance mean the kind-container within docker-desktop right?)

jack1902 commented 1 year ago

Going to close this, as it is an issue within the application itself, not the networking or anything to do with Kind.

Seeing as curl consistently works within the running container i'm going to close this issue