-
Notifications
You must be signed in to change notification settings - Fork 39.8k
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
Allow configurable etcd options #42246
Allow configurable etcd options #42246
Conversation
Hi @jamiehannaford. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
The overall solution to this problem I think is to create a NodePort etcd service (either manually or automatically with kubeadm) and have the binary bind to |
@kubernetes/sig-cluster-lifecycle-pr-reviews @luxas @lukemarsden |
@pires @kubernetes/sig-cluster-lifecycle-pr-reviews @luxas @lukemarsden I know kubeadm is in code freeze due to moving over codebases - should I wait until that's happened or is there anything I can incorporate now? |
@jamiehannaford Kubernetes as a project is in code freeze right now and no non-bugfix PRs can be merged at this point in the cycle. Hence the pending state... kubeadm will eventually move to its own repo, but that will take some time yet before our machinery is able to do that. |
@luxas I know but some of my other PRs have been reviewed but not merged. Maybe it will save time when the code freeze is lifted. I'd just like a general idea of whether this feature is approved/needed and if any of the implementation logic is off :) |
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.
Overall this LGTM. I just don't like the flags.
cmd/kubeadm/app/cmd/init.go
Outdated
cmd.PersistentFlags().StringVar( | ||
&cfg.Etcd.AdvertiseURL, "etcd-advertise-url", cfg.Etcd.AdvertiseURL, | ||
"Specify a advertise-client-urls value to the etcd container", | ||
) | ||
|
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.
Use configuration, not flags.
ced7fa6
to
f3c3232
Compare
@pires Does this look okay now? I removed the flags |
cmd/kubeadm/app/master/manifests.go
Outdated
if cfg.Etcd.AdvertiseURL != "" { | ||
advertiseURL += fmt.Sprintf(",%s", cfg.Etcd.AdvertiseURL) | ||
} | ||
|
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.
listenURL
and advertiseURL
should point to a same constant value.
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 wasn't 100% sure what you meant, but I added a new default variable which both URLs point to. That DRYed it up a bit. Is that what you meant?
f3c3232
to
9f13b38
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.
/lgtm
Ah, yes, the API changes break stuff. Please, check the test failure details and fix it. |
9f13b38
to
3df45d0
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.
There's nothing wrong with this PR per se, but I really think that if we do this, it should be generic from the get go.
Please align the logic here with what we have for all the other control plane components
CAFile string | ||
CertFile string | ||
KeyFile string | ||
ListenURL string |
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 really should go with a generic Args here instead of two hard-coded string fields.
Imagine I want to set the token authz mechanism. Eventually we would duplicate all etcd options, instead we should go with a more dynamic route with map[string]string
as the other control plane components
cmd/kubeadm/app/master/manifests.go
Outdated
func getEtcdCommand(cfg *kubeadmapi.MasterConfiguration) []string { | ||
defaultURL := "http://127.0.0.1:2379" | ||
|
||
listenURL := defaultURL |
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.
Please use the same logic as the other control plane components here with default and overridable arguments.
3df45d0
to
e5f9345
Compare
@k8s-bot bazel test this |
@jamiehannaford: you can't request testing unless you are a kubernetes member. In response to this comment:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
@luxas Thanks for the feedback, I've made things a bit more generic so folks can easily extend. Would you mind kicking off the tests again? |
@k8s-bot bazel test this |
@luxas Agree about the dataDir stuff. I've added a new config key and removed the hard-coded references. Can you comment with |
@k8s-bot ok to test |
8140f56
to
91e41e6
Compare
@k8s-bot non-cri e2e test this |
1 similar comment
@k8s-bot non-cri e2e test this |
Looks like this is all green now |
/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, only one nit.
Thanks for doing this!
cmd/kubeadm/app/apis/kubeadm/env.go
Outdated
@@ -31,7 +33,7 @@ func SetEnvParams() *EnvParams { | |||
|
|||
envParams := map[string]string{ | |||
"kubernetes_dir": "/etc/kubernetes", | |||
"host_etcd_path": "/var/lib/etcd", | |||
"host_etcd_path": v1alpha1.DefaultEtcdDataDir, |
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 for being unclear earlier, I don't think this is used anymore (if it is, switch to the new method)
It could/should be removed
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.
No problem, I appreciate the feedback 👍 does this commit address what you mean? 4b065f8
@k8s-bot non-cri e2e test this |
/lgtm |
@jamiehannaford LGTM, but please squash (unless you really think the commit sequence makes a lot of sense) |
4b065f8
to
7e82985
Compare
@luxas Sure - I squashed those commits into 1 |
Any update on this? |
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.
Hi, thanks for bearing with us. I've been away last week, digging myself up now from all the emails.
Thanks for the ping!
LGTM
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jamiehannaford, luxas, pires
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
@k8s-bot gce etcd3 e2e test this |
Automatic merge from submit-queue |
What this PR does / why we need it:
Allows users to set the
--listen-client-urls
and--advertise-client-urls
flags on etcd binaries for clusters set up with kubeadm.Which issue this PR fixes:
As far as I can tell right now, other nodes in a cluster set up with kubeadm cannot communicate with the etcd static pod running on the master. This is needed in order to set up calico/canal SDN which needs access to a publicly addressable IPv4 before the overlay network and inter-cluster subnet is created.
Addresses kubernetes/enhancements#138 and kubernetes/enhancements#11.
Release note: