-
Notifications
You must be signed in to change notification settings - Fork 38.7k
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
Kubeadm: allow users to use 127.0.0.1 as advertise address #83475
Kubeadm: allow users to use 127.0.0.1 as advertise address #83475
Conversation
// kubeadm allows users to specify address=Loopback as a selector for global unicast IP address that can be found on loopback interface. | ||
// e.g. This is required for network setups where default routes are present, but network interfaces use only link-local addresses (e.g. as described in RFC5549). | ||
if addressIP.IsLoopback() { | ||
loopbackIP, err := netutil.ChooseBindAddressForInterface("lo") |
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.
seems like 'lo' would be a constant in the util library, otherwise lgtm
/approve
/assign @liggitt
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.
Done!
This PR requires making a utility function public, and I don't see why not. |
aa22d31
to
fd2c678
Compare
i haven't tested loopback setups at all. /assign @bowei |
/approve This looks much safer than #69578 to me, thanks for the rework. /hold |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, liggitt, timothysc 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 |
/assign @johnbelamaric |
RFC5549 is about MP-BGP "Advertising IPv4 Network Layer Reachability Information with an IPv6 Next Hop". Is that really the RFC you meant? I am confused a little as to the use case. Can you provide more description? |
@johnbelamaric ... It is.. It's a leaf and spine deployment where IPv4 addresses are proxied through localhost. This is not uncommon for some on-prem environments and the patch has been tested. The ask for review is really about exposing the function Publicly. |
@timothysc ok, yes, I don't see any issue there. lgtm |
Thanks @johnbelamaric ! |
/lgtm |
just double checking, sorry if this is so obvious was already discussed.
you configure a global address in a loopback interface and is the one that you distribute via routing. I don't have clear if this PR enable the use of 127.0.0.1 in this case or the use of 1.1.1.1 in my example. The correct behavior should be checking the loopback interface and see if there is a global address there. |
That's exactly what this PR does and it then uses that address as the advertise address of the API-server. |
thanks for clarifying, the title confused me ... had bad experiences with similar configs in the past 😓 |
One thing that bothers me in this PR (and I mentioned that to @fabriziopandini in Slack) is the missing verification of ipv4/v6 between /cc @scheuk if he can verify that this solves his original problem. |
@kad sorry this PR merged before having the chance to address your comment. I will contact you to better understand your concern and understand how it can be addressed. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
There are network setups where default routes are present, but network interfaces use only link-local addresses (e.g. as described in RFC5549); It is likely that matching global unicast IP address for this family of default route can be found on loopback interface.
This PR add support for kubeadm for the above scenario
Which issue(s) this PR fixes:
Special notes for your reviewer:
This is a rework of #69578, but with this PR we are not altering any existing defaulting rule.
Instead, the user has to explicitly opt-in in this scenario by specifying 127.0.0.1 and kubeadm will try to resolve this to a global unicast IP.
Does this PR introduce a user-facing change?:
/area kubeadm
/sig cluster-lifecycle
/priority critical-urgent
/cc @kad