-
Notifications
You must be signed in to change notification settings - Fork 40.2k
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: Group centric component configs #85639
Conversation
kubeadm's current implementation of component config support is "kind" centric. This has its downsides. Namely: - Kind names and numbers can change between config versions. Newer kinds can be ignored. Therefore, detection of a version change is considerably harder. - A component config can have only one kind that is managed by kubeadm. Thus a more appropriate way to identify component configs is required. Probably the best solution identified so far is a config group. A group name is unlikely to change between versions, while the kind names and structure can. Tracking component configs by group name allows us to: - Spot more easily config version changes and manage alternate versions. - Support more than one kind in a config group/version. - Abstract component configs by hiding their exact structure. Hence, this change rips off the old kind based support for component configs and replaces it with a group name based one. This also has the following extra benefits: - More tests were added. - kubeadm now errors out if an unsupported version of a known component group is used. Signed-off-by: Rostislav M. Georgiev <rostislavg@vmware.com>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: 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 |
/hold |
groups = append(groups, group) | ||
} | ||
sort.Strings(groups) // The sort is needed to make the output predictable | ||
klog.Warningf("WARNING: kubeadm cannot validate component configs for API groups %v", groups) |
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 we saw this warning being printed in a lot of commands such as kubeadm config images
.
should we change it to klog.V(...).Infof()?
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 guess so. The code is executed whenever the config is loaded (which happens in almost all kubeadm commands). However it's good to see it as a warning only on kubeadm init/upgrade *
.
i'm +1 on this refactor. thanks @rosti i envision the following split in the future:
|
Exactly, that's my vision too. |
On a first sight this SGTM. I plan to review this more thoroughly later today though. |
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, is a big chunk to review, but I'm +1 overall. A small comment for a tiny improvement.
|
||
// FromCluster loads a component from a config map in the cluster | ||
func (h *handler) FromCluster(clientset clientset.Interface, clusterCfg *kubeadmapi.ClusterConfiguration) (kubeadmapi.ComponentConfig, error) { | ||
return h.fromCluster(h, clientset, clusterCfg) |
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.
Can't we make fromCluster
a handler
method as well, so there's no need to pass h
as argument?
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 see why you did this on the non-public one... nevermind.
/lgtm |
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
/hold cancel |
What type of PR is this?
/kind design
What this PR does / why we need it:
kubeadm's current implementation of component config support is "kind" centric.
This has its downsides. Namely:
Newer kinds can be ignored. Therefore, detection of a version change is
considerably harder.
Thus a more appropriate way to identify component configs is required.
Probably the best solution identified so far is a config group.
A group name is unlikely to change between versions, while the kind names and
structure can.
Tracking component configs by group name allows us to:
Hence, this change rips off the old kind based support for component configs
and replaces it with a group name based one. This also has the following
extra benefits:
is used.
Which issue(s) this PR fixes:
Refs:
Special notes for your reviewer:
This PR is part of the implementation of the new kubeadm component config management scheme KEP (see link below).
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/area kubeadm
/priority important-soon
/assign @timothysc @fabriziopandini @neolit123 @ereslibre
Does this PR introduce a user-facing change?:
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: