-
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
Only parse ClusterCIDR, ServiceCIDR if AllocateNodeCIDRs #54934
Conversation
Hi @akosiaris. 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 I understand the commands that are listed here. 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. |
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 don't think this is a valid change, maybe I'm misunderstanding something.
AllocateNodeCIDRs is supposed to be used with cloud providers. It can be set to false when deploying a cluster on a fix set of nodes or on bare metal.
However, ServiceClusterCIDR serves a different purpose. It is basically a different pool of IP for services. Most of the time, it has to be set for kube-proxy to function properly.
That's exactly our case. Bare metal cloud. In our case AllocateNodeCIDRs is false (which is the default anyway) and we get on every kube-controller-manager startup the following
That's 1.7.4. In 1.8.0 that has been addressed via #48797. That being said given the code in https://github.com/kubernetes/kubernetes/blob/master/cmd/kube-controller-manager/app/core.go#L131 and https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/node/node_controller.go#L256, I 'd argue that if guarding ClusterCIDR with AllocateNodeCIDRs is technically correct. Feel free to overrule of course, and given it adds a tad more complexity, I am fine with amending my PR and removing those if guards.
As far as ServiceCIDR goes, I only added the if guard and most importantly the doc change due to https://github.com/kubernetes/kubernetes/blob/master/pkg/controller/node/node_controller.go#L340, which if guards the only instantiation I can find (correct me if I am wrong) of the IPAM controller, which from what I gather (and again correct as appropriate) is the only user of ServiceCIDR. I 'll admit I don't yet see how kube-proxy is related here, but I 've started getting some more familiarity with the code, so any pointers would be greatly appreciated. |
@akosiaris here is a starting point for clusterIP. It definitely should not be tied to --allocate-node-cidrs, and I believe it should be set to a default value if not specified. We only set that flag in apiserver, but not in controller-manager, and I don't see the error regarding service CIDR in our controller-manager log. I think your cluster might not be configured properly. |
@phsiao I am sorry, but I do not understand what does |
/assign @thockin |
/ok-to-test |
Fixed some of my silly mistakes, still looking into failing |
ClusterCIDR and ServiceCIDR are settings that are only used if at least AllocateNodeCIDRs is set. The route controller requires in addition to it for ConfigureCloudRoutes to be true as well. Since AllocateNodeCIDRs is by default false, if guard the parsing of these settings in order to not unnecessarily spam logs. Amend the documentation of kube-controller-manager for the 2 settings to point out the requirement of AllocateNodeCIDRs to be true as well
Fixed that as well, all tests now pass |
/approve no-issue |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: akosiaris, thockin Associated issue requirement bypassed by: thockin The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
Automatic merge from submit-queue (batch tested with PRs 54906, 54120, 54934, 54915, 54848). If you want to cherry-pick this change to another branch, please follow the instructions here. |
Thanks! |
What this PR does / why we need it:
Avoid unnecessary spam in kube-controller-manager log if --cluster-cidr is not specified and --allocate-node-cidrs is false. Add clarification in kube-controller-manager help about that.
Release note