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
[baremetal] Add dispatcher script to statically configure DHCP address #2188
[baremetal] Add dispatcher script to statically configure DHCP address #2188
Conversation
/hold This is a PoC. If we decide to pursue this it will almost certainly need some refinement. |
#!/bin/bash | ||
set -ex | ||
|
||
if [ ${DHCP4_DHCP_LEASE_TIME:-0} -lt 4294967295 ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this not exist in IPv6?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I only implemented ipv4 in this version. Based on my discussion with the NM team, I would probably argue that for this use case in ipv6 we should just use SLAAC addressing. If there's a reason we can't do that then we can always add support for DHCPv6 here too.
templates/common/baremetal/files/NetworkManager-static-dhcp.yaml
Outdated
Show resolved
Hide resolved
9f7811e
to
e1eb368
Compare
e1eb368
to
bb77aab
Compare
/hold cancel I've tested this locally with infinite DHCP leases and it worked fine. |
/retest |
This is essentially an ipv6 version of openshift#2188. Co-authored-by: Antoni Segura Puimedon <antoni@redhat.com>
/hold We discovered that this would cause problems on reboot. Fix coming. |
8c8441f
to
c8ed64a
Compare
This is essentially an ipv6 version of openshift#2188. Co-authored-by: Antoni Segura Puimedon <antoni@redhat.com>
a78db50
to
0551cd9
Compare
dceaf9f
to
e905d8c
Compare
Just tested it with a small modification on one of my masters with openshift-sdn. It worked well. Here some snippets:
After making these changes, that make sure that it works for openshift SDN and for OVN kubernetes, you can see in the following image that there is a reboot of master-0 (I also rebooted master-1) after I had killed the dnsmasq that provided DHCP functionality. |
We have a feature request for nodes to be able to initially get assigned their IP addresses via infinite DHCP leases, but then to have those addresses statically configured on the node so that if the DHCP server is unavailable for any reason they don't lose their network configuration. This adds a dispatcher script for NetworkManager that does so. It looks at the DHCP assigned network settings and adds static configuration with the same values.
e905d8c
to
ca1e125
Compare
/hold cancel I also had success rebooting nodes with the latest version of this. I think it's good to go. |
/lgtm The version in this PR now matches what I tested successfully in #2188 (comment) |
overall lgtm. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: celebdor, cybertron, sinnykumari The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/retest |
/retest |
We have a feature request for nodes to be able to initially get
assigned their IP addresses via infinite DHCP leases, but then to
have those addresses statically configured on the node so that if
the DHCP server is unavailable for any reason they don't lose their
network configuration.
This adds a dispatcher script for NetworkManager that does so. It
looks at the DHCP assigned network settings and adds static
configuration with the same values.
- What I did
- How to verify it
- Description for the changelog