
This PR add the option to configure an empty ipam for the macvlan cni plugin. When using the macvlan cni plugin with an empty ipam the requeted pod will get the macvlan interface but without any ip address. One of the use cases for this feature is for projects that runs a dhcp server inside the pod like KubeVirt. In KubeVirt we need to let the vm running inside the pod to make the dhcp request so it will be able to make a release an renew request when needed.
1.3 KiB
1.3 KiB
macvlan plugin
Overview
macvlan functions like a switch that is already connected to the host interface. A host interface gets "enslaved" with the virtual interfaces sharing the physical device but having distinct MAC addresses. Since each macvlan interface has its own MAC address, it makes it easy to use with existing DHCP servers already present on the network.
Example configuration
{
"name": "mynet",
"type": "macvlan",
"master": "eth0",
"ipam": {
"type": "dhcp"
}
}
Network configuration reference
name
(string, required): the name of the networktype
(string, required): "macvlan"master
(string, required): name of the host interface to enslavemode
(string, optional): one of "bridge", "private", "vepa", "passthru". Defaults to "bridge".mtu
(integer, optional): explicitly set MTU to the specified value. Defaults to the value chosen by the kernel.ipam
(dictionary, required): IPAM configuration to be used for this network. For interface only without ip address, create empty dictionary.
Notes
- If are testing on a laptop, please remember that most wireless cards do not support being enslaved by macvlan.
- A single master interface can not be enslaved by both
macvlan
andipvlan
.