-
Notifications
You must be signed in to change notification settings - Fork 40k
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 config add support for more than one APIEndpoint #67832
kubeadm config add support for more than one APIEndpoint #67832
Conversation
/hold |
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.
This doesn't look right.
Also perhaps I'm missing the [] or map
// API server will be installed only on nodes hosting an additional control plane instance. | ||
AdvertiseAddress string | ||
// APIEndpoint represents the endpoint of the instance of the API server eventually to be deployed on this node. | ||
APIEndpoint APIEndpoint |
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 Naming is confusing here.
The APIEndpoint struct has an APIEndpoint member.
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.
@timothysc Sorry but I don't understand you comment 😕
APIEndpoint struct has two attributes, AdvertiseAddress and BindPort:
Here we have an attribute that has the same name of its type. is that the thing you find confusing? Do you prefer naming the struct APIEndpointConfiguration
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.
Sorry, the way github collapsed this changeset made me misinterpret this. I expanded it looks ok.
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.
Or... are you looking for the "status" we discussed at the end of the call yesterday?
If this is the case, please consider that this PR implements only the "spec", while the status will be implemented the next PR (in the form of map[bindaddress]APIEndoint
, but I'm figuring out details right now)
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.
map[bindaddress]APIEndoint
i though more about this. we ideally need to map against the address the user provides instead of always defaulting to the address of the network interface, because we do have --apiserver-advertise-address
.
if i understand this correctly this might result in an interesting situation, but i guess we can comment more in the next PR. :\
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 a lot @fabriziopandini
added some small comments LGTM!
}, | ||
APIEndpoint: kubeadmapiv1alpha3.APIEndpoint{ | ||
// GetAPIServerAltNames errors without an AdvertiseAddress; this is as good as any. | ||
AdvertiseAddress: "127.0.0.1", |
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.
@kad ^ FYI
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 in such scenarios where we don't have good IP address, it is better to skip it in cert generation phase, but having default to localhost doesn't really make sense, as it leads to non-functional control plane.
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.
@kad @neolit123 this PR doesn't implemented/changed this bit, only refactored the API struct.
If something should be fixed, this should be address in a separated PR (this one is already XXL 😉)
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.
yeah, i'm just pointing it out because we had a discussion about 127.0.0.1 earlier.
if err := SetBootstrapTokensDynamicDefaults(&cfg.BootstrapTokens); err != nil { | ||
return err | ||
} | ||
|
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.
just a nit: some of these empty new lines in the function can be removed.
please, live as is for now if you'd prefer.
// Default all the embedded ComponentConfig structs | ||
componentconfigs.Known.Default(cfg) | ||
|
||
ip := net.ParseIP(advertiseAddress) |
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.
this will probably conflict with:
#67397
either this or that PR will need a rebase.
6a3109f
to
1b90e44
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.
looking good, but I think some the meta-data in your structs needs cleanup, otherwise LGTM. Please clean that up and we're good to go.
/approve
@@ -285,6 +285,10 @@ type JoinConfiguration struct { | |||
// API server will be installed only on nodes hosting an additional control plane instance. | |||
AdvertiseAddress string `json:"advertiseAddress,omitempty"` | |||
|
|||
// BindPort sets the secure port for the API Server to bind to. | |||
// Defaults to 6443. | |||
BindPort int32 `json:"bindPort"` |
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.
Shouldn't this be omitempty, b/c previous versions of v1alpha2 didn't have this field.
|
||
// APIEndpoints currently available in the cluster, one for each control plane/api server instance. | ||
// The key of the map is the IP of the host's default interface | ||
APIEndpoints map[string]APIEndpoint `json:"featureGates,` |
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.
This doesn't appear correct json:"featureGates,
1b90e44
to
0add7f9
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.
Looks OK to me. A few places were converted back to InitConfiguration (from ClusterConfiguration), but I assume, that this way the change is narrower and PR is much more easy to review.
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
/approve
Thx @fabriziopandini
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: fabriziopandini, 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 |
/test all [submit-queue is verifying that this PR is safe to merge] |
Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
This PR completes the changes in kubeadm for management of more than one control plane instances introducing the possibility to configure more than one APIEndpoints
Which issue(s) this PR fixes :
refs kubernetes/kubeadm#911, refs kubernetes/kubeadm#963
Special notes for your reviewer:
Depends on:
Release note:
/cc @kubernetes/sig-cluster-lifecycle-pr-reviews
/sig cluster-lifecycle
/area kubeadm
/kind api-change
/kind enhancement
/assign @luxas
/assign @timothysc
/cc @chuckha @rosti @neolit123 @liztio