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

Fix flag documentation kube-controller-manager and cloud-provider #126784

Merged
merged 1 commit into from
Sep 2, 2024

Conversation

eminwux
Copy link
Contributor

@eminwux eminwux commented Aug 19, 2024

What type of PR is this?

/kind documentation

What this PR does / why we need it:

This PR solved issue #119066

Currently, the documentation of the following kube-controller-flags flags are ambiguos:

--allocate-node-cidrs Should CIDRs for Pods be allocated and set on the cloud provider.
--cluster-cidr CIDR Range for Pods in cluster. Requires --allocate-node-cidrs to be true
--service-cluster-ip-range CIDR Range for Services in cluster. Requires --allocate-node-cidrs to be true

Both restrictions on --cluster-cidr and --service-cluster-ip-range regarding --allocate-node-cidrs=true are incorrect since it is possible to run kube-controller-manager with those flags together with --allocate-node-cidrs=false.

Basically, --allocate-node-cidrs=true activates the controller nodeipam for which --cluster-cidr and --service-cluster-ip-range are mandatory. However, if --allocate-node-cidrs=false , flags --cluster-cidr and --service-cluster-ip-range are ignored

Thus, the documentation of these flags is corrected to the following:

--allocate-node-cidrs Should CIDRs for Pods be allocated and set on the cloud provider. Requires --cluster-cidr.
--cluster-cidr CIDR Range for Pods in cluster. Only used when --allocate-node-cidrs=true; if false, this option will be ignored.
--service-cluster-ip-range CIDR Range for Services in cluster. Only used when --allocate-node-cidrs=true; if false, this option will be ignored.

Which issue(s) this PR fixes:

Fixes #119066

Special notes for your reviewer:

Does this PR introduce a user-facing change?

Clarified the kube-controller-manager documentation for --allocate-node-cidrs, --cluster-cidr, and --service-cluster-ip-range flags to accurately reflect their dependencies and usage conditions.

…idr in cloud-provider and --service-cluster-ip-range in 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 19, 2024
@k8s-ci-robot
Copy link
Contributor

Welcome @eminwux!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Aug 19, 2024
@k8s-ci-robot
Copy link
Contributor

Hi @eminwux. 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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Aug 19, 2024
@eminwux
Copy link
Contributor Author

eminwux commented Aug 19, 2024

/sig docs

@k8s-ci-robot k8s-ci-robot added sig/docs Categorizes an issue or PR as relevant to SIG Docs. area/cloudprovider sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Aug 19, 2024
@fedebongio
Copy link
Contributor

/assign @seans3
/triage accepted

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Aug 22, 2024
@seans3
Copy link
Contributor

seans3 commented Aug 30, 2024

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 30, 2024
@seans3
Copy link
Contributor

seans3 commented Aug 30, 2024

/retest

@seans3
Copy link
Contributor

seans3 commented Aug 30, 2024

/assign @aojea

@aojea
Copy link
Member

aojea commented Sep 2, 2024

yes, if allocate-node-cidrs is false the nodeipam controller skips running, it does not keep validating the flags

func startNodeIpamController(ctx context.Context, controllerContext ControllerContext) (controller.Interface, bool, error) {
var serviceCIDR *net.IPNet
var secondaryServiceCIDR *net.IPNet
// should we start nodeIPAM
if !controllerContext.ComponentConfig.KubeCloudShared.AllocateNodeCIDRs {
return nil, false, nil
}

func startNodeIpamController(ctx context.Context, initContext app.ControllerInitContext, ccmConfig *cloudcontrollerconfig.CompletedConfig, nodeIPAMConfig nodeipamconfig.NodeIPAMControllerConfiguration, controllerCtx genericcontrollermanager.ControllerContext, cloud cloudprovider.Interface) (controller.Interface, bool, error) {
var serviceCIDR *net.IPNet
var secondaryServiceCIDR *net.IPNet
// should we start nodeIPAM
if !ccmConfig.ComponentConfig.KubeCloudShared.AllocateNodeCIDRs {
return nil, false, nil
}

/lgtm
/approve

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

LGTM label has been added.

Git tree hash: e93f90c1c95fe467288eae8518bf8a37ca3ee1bd

@aojea
Copy link
Member

aojea commented Sep 2, 2024

/assign @dims @thockin @cheftako

for someone with approvals in these folderss

@dims
Copy link
Member

dims commented Sep 2, 2024

/approve
/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aojea, dims, eminwux

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 Sep 2, 2024
@eminwux
Copy link
Contributor Author

eminwux commented Sep 2, 2024

/retest

@k8s-ci-robot k8s-ci-robot merged commit e5e1b31 into kubernetes:master Sep 2, 2024
14 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.32 milestone Sep 2, 2024
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/cloudprovider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/documentation Categorizes issue or PR as related to documentation. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. sig/cloud-provider Categorizes an issue or PR as relevant to SIG Cloud Provider. sig/docs Categorizes an issue or PR as relevant to SIG Docs. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
8 participants