Allow the VM to be a router
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 3.7k
- Forks
- 336
- PR merge metrics
- No merged PRs in 30d
Description
First of all, it worth mentioning that I'm not a networking expert by any means and not even sure that this is right repo to file this issue, but I've made quite some tests with all that.
The problem is that seems like Hyperkit VM is not able to work as a router, when routing of the host os is configured to do so.
Use Case
Briefly, the use case is to be able to access containers running inside the Hyperkit virtual machine by IP and name from the host machine (Mac OS). It doesn't matter whether these are docker container or Kubernetes pods.
The use case for that is described in these issues in more details:
https://github.com/moby/hyperkit/issues/55
https://github.com/docker/for-mac/issues/155
I'm not sure why it's working for VirtualBox and not for Hyperkit.
Problem
Basically I was spinning up virtual machines based on boot2docker.iso using the same ISO I can't route traffic through the VM with Hyperkit, but a do can with VirtualBox.
Example using https://github.com/kubernetes/minikube on MacOS High Sierra:
minikube start --vm-driver hyperkit.kubectl run nginx --image nginx:alpine.kubectl get pods -o wide(note the IP of the pod and find out it's CIDR, let's say it's 172.18.0.0/16).sudo route -n add 172.18.0.0/16 $(minikube ip).- Use
curlto access the IP of the nginx pod. In my case it hangs until timeout.
Doing the same but with VirtualBox driver works totally fine.
It seems like there is something inside Hyperkit (or maybe underlying MacOS hypervisor that does not let packets going through).
Although doing tcpdump on the Minikube interface (normally named bridge0) show that packets are routed correctly.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the listed Minikube Hyperkit steps on macOS, adding the route for the pod CIDR and testing with curl. Compare the result with the VirtualBox driver and inspect traffic on the bridge0 interface with tcpdump. Done means traffic to container or pod IPs routes successfully through the VM.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, kubernetes, macos
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100