From 7cc5e43bce7e244a917679ee1960e38994a914e6 Mon Sep 17 00:00:00 2001 From: Seena Fallah Date: Sun, 25 Feb 2024 15:10:16 +0100 Subject: [PATCH] stack: add dhcrelay giaddr control behaviour Introduce presentGIAddr to control the handling of incoming DHCPv4 packets which already contain relay agent options. Signed-off-by: Seena Fallah --- tinkerbell/stack/README.md | 1 + tinkerbell/stack/templates/nginx.yaml | 2 +- tinkerbell/stack/values.yaml | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/tinkerbell/stack/README.md b/tinkerbell/stack/README.md index 314b5a86..32334f3a 100644 --- a/tinkerbell/stack/README.md +++ b/tinkerbell/stack/README.md @@ -102,6 +102,7 @@ helm upgrade stack-release stack/ --namespace tink-system --wait | `stack.relay.image` | Image to use for the DHCP relay service | `ghcr.io/jacobweinstock/dhcrelay` | | `stack.relay.maxHopCount` | Maximum number of hops to allow for DHCP relay | `10` | | `stack.relay.sourceInterface` | Host/Node interface to use for listening for DHCP broadcast packets | `eno1` | +| `stack.relay.presentGiaddrAction` | Control the handling of incoming DHCPv4 packets which already contain relay agent options | `append` | ### Tinkerbell Services Parameters diff --git a/tinkerbell/stack/templates/nginx.yaml b/tinkerbell/stack/templates/nginx.yaml index 6c520c5f..6c0e8914 100644 --- a/tinkerbell/stack/templates/nginx.yaml +++ b/tinkerbell/stack/templates/nginx.yaml @@ -74,7 +74,7 @@ spec: {{- end }} - name: {{ .Values.stack.relay.name }} image: {{ .Values.stack.relay.image }} - args: ["-m", "append", "-c", "{{ .Values.stack.relay.maxHopCount }}", "-id", "{{ $macvlanInterfaceName }}", "-iu", "eth0", "-U", "eth0", "smee.{{ .Release.Namespace }}.svc.cluster.local."] + args: ["-m", "{{ .Values.stack.relay.presentGiaddrAction }}", "-c", "{{ .Values.stack.relay.maxHopCount }}", "-id", "{{ $macvlanInterfaceName }}", "-iu", "eth0", "-U", "eth0", "smee.{{ .Release.Namespace }}.svc.cluster.local."] ports: - containerPort: 67 protocol: UDP diff --git a/tinkerbell/stack/values.yaml b/tinkerbell/stack/values.yaml index 6eeb35b6..bdc567a8 100644 --- a/tinkerbell/stack/values.yaml +++ b/tinkerbell/stack/values.yaml @@ -38,6 +38,12 @@ stack: # don't respect signals properly when run as PID 1. image: ghcr.io/jacobweinstock/dhcprelay # dhcprelay is a multiarch-enabled version of dhcrelay maxHopCount: 10 + # The presentGiaddrAction pertains to the course of action when the giaddr field appears in the DHCP packet. + # In situations where another DHCP relay agent is already in operation within the environment, + # maintaining option (82) in its received state from the dhcrelay might be essential. + # This behavior can be regulated by configuring the presentGiaddrAction as "forward." + # Additional information is available at: https://linux.die.net/man/8/dhcrelay + presentGiaddrAction: append # sourceInterface is the Host/Node interface to use for listening for DHCP broadcast packets. # When unset, the interface from the default route will be used. # sourceInterface: eno1