_rkt_ is awesome as it makes it possible to use existing LAN's DHCP server to assign containers' IP addresses with the following sample config (--net=macvlan_dhcp):
~~~
{
"Documentation": "https://github.com/containernetworking/plugins/tree/master/plugins/main/macvlan",
"name": "macvlan_dhcp",
"type": "macvlan",
"master": "br0",
"mode": "bridge",
"ipam": {
"type": "dhcp"
}
}
~
However there is a problem: container's _hostname_ is not passed to external DHCP making it impossible to find/access container on network by its name.
This behaviour severely impairs usefulness of DHCP.
It's not precisely issue with rkt, but more probably with https://github.com/containernetworking/plugins which contains implementation of dhcp ipam plugin used by macvlan_dhcp.
To be more precise - dhcp client defined in https://github.com/containernetworking/plugins/blob/master/plugins/ipam/dhcp/lease.go#L347 does not have any info about client hostname, and that's because dhcp client library which it uses does not have a mechanism for that when it's constructing its request in https://github.com/d2g/dhcp4client/blob/master/client.go#L278
https://github.com/d2g/dhcp4client/issues/22
I hope someone could liaison with _dhcp4client_ and _CNI_ and maybe even contribute patches with implementation...
We were discussing in the CNI meeting about passing the CNI_CONTAINERID as the DHCP client id (option 61). If you like, you could file an issue here: https://github.com/containernetworking/plugins
Is CNI_CONTAINERID == _hostname_? Only host name can and should be used as client id...
Most helpful comment
We were discussing in the CNI meeting about passing the CNI_CONTAINERID as the DHCP client id (option 61). If you like, you could file an issue here: https://github.com/containernetworking/plugins