Closed KamranAzeem closed 4 years ago
The docker-machine VirtualBox network comes with two interfaces, maybe it was just inherited ?
Host cannot access the NAT network, only the Host-only network (which doesn't have internet)
https://www.virtualbox.org/manual/ch06.html
Then SSH is port forwarded on the NAT interface, for management access to the machine:
NIC 1: MAC: 080027D92509, Attachment: NAT, Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported speed: 0 Mbps, Boot priori
ty: 0, Promisc Policy: deny, Bandwidth group: none
NIC 1 Settings: MTU: 0, Socket (send: 64, receive: 64), TCP Window (send:64, receive: 64)
NIC 1 Rule(0): name = ssh, protocol = tcp, host ip = 127.0.0.1, host port = 34522, guest ip = , guest port = 22
NIC 2: MAC: 0800277F91DC, Attachment: Host-only Interface 'vboxnet0', Cable connected: on, Trace: off (file: none), Type: 82540EM, Reported
speed: 0 Mbps, Boot priority: 0, Promisc Policy: deny, Bandwidth group: none
So that it doesn't have to open SSH on the other interface, only the Docker port (2376)
There was a backlog item to document this, but it hasn't really been addressed yet either: #4938
SSH listens on all interfaces, but that's another story... For minikube, it also uses port 8443.
It is not unheard of to have two network interfaces in larger Kubernetes deployments, either.
Things will also get more interesting, now that minikube starts supporting multi-node setups...
And the docker driver also changes the rules a bit, since it uses a different CNI network (kindnet).
Hello. Thanks for the reply. Though I did not get much out of your answer - unfortunately. Here is what I understood from your reply.
By the way, if you/minikube project wants to use a diagram for minikube setup on Linux/KVM, then you are very welcome to use this one by yours truly: https://github.com/KamranAzeem/docker-to-kubernetes/blob/master/images/minikube-network.png
Thank you for your time.
Alright, after some investigation, I found some details here: https://github.com/dhiltgen/docker-machine-kvm . I will re-ask this question in that repository.
By the way, I found that minikube's setup does not create the additional host only / isolated network on Hyper-V, the way it did on Linux. Instead it simply uses Hyper-V's default network for accessing the minikube VM from the host, and for the minikube VM to access the Internet. Simple!
I understand that minikube uses docker-machine in the back-ground, and it is their problem (so to speak). However, it would be in public interest to know about these network aspects directly from minikube's documentation, instead of hunting for this information on the internet; because, people are see only "minikube" when they install it! - not docker-machine
or boot2docker
:)
I have written details about all my findings on the links below, if anyone is interested:
Alright, after a spiral, following the link https://github.com/kubernetes/minikube/issues/3169, and this https://minikube.sigs.k8s.io/docs/drivers/kvm2/, I reach back here. So, my target audience is probably minikube KVM2 SIG group.
Apparently, now I know some answer to my original question. I would like to propose to please let go of the isolated network thing, as a VM can directly be created on the KVM/libvirt default
(NAT) network, and it can be accessed without any problems, and the VM can access the internet. So there is no real use (and benefit) of this isolated network in my opinion. If there is something which I am missing, please enlighten me.
Thanks again. :)
@KamranAzeem : thanks for spending time in investigating this matter!
The details of the docker-machine (and virtualbox driver) and the original kvm driver are now more a historical explanation, rather than a technical motivation. Both projects have stopped updating, and minikube is driving our own versions (of libmachine and kvm2). And like you say, user's dont care.
I suggest opening up a dedicated issue about changing the network layout, and it can be discussed in the light of the different minikube drivers ? As well as making separate Pull Requests for updating the minikube documentation, you can find all of it under the "site" directory in the repository.
The libvirt driver does not have so many users as the others do, so it's a little "behind"
Hello @afbjorklund , Sorry for the delay in replying. I was doing docker-network-deep-dive :)
Sure, I will open a new/dedicated issue about my suggestion of changing the network layout.
Thanks!
Has a new issue been open?
salam @KamranAzeem do you still have this issue, or do you like to elaborate more on this ?
Hi @KamranAzeem I have not heard from you, I would love to assist wit this issue if you have time and get back to me, if you still have this issue, please re-open
:)
Hi. First, thanks for creating minikube! I have a question, for which I am unable to find a solid answer for last two days. So I thought I would ask here.
To be clear, I am not reporting a bug. This is just a question.
My setup:
So minikube is working fine.
The simple question is: Why minikube uses an isolated network?
The long question is:
minikube-net
, which is an isolated network, and also thedefault/virbr0
network, which is a NAT network.I could not understand the reason or wisdom behind it. In past, I have seen somewhat similar behavior with virtualbox too. Since I don't use virtualbox, I really don't remember much on how it works/worked.
I am writing an article on minkube to help the community, and this question is explored in detail in the "advanced" article mentioned below.
These articles are:
In the "advanced" article, all I could do is assume the reasoning for my observation of the way minikube works. I may be wrong in my assumptions. So before announcing the article to general public, I want to be sure, and I want to fix if I have incorrect understanding about something.
I would really appreciate if someone can find some time and shine some light on this. Thank you for your time.
Steps to reproduce the issue: There is no issue. So no steps to reproduce.