tinkerbell/k8s-sandbox

dhcrelay drop the dhcp-ack from calixxxx

Closed this issue · 6 comments

Hi guys
I am here again

i deploy tinkerbell in k8s, my k8s version is V1.22.3, my cni is Calico
my boots docker and dhcrelay docker is on same host.
when i pxe boot a machine, i can see the dhcp-discover packet arrived into boots and the boots give dhcp-offer

i can tcpdump both the dhcp-discover and dhcp-offer packet in calicxxxx device
but i can only tcpdump the dhcp-discover packet in host's nic, such as ens3

pxe-boot ---> host ens3 ---> dhcrelay ---> calixxxx ----> calixxxx ---> boots

boots ---> calixxxx ----> calixxxx -----> the packet is not arrived ens3

i can see the dhcrelay thread:
dhcrelay -d -id ens3 -iu calife3a10a63a6 boots

kubectl logs -f dhcrelay-6465784854-qv4f9 get the output:
Forwarded BOOTREQUEST for 52:54:00:48:6c:40 to 10.105.102.184
Discarding packet received on calife3a10a63a6 interface that has no IPv4 address assigned.

i think it's the dhcrelay drop the dhcp-ack
but why
and how can i resolve this ?

with great appreciate.

https://github.com/42wim/isc-dhcp/blob/f54a146c7fe88889d60f0c1aa8e6f04707f95223/relay/dhcrelay.c
i check the source code of isc-dhcp, found this:

if (ip->address_count < 1 || ip->addresses == NULL) {
	log_info("Discarding packet received on %s interface that "
		 "has no IPv4 address assigned.", ip->name);
	return;
}

i add an ipaddress to the calixxxx veth, the logs in dhcp-relay are disappear, but still cannot capture dhcp-ack in ens3.
ip addr add 168.168.168.2/24 dev calife3a10a63a6

is there any way to work around this ?

@detiber you're probably best equipped to comment on this. Would you mind taking a look?

workaround:

  1. add an ipaddress to the calixxxx veth
  2. make the dhcprelay pod crashed
  3. start the dhcprelay process in host

then the dhcp DORA works fine.

TODO:
why the dhcprelay is not work in pod.

@detiber Do you have time to look at this?

Hey @sheepcat, sorry for the lack of movement here. Is the workaround you provided, something that can be added to the code base, by chance?

The https://github.com/tinkerbell/charts repo can now be used to deploy the tinkerbell stack to kubernetes. The sandbox repo, https://github.com/tinkerbell/sandbox, will shortly be updated to integrate the chart repo as well.