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: Refactor the .Etcd substruct in the v1alpha2 API #64066
kubeadm: Refactor the .Etcd substruct in the v1alpha2 API #64066
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: luxas 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 |
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 old configurations for Etcd
are replaced by Etcd.Local
and Etcd.External
respectively. The is a big change, but makes the configurations more concise.
Better add a notice somewhere to warn the users, since this new change will block in-place updates with old config file.
aac8aae
to
213f8f0
Compare
@timothysc this is ready to merge.
@dixudx we support full backwards-compability. All existing users will be upgraded to the new config automatically, thanks to the automatic API machinery conversations from |
/retest |
/test pull-kubernetes-e2e-kops-aws |
/assign @detiber @stealthybox They are the last two to update this area, they should have a say. |
allErrs = append(allErrs, ValidateCertSANs(e.Local.PeerCertSANs, localPath.Child("peerCertSANs"))...) | ||
} | ||
if e.External != nil { | ||
allowHTTP := false |
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 that requireHTTPS
is more clear (the logic should be changed accordingly)
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 you/I please follow-up on that?
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.
Might be a new issue help/wanted for new contributors 😉
@@ -51,8 +51,7 @@ func CreatePKIAssets(cfg *kubeadmapi.MasterConfiguration) error { | |||
CreateAPIServerEtcdClientCertAndKeyFiles, | |||
} | |||
|
|||
// Currently this is the only way we have to identify static pod etcd vs external etcd | |||
if len(cfg.Etcd.Endpoints) == 0 { | |||
if cfg.Etcd.Local != nil || cfg.Etcd.External == nil { |
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.
|| cfg.Etcd.External == nil
seems not necessary
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.
There is an edge case here actually when we don't know which one of the structs are defined or the other undefined (in unit tests), so hence I added this. It doesn't hurt I guess...?
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.
Ok. If possible this should be annotated in comments because this is the only place where this is required
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.
Okay, now I changed the unit tests instead, so now it works as you wanted it 👍
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.
+💯 for cleaning up the etcd configuration
Only two minor comments from my side
@luxas should we bump the api version for the featureGates struct and regenerate the config conversions before we merge this so that we have an independent patch for fixing the previous config issue we introduced with v1.10.0 ? |
I've worked a lot the latest week on building on top of @liztio's initial great patch for that in order to make this all work flawlessly. See the earlier PRs linked in kubernetes/community#2131 Basically what happens can be read in https://github.com/kubernetes/kubernetes/blob/master/cmd/kubeadm/app/util/config/masterconfig.go#L109-L160. Does that answer your question? |
6adb790
to
0038aba
Compare
/test pull-kubernetes-bazel-test @luxas that does answer my question -- I'm glad the serialization issues are remedied. |
0038aba
to
2d0efea
Compare
/retest |
Automatic merge from submit-queue (batch tested with PRs 64127, 63895, 64066, 64215, 64202). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Splits the monolithic
.Etcd
struct with all the options as fields to a more modular and clear design with two sub-structs for the different modes of hosting etcd we support.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Part of kubernetes/community#2131
Special notes for your reviewer:
Depends on:
Follows up: #63871
TODO: I still need to write unit tests for this.
Release note:
@kubernetes/sig-cluster-lifecycle-pr-reviews @liztio