Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update DHCP broadcast interface handling: #88

Merged

Conversation

jacobweinstock
Copy link
Member

@jacobweinstock jacobweinstock commented Mar 28, 2024

Description

Use 127.1.1.1/32 for the DHCP broadcast interface instead of the load balancer IP. Using the load balancer IP can cause instability with that address and routing to Kubernetes services. And as we only send broadcast packets from this interface the IP is needed but doesn't need to be in the subnet.

Make the DHCP broadcast interface name static. The dynamic number that was added to the name causes restarts on every Helm install/upgrade and is not needed.

Add ipvlan support for the DHCP broadcast interface. This allows deployment where creating and broadcasting a new Mac address can be prohibited or rejected. VMware for example by default sets forged transmits to reject and causes packets for the macvlan interface to be dropped.

Allow enabling/disabling of listening for DHCP broadcast traffic. In environments where a DHCP relay agent is employed, it can be useful to not listen for broadcast traffic at all.

Why is this needed

Fixes: #

How Has This Been Tested?

How are existing users impacted? What migration steps/scripts do we need?

Checklist:

I have:

  • updated the documentation and/or roadmap (if required)
  • added unit or e2e tests
  • provided instructions on how to upgrade

@jacobweinstock jacobweinstock requested review from chrisdoherty4 and removed request for chrisdoherty4 March 28, 2024 14:35
@jacobweinstock jacobweinstock added the do-not-merge Mergify: Block Merging label Mar 28, 2024
Use 127.1.1.1/32 for the DHCP broadcast interface
instead of the load balancer IP. Using the load balancer
IP can cause instability with that address and routing
to Kubernetes services.

Make the DHCP broadcast interface name static. The dynamic
number added to the name Helm to restarts on every Helm deploy.

Add ipvlan support for the DHCP broadcast interface. This allows
deployment where creating and broadcasting a new mac address is
prohibited. Vmware for example.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock force-pushed the update-dhcp-broadcast-interface branch from a00845f to 4128489 Compare March 28, 2024 15:44
fail Helm if an invalid mode is specified.

Co-authored-by: Chris Doherty <[email protected]>
@jacobweinstock jacobweinstock removed the do-not-merge Mergify: Block Merging label Mar 28, 2024
Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock force-pushed the update-dhcp-broadcast-interface branch from 177d0d4 to 0af9007 Compare March 28, 2024 22:12
In environments where a DHCP relay agent is
employed it can be useful to not listen for
broadcast traffic at all.

Signed-off-by: Jacob Weinstock <[email protected]>
listenBroadcastTraffic: true
# interfaceMode determines how we create the interface needed to listen for DHCP broadcast traffic.
# by default macvlan is used. ipvlan is the only other option.
# interfaceMode: ipvlan
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Static defaults should generally reside in the values.yaml so consumers don't need to hunt through template code to find it.

In an actual chart, all static default values should live in the values.yaml, and should not be repeated using the default command (otherwise they would be redundant). However, the default command is perfect for computed values, which cannot be declared inside values.yaml

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice. Didn't know this. Thanks for sharing. I'll update.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

Helm recommends setting the default value
in the values.yaml.

Signed-off-by: Jacob Weinstock <[email protected]>
@jacobweinstock jacobweinstock force-pushed the update-dhcp-broadcast-interface branch from 8ead223 to aa9ae1c Compare March 30, 2024 21:46
@jacobweinstock
Copy link
Member Author

Hey @chrisdoherty4, I think this is ready now. Please and thank you!

Copy link
Member

@chrisdoherty4 chrisdoherty4 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Just a clarification: the 127.1.1.1 is acceptable because the return address is irrelevant in a broadcast? Relays aren't affected because the relay would unicast to the VIP?

@jacobweinstock
Copy link
Member Author

LGTM. Just a clarification: the 127.1.1.1 is acceptable because the return address is irrelevant in a broadcast? Relays aren't affected because the relay would unicast to the VIP?

Correct, the "reply" for DHCP local broadcast traffic is not based on source IP and is just another local broadcast.

Correct again, relays work in unicast.

@jacobweinstock jacobweinstock added the ready-to-merge Mergify: Ready for Merging label Apr 1, 2024
@mergify mergify bot merged commit 64c4157 into tinkerbell:main Apr 1, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready-to-merge Mergify: Ready for Merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants