Skip to content
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

Support overriding the --node-cidr-mask-size arg passed to kube-controller-manager #61705

Conversation

jstangroome
Copy link
Contributor

@jstangroome jstangroome commented Mar 26, 2018

Fixes: kubernetes/kubeadm#724

Release note:

kubeadm config can now override the Node CIDR Mask Size passed to kube-controller-manager.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 26, 2018
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 26, 2018
@jstangroome
Copy link
Contributor Author

/assign @krousey

Copy link
Contributor

@jamiehannaford jamiehannaford left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can't we already do this with ControllerManagerExtraArgs?

@@ -336,7 +336,10 @@ func getControllerManagerCommand(cfg *kubeadmapi.MasterConfiguration, k8sVersion
// Let the controller-manager allocate Node CIDRs for the Pod network.
// Each node will get a subspace of the address CIDR provided with --pod-network-cidr.
if cfg.Networking.PodSubnet != "" {
maskSize := calcNodeCidrSize(cfg.Networking.PodSubnet)
maskSize := cfg.Networking.NodeCIDRMaskSize
if maskSize == "" {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering if setting default should go here https://github.com/jstangroome/kubernetes/blob/438818f22932c08b86ebaa7de5c7c5db9d6d7d7c/cmd/kubeadm/app/util/config/masterconfig.go#L38

since that's where we do this sort of thing

Copy link
Member

@fabriziopandini fabriziopandini left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jstangroome thanks for your PR!

I fully agree that we extraArgs should override default arguments.

However I think that the solution you are proposing fixes this problem only for the mask size.

What do you think about a slightly different solution that before builds all the default arguments and only at the end of the function builds the command merging extraArgs (in other words, what about moving https://github.com/jstangroome/kubernetes/blob/438818f22932c08b86ebaa7de5c7c5db9d6d7d7c/cmd/kubeadm/app/phases/controlplane/manifests.go#L324 and L235 at the end of the function)?

@jstangroome
Copy link
Contributor Author

@fabriziopandini Good idea. I'll try moving lines 324 and 325 to the end of the function and see how that falls out.

@jstangroome jstangroome force-pushed the jstangroome-kubeadm-nodecidrmasksize branch from 438818f to 6fbf2da Compare March 29, 2018 05:43
@jstangroome
Copy link
Contributor Author

@fabriziopandini PR updated to use your suggested approach.

@fabriziopandini
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 30, 2018
@fabriziopandini
Copy link
Member

/lgtm
/CC @timothysc for approval
@jstangroome thanks! It would be great if you send twin PR for fixing the same problem on other components installed by kubeadm :😉

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 30, 2018
@k8s-ci-robot
Copy link
Contributor

@fabriziopandini: GitHub didn't allow me to request PR reviews from the following users: for, approval.

Note that only kubernetes members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

/lgtm
/CC @timothysc for approval
@jstangroome thanks! It would be great if you send twin PR for fixing the same problem on other components installed by kubeadm :😉

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.

@jstangroome
Copy link
Contributor Author

@fabriziopandini I'll look into what would be involved to fix the extra args handling for the other components installed by kubeadm.

Also, I'm not sure I understand how the GitHub Test failures correlate to my code changes. Any suggestions on how to investigate this?

@fabriziopandini
Copy link
Member

/test pull-kubernetes-e2e-gce

Copy link
Member

@timothysc timothysc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fabriziopandini, jstangroome, 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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 4, 2018
@k8s-github-robot
Copy link

/test all [submit-queue is verifying that this PR is safe to merge]

@fabriziopandini
Copy link
Member

fabriziopandini commented Apr 4, 2018

/retest

@k8s-ci-robot
Copy link
Contributor

k8s-ci-robot commented Apr 4, 2018

@jstangroome: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce 6fbf2da link /test pull-kubernetes-e2e-gce

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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.

@k8s-github-robot
Copy link

Automatic merge from submit-queue (batch tested with PRs 61705, 61609, 62103, 62113, 62115). If you want to cherry-pick this change to another branch, please follow the instructions here.

@k8s-github-robot k8s-github-robot merged commit fca2bd2 into kubernetes:master Apr 4, 2018
@jstangroome jstangroome deleted the jstangroome-kubeadm-nodecidrmasksize branch April 4, 2018 21:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/kubeadm cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants