-
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: Reduce the usage of InitConfiguration #72111
Conversation
/priority backlog |
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 @rosti
did a pass over the diff and the change LGTM.
/lgtm
/assign @fabriziopandini
for approve.
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 @rosti
/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.
@rosti 💯for this cleanup!
I have left some minor comments but this IMO can merge as soon as you remove WIP.
@@ -973,11 +973,11 @@ func RunJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.JoinConfigura | |||
} | |||
|
|||
// RunOptionalJoinNodeChecks executes all individual, applicable to node configuration dependant checks | |||
func RunOptionalJoinNodeChecks(execer utilsexec.Interface, initCfg *kubeadmapi.InitConfiguration, ignorePreflightErrors sets.String) error { | |||
func RunOptionalJoinNodeChecks(execer utilsexec.Interface, cfg *kubeadmapi.ClusterConfiguration, ignorePreflightErrors sets.String) error { |
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 changing ClusterConfiguration
to KubeProxy
configuration only?
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.
We have a couple of options for this one:
- Keep the func named
RunOptionalJoinNodeChecks
and useClusterConfiguration
. - Rename the func to
RunOptionalKubeProxyChecks
and passKubeProxy
configuration.
I don't think it's expected and acceptable for the func to be named RunOptionalJoinNodeChecks
and to accept KubeProxy
configuration directly. This is unexpected for the reader of the code and is bound to raise questions.
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.
we can keep this as is, as we might decide to add more checks in the function.
hopefully not, though.
One of the commits (a9fd78dc49a) can probably be moved into a separate PR. Though I am not sure about this and it probably belongs here. |
@rosti - please squash your commits. |
@timothysc will do it, but just before I pull together the final version of things. Waiting for @fabriziopandini to review it. |
@rosti green light for me! let's get this in as soon as possible |
[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 |
For historical reasons InitConfiguration is used almost everywhere in kubeadm as a carrier of various configuration components such as ClusterConfiguration, local API server endpoint, node registration settings, etc. Since v1alpha2, InitConfiguration is meant to be used solely as a way to supply the kubeadm init configuration from a config file. Its usage outside of this context is caused by technical dept, it's clunky and requires hacks to fetch a working InitConfiguration from the cluster (as it's not stored in the config map in its entirety). This change is a small step towards removing all unnecessary usages of InitConfiguration. It reduces its usage by replacing it in some places with some of the following: - ClusterConfiguration only. - APIEndpoint (as local API server endpoint). - NodeRegistrationOptions only. - Some combinations of the above types, or if single fields from them are used, only those field. Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
Commits squashed, WIP tag removed, this is finally ready. |
/lgtm |
/test pull-kubernetes-node-e2e |
/retest |
/test pull-kubernetes-node-e2e |
/hold cancel |
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
Back in the
v1alpha1
we had a single flatMasterConfiguration
and whenever some function needed something from it, it took a pointer toMasterConfiguration
argument. Inv1beta1
this configuration is no longer flat, but composite withInitConfiguration
bearing the closest resemblance to the oldMasterConfiguration
. Most of kubeadm still works withInitConfiguration
even though most functions need only a portion or even a single field from the config.This change strives to reduce the unnecessary usage of InitConfiguration. The approach taken here is to switch APIs, that take InitConfiguration to some other type of argument (usually ClusterConfiguration).
Which issue(s) this PR fixes:
Refs kubernetes/kubeadm#1084
Special notes for your reviewer:
This PR is marked as a WIP as I want some feedback on the scope of changes and weather it is too broad.
The commits aren't squashed yet, as it would be easier to drop something upon feedback if needed. Also, it might be a lot easier to review this on a per commit basis (rather than as a whole).
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/assign @fabriziopandini
/assign @timothysc
Does this PR introduce a user-facing change?: