Been following along and using the kubevirt project and had asked some questions around netwoking back in June. Much has changed since then but I still need to double check that my understanding is correct and make sure I understand the project's direction.Currently, I have a setup that is using the network-attachment-definition as a top-level CRD, multus, and the network/interface stanzas to get L2 connectivity to a VM. I'm using the bridge plugin and and am attaching interfaces into linux bridges on the host. I can do this and create multiple interfaces in the VM. All of that works nicely most of the time and has been great progress. I currently have two problems: one is that if DHCP isn't working L2 segment the VM will never be started and the second is that sometimes even though the VM gets an assigned IP, the default route is not installed the VM. I'd like to make sure my understanding and setup is correct first though before trying to debug those.
1) IPAM - I get that k8s wants to know about the IPs assigned to pods and requires IPAM for service reason. But when starting VMs and using multus on secondary interfaces that services are not currently supported on, is this really required? Do I have to have IPAM plugins on the networks used by the VM interfaces? Currently I am using the DHCP IPAM plugin which means that I have to have a DHCP daemon process running. This entity then attempts to get DHCP leases before the pod is fully starting and proxies the DHCP requests. This explains why when DHCP isn't working, things aren't started. I don't think this is necessarily the behavior we want for VMs - many times it's easier to get them up and debug DHCP there. Plus, maybe we want static IP config driven by the VM.
2) Kubevirt's DHCP proxy - It seems that Kubevirt is also installing a DHCP proxy in-between when using a bridge to connect the VM interface to the pod interface. I get that before this was required, but is it really required now that the virt-launcher owns the pod IP and the VM is getting other addresses? Why DHCP proxy there? DHCP proxies worry me....there are so many esoteric options embedded in DHCP and proxying or relaying them sounds easy but the last 2% of the scenarios can be tricky.
3) Pass-through - I know that in the specs there were plans to allow a "passthrough" mode to give the VM the virt-launcher interface directly. In this scheme, no dhcp proxy, no bridge overhead in virt-launcher. Is there a technical reason this can't be done or other problems to overcome or has it just not been gotten to? Open to a patch in this area? I may tinker with this some.
It just seems to me if I were to remove the bridge IPAM portion and DHCP proxy there, the virt-launcher bridge and DHCP man-in-the-middle, the VM would have pure and direct L2 functionality.
Then if DHCP didn't work or the VM wanted static IPs, things would be fine. But I also think some of the CNI infra is waiting for IPAM to complete and I'm not sure if/why it needs to know about the IPs on secondary interfaces. That may or may not even be a question for kubevirt, but I suspect there are some here that opinions and can clarify. I've looked at PRs, issues, specs sent out, ancompletlyd the roadmaps but can't definitively answer these questions. Thanks for the time.-K
On Saturday, 27 October 2018 00:50:16 UTC+3, keithdo...@gmail.com wrote:Been following along and using the kubevirt project and had asked some questions around netwoking back in June. Much has changed since then but I still need to double check that my understanding is correct and make sure I understand the project's direction.Currently, I have a setup that is using the network-attachment-definition as a top-level CRD, multus, and the network/interface stanzas to get L2 connectivity to a VM. I'm using the bridge plugin and and am attaching interfaces into linux bridges on the host. I can do this and create multiple interfaces in the VM. All of that works nicely most of the time and has been great progress. I currently have two problems: one is that if DHCP isn't working L2 segment the VM will never be started and the second is that sometimes even though the VM gets an assigned IP, the default route is not installed the VM. I'd like to make sure my understanding and setup is correct first though before trying to debug those.I assume that you use the standard bridge CNI [1] ?In this case, you can either define an IPAM object in the network attachment CRD, and then get the IP from the CNI, or leave it out.If you leave it out, but configure an interface on your VM to get their IP from DHCP, there has to be a DHCP server connected to that network for the VM to start properly (this is also dependent with guest OS).Could you please send over the VMI yaml file?
1) IPAM - I get that k8s wants to know about the IPs assigned to pods and requires IPAM for service reason. But when starting VMs and using multus on secondary interfaces that services are not currently supported on, is this really required? Do I have to have IPAM plugins on the networks used by the VM interfaces? Currently I am using the DHCP IPAM plugin which means that I have to have a DHCP daemon process running. This entity then attempts to get DHCP leases before the pod is fully starting and proxies the DHCP requests. This explains why when DHCP isn't working, things aren't started. I don't think this is necessarily the behavior we want for VMs - many times it's easier to get them up and debug DHCP there. Plus, maybe we want static IP config driven by the VM.IPAM is optional. See [1]2) Kubevirt's DHCP proxy - It seems that Kubevirt is also installing a DHCP proxy in-between when using a bridge to connect the VM interface to the pod interface. I get that before this was required, but is it really required now that the virt-launcher owns the pod IP and the VM is getting other addresses? Why DHCP proxy there? DHCP proxies worry me....there are so many esoteric options embedded in DHCP and proxying or relaying them sounds easy but the last 2% of the scenarios can be tricky.Kubevirt's DHCP server is used only in the case that the pod's interface did get an IP (could be primary or secondary network). If the pod just gets an L2 network, Kubevirt's DHCP server is not used, and the VM gets an IP address from the L2 network it is connected to (if DHCP exists there). Note that we don't proxy any DHCP requests through Kubevirt's DHCP server, since it is only used when the pod got an IP address on its interface through the CNI.
3) Pass-through - I know that in the specs there were plans to allow a "passthrough" mode to give the VM the virt-launcher interface directly. In this scheme, no dhcp proxy, no bridge overhead in virt-launcher. Is there a technical reason this can't be done or other problems to overcome or has it just not been gotten to? Open to a patch in this area? I may tinker with this some.
Currently there is a PR for supporting SR-IOV [2] in kubevirt. I guess the a passthrough of the entire interface could also be added, just note that in such a case, it will be completely taken from the host. Not sure what is the priority for this.
It just seems to me if I were to remove the bridge IPAM portion and DHCP proxy there, the virt-launcher bridge and DHCP man-in-the-middle, the VM would have pure and direct L2 functionality.As mentioned before, IPAM is not mandatory for the bridge CNI, and in such a case Kubevirt's DHCP server will not be used.
Please consider looking into these blog posts on Kubevirt networking: [3], [4]
Roman,Not sure exactly what you mean by "you can't use the pod network." Maybe you can clarify some?I am just trying to create a VM and give it direct L2 connectivity to a network reachable via the host (worker-node) and don't want anyone mucking with DHCP. Some VMs, may exist only in k8s/pod-networking world and would need only a single IP address based on the pod network.
That VM is fine to define in bound services and have it's outbound connections nat'd. Some VMs might have two interfaces and serve as some sort of VNF between the pod network and a physical network.
But it could also be that someone wants to spin up a VM and connect it to a network the way any conventional hypervisor does today with a vswitch and it has no connectivity into the k8s world at all.
Then the VM has full L2/L3 inbound and outbound connectivity on one or more interfaces (or networks). K8s along with kubevit is providing scheduling, storage, network (single or multiple interfaces) and HA across a multi-node compute cluster.
I'm trying to replicate the last VM model at this point - am I using this in an unintended way? Or if there is an easier way I'm open to other solutions as well.
-KOn Mon, Oct 29, 2018 at 1:04 AM Roman Mohr <rm...@redhat.com> wrote:On Fri, Oct 26, 2018 at 11:50 PM <keithdo...@gmail.com> wrote:
>
>
> Been following along and using the kubevirt project and had asked some questions around netwoking back in June. Much has changed since then but I still need to double check that my understanding is correct and make sure I understand the project's direction.
>
> Currently, I have a setup that is using the network-attachment-definition as a top-level CRD, multus, and the network/interface stanzas to get L2 connectivity to a VM.
Apart from Yuval's precise explanations, I would be very interested in
hearing what exactly you are doing so that you can't use the pod
network. Maybe there are other solutions as well to simplify your
setup.
Best Regards,
Roman
> I'm using the bridge plugin and and am attaching interfaces into linux bridges on the host. I can do this and create multiple interfaces in the VM. All of that works nicely most of the time and has been great progress. I currently have two problems: one is that if DHCP isn't working L2 segment the VM will never be started and the second is that sometimes even though the VM gets an assigned IP, the default route is not installed the VM. I'd like to make sure my understanding and setup is correct first though before trying to debug those.
> 1) IPAM - I get that k8s wants to know about the IPs assigned to pods and requires IPAM for service reason. But when starting VMs and using multus on secondary interfaces that services are not currently supported on, is this really required? Do I have to have IPAM plugins on the networks used by the VM interfaces? Currently I am using the DHCP IPAM plugin which means that I have to have a DHCP daemon process running. This entity then attempts to get DHCP leases before the pod is fully starting and proxies the DHCP requests. This explains why when DHCP isn't working, things aren't started. I don't think this is necessarily the behavior we want for VMs - many times it's easier to get them up and debug DHCP there. Plus, maybe we want static IP config driven by the VM.
>
> 2) Kubevirt's DHCP proxy - It seems that Kubevirt is also installing a DHCP proxy in-between when using a bridge to connect the VM interface to the pod interface. I get that before this was required, but is it really required now that the virt-launcher owns the pod IP and the VM is getting other addresses? Why DHCP proxy there? DHCP proxies worry me....there are so many esoteric options embedded in DHCP and proxying or relaying them sounds easy but the last 2% of the scenarios can be tricky.
>
> 3) Pass-through - I know that in the specs there were plans to allow a "passthrough" mode to give the VM the virt-launcher interface directly. In this scheme, no dhcp proxy, no bridge overhead in virt-launcher. Is there a technical reason this can't be done or other problems to overcome or has it just not been gotten to? Open to a patch in this area? I may tinker with this some.
-->
>
> It just seems to me if I were to remove the bridge IPAM portion and DHCP proxy there, the virt-launcher bridge and DHCP man-in-the-middle, the VM would have pure and direct L2 functionality. Then if DHCP didn't work or the VM wanted static IPs, things would be fine. But I also think some of the CNI infra is waiting for IPAM to complete and I'm not sure if/why it needs to know about the IPs on secondary interfaces. That may or may not even be a question for kubevirt, but I suspect there are some here that opinions and can clarify. I've looked at PRs, issues, specs sent out, and the roadmaps but can't definitively answer these questions. Thanks for the time.
>
> -K
>
> --
> You received this message because you are subscribed to the Google Groups "kubevirt-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to kubevirt-dev...@googlegroups.com.
> To post to this group, send email to kubevi...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/kubevirt-dev/a13a6558-519c-44b3-87bb-3ed449a32f9b%40googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "kubevirt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kubevirt-dev...@googlegroups.com.
To post to this group, send email to kubevi...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kubevirt-dev/CAKKGZUSKqOihSoy6yQNfQ2FjepbWjASPSxeD9OMC3HG21-DEjg%40mail.gmail.com.
This is true except for "network".Kubernetes provides scheduling, compute, and storage.But the networking model of Kubernetes would not be used. Kubernetes networking model is today limited to "the pod network". Which does guarantee integration with Services and Ingress, but does **not** allow plain L2 networking.multus - even if it is designed for Kubernetes - is providing an additional way to do networking in Kubernetes - but I wouldn't phrase it as that it's "Kubernetesn netwrking".The issue is that interfaces provided by multus are _not necessarily_ able to tie in with the rest of the Kubernetes networking concepts like Service and Ingress.I don't think it is an issue for your use-case, I just wanted to clarify it :)
I'm using the bridge plugin and and am attaching interfaces into linux bridges on the host. I can do this and create multiple interfaces in the VM. All of that works nicely most of the time and has been great progress. I currently have two problems: one is that if DHCP isn't working L2 segment the VM will never be started and the second is that sometimes even though the VM gets an assigned IP, the default route is not installed the VM. I'd like to make sure my understanding and setup is correct first though before trying to debug those.On which interface did you see this?On the primary interface or on an additional multus backed interface?
> 1) IPAM - I get that k8s wants to know about the IPs assigned to pods and requires IPAM for service reason. But when starting VMs and using multus on secondary interfaces that services are not currently supported on, is this really required? Do I have to have IPAM plugins on the networks used by the VM interfaces? Currently I am using the DHCP IPAM plugin which means that I have to have a DHCP daemon process running. This entity then attempts to get DHCP leases before the pod is fully starting and proxies the DHCP requests. This explains why when DHCP isn't working, things aren't started. I don't think this is necessarily the behavior we want for VMs - many times it's easier to get them up and debug DHCP there. Plus, maybe we want static IP config driven by the VM.
>
> 2) Kubevirt's DHCP proxy - It seems that Kubevirt is also installing a DHCP proxy in-between when using a bridge to connect the VM interface to the pod interface. I get that before this was required, but is it really required now that the virt-launcher owns the pod IP and the VM is getting other addresses? Why DHCP proxy there? DHCP proxies worry me....there are so many esoteric options embedded in DHCP and proxying or relaying them sounds easy but the last 2% of the scenarios can be tricky.This is only on the primary interface in order to provide feature parity with Kubrenetes pods.This DHCP server is not present on the additional multus backed vNICs.
[root@beiwe-local /]# ss -tuapn
Netid State Recv-Q Send-Q Local Address:Port Peer Address:Port
udp UNCONN 17920 0 0.0.0.0%k6t-net1:67 0.0.0.0:* users:(("virt-launcher",pid=18,fd=16))
[root@beiwe-local /]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
3: eth0@if25: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1450 qdisc noqueue state UP group default
link/ether 0a:58:0a:f4:01:0b brd ff:ff:ff:ff:ff:ff link-netnsid 0
inet 10.244.1.11/24 scope global eth0
valid_lft forever preferred_lft forever
5: net1@if26: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master k6t-net1 state UP group default
link/ether 0a:58:0a:1a:14:9e brd ff:ff:ff:ff:ff:ff link-netnsid 0
6: k6t-net1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default
link/ether 0a:58:0a:1a:14:9e brd ff:ff:ff:ff:ff:ff
inet 169.254.75.10/32 brd 169.254.75.10 scope global k6t-net1
valid_lft forever preferred_lft forever
7: vnet0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master k6t-net1 state UNKNOWN group default qlen 1000
link/ether fe:58:0a:c1:fc:f7 brd ff:ff:ff:ff:ff:ff
>
> 3) Pass-through - I know that in the specs there were plans to allow a "passthrough" mode to give the VM the virt-launcher interface directly. In this scheme, no dhcp proxy, no bridge overhead in virt-launcher. Is there a technical reason this can't be done or other problems to overcome or has it just not been gotten to? Open to a patch in this area? I may tinker with this some.Ihar (CC'ed) is working on one aspect of this (SR-IOV).SR-IOV is one way to do this. Would you need direct passthrough of one physical device?
I think as Yuval pointed out before, this DHCP behavior is determined by whether an IP is present or not. So if you can get a CNI plugin to not use IPAM (he provided two options), this should be fine. I'm trying to patch the bridge using the PR he pointed out to avoid IPAM, but having some issues that I need to work through more.