-
Notifications
You must be signed in to change notification settings - Fork 40.6k
kubeadm: Remove multiple API server endpoints support upon join #69812
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
Conversation
5407c34
to
0bc6bd1
Compare
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.
thanks, added a couple of minor comments.
DiscoveryTimeout *metav1.Duration | ||
|
||
// Discovery specifies the options for the kubelet to use during the TLS Bootstrap process | ||
Discovery Discovery |
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.
hm, some of the fields in the types structs have empty lines separating them.
the rest don't have them.
@fabriziopandini @rosti what coding convention should we end up doing here?
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.
@neolit123 it appears, that up until now, the empty line is used to distinguish between different groups of fields in a single structure. Like the ones, who are dependent in one-another.
With the redesign of config, most of the related fields were moved into substructs and therefore single fields, unrelated to others have become more common. Hence most of the field structures have empty lines between them.
cmd/kubeadm/app/cmd/join.go
Outdated
func AddJoinBootstrapTokenDiscoveryFlags(flagSet *flag.FlagSet, btd *kubeadmapiv1beta1.BootstrapTokenDiscovery) { | ||
flagSet.StringVar( | ||
&btd.Token, "discovery-token", "", | ||
"A token used to validate cluster information fetched from the api server.") |
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.
maybe take the opportunity to api
-> API
here?
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.
Fixed in #67763
cmd/kubeadm/app/cmd/join.go
Outdated
func AddJoinFileDiscoveryFlags(flagSet *flag.FlagSet, fd *kubeadmapiv1beta1.FileDiscovery) { | ||
flagSet.StringVar( | ||
&fd.KubeConfigPath, "discovery-file", "", | ||
"A file or url from which to load cluster information.") |
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.
url
-> URL
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.
Fixed in #67763
Waiting on #67763 to merge. /hold |
0bc6bd1
to
6871f76
Compare
This is now ready for final review. /hold cancel |
/test pull-kubernetes-e2e-kops-aws |
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.
/lgtm
thanks for the update.
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.
@rosti many thanks for this PR!
only one minor nit and then ready to lgtm
cmd/kubeadm/app/cmd/join.go
Outdated
@@ -177,7 +177,7 @@ func NewCmdJoin(out io.Writer) *cobra.Command { | |||
cfg.Discovery.File = fd | |||
} else { | |||
cfg.Discovery.BootstrapToken = btd | |||
cfg.Discovery.BootstrapToken.APIServerEndpoints = args | |||
cfg.Discovery.BootstrapToken.APIServerEndpoint = args[0] |
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.
What about adding a check that args has one element?
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.
The checks need to be active if --config
is not used though. In the --config
case this code is redundant and warning or error messages by the checks will be misleading.
6871f76
to
0907edd
Compare
@fabriziopandini updated with your feedback, also added another check in the conversion code to avoid possible panic. |
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.
/approve
IMO this PR is now ready to merge. Please rebase to get the test passing
/assign @timothysc
0907edd
to
3e2ce98
Compare
err := fmt.Errorf("abort connecting to API servers after timeout of %v", discoveryTimeout) | ||
fmt.Printf("[discovery] %v\n", err) | ||
wg.Wait() | ||
<-finishedChan |
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 think the wait/waitgroup is a lot cleaner here imo.
The double use of the channel for both the case statement and within the case is an anti-pattern.
3e2ce98
to
76ad45f
Compare
In the past the discovery configuration expected, that we can support multiple API server endpoints. In practice, we always end up with a single API server endpoint, because, even in HA setups, we use a load balancer scheme for API servers. Therefore, to reduce complexity and improve readability of the config, the multiple API server endpoints support is removed from the bootstrap token discovery join method and configuration. Signed-off-by: Rostislav M. Georgiev <[email protected]>
76ad45f
to
a3e7d7e
Compare
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.
@rosti Thanks for this PR!
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, rosti 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 |
What this PR does / why we need it:
In the past the discovery configuration expected, that we can support multiple API server endpoints. In practice, we always end up with a single API server endpoint, because, even in HA setups, we use a load balancer scheme for API servers.
Therefore, to reduce complexity and improve readability of the config, the multiple API server endpoints support is removed from the bootstrap token discovery join method and configuration.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):refs kubernetes/kubeadm#911
Special notes for your reviewer:
Depends on:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/kind api-change
/kind cleanup
/assign @luxas
/assign @timothysc
/assign @fabriziopandini
Release note: