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 the kube-scheduler binary's description of the --config parameter… #98254

Merged

Conversation

changshuchao
Copy link
Contributor

@changshuchao changshuchao commented Jan 21, 2021

… is inaccurate

Signed-off-by: changshuchao chang.shuchao1@zte.com.cn

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #
#98211
Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. 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 Jan 21, 2021
@k8s-ci-robot
Copy link
Contributor

@changshuchao: This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a 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.

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

Hi @changshuchao. 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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 21, 2021
@k8s-ci-robot k8s-ci-robot added sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. and removed do-not-merge/needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jan 21, 2021
@changshuchao
Copy link
Contributor Author

/assign @damemi

@changshuchao
Copy link
Contributor Author

@damemi sorry, I accidentally closed the previous pr, please review the new modification.

@alculquicondor
Copy link
Member

/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 Jan 21, 2021
fs.StringVar(&o.ConfigFile, "config", o.ConfigFile, `The path to the configuration file. The affected parameters are as follows.
The following flags can overwrite fields in this file:
--algorithm-provider
--policy-config-file
Copy link
Member

Choose a reason for hiding this comment

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

IRRC policy flags cause an error when used with config

Copy link
Contributor

Choose a reason for hiding this comment

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

I enabled policy-config to be set with componentconfig (to ease the deprecation transition) in #92531

--policy-configmap
--policy-configmap-namespace
--use-legacy-policy-config
The following flags will be not effective when set --config , we must move into this file:
Copy link
Member

Choose a reason for hiding this comment

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

TMI. Instead, we can put a note in each of the flags description

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, I missed this line from my first comment. Agree this is not necessary

Copy link
Contributor

@damemi damemi left a comment

Choose a reason for hiding this comment

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

/ok-to-test
@changshuchao I am still not clear on the intent of this change, see my question in the original PR (#98211 (review))

This might be a misinterpretation though. You said:

when the --config parameter is set, the following parameters are invalid in the command line...

But the flag description says

The following flags can overwrite fields in this file..

This means that for example, passing --kubeconfig with --config should work (with --kubeconfig overwriting the value in the --config file). But --use-legacy-policy-config should not work, because it shouldn't overwrite any values

Is it the case that these flags don't work when passing --config or that they do work?

Do these additional fields actually overwrite values in the config file? If so, that is a bigger bug than just updating the description (they should not work at all when a config file is passed)
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 21, 2021
@changshuchao
Copy link
Contributor Author

@damemi Sorry,my previous description is not very accurate.
After my test, when the --config parameter is set, the following command line parameters will be not effected in the command line,it means that no matter what value you set the parameter, it will only use the default value or not take effect. (For example --profiling, its default value is true, if you set --profiling to false while setting the --config parameter, the last effective value is still true),the parameters that are not effective like this parameter are as follows:
--scheduler-name
--hard-pod-affinity-symmetric-weight
--address
--port
--leader-elect
--leader-elect-lease-duration
--leader-elect-renew-deadline
--leader-elect-retry-period
--leader-elect-resource-lock
--leader-elect-resource-name
--leader-elect-resource-namespace
--profiling
--contention-profiling
--kubeconfig
--kube-api-content-type
--kube-api-qps
--kube-api-burst
--lock-object-namespace
--lock-object-name

@changshuchao changshuchao force-pushed the scheduler-config-help-line branch from 721b029 to b7df393 Compare January 22, 2021 06:34
Copy link
Contributor

@damemi damemi left a comment

Choose a reason for hiding this comment

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

@changshuchao no problem, it was my confusion from the original description :)

however I have one more comment, I think what we should do is:

  1. list the flags that will work with --config in the config flag description
  2. for the flags that don't work, add the comment to those separate flag's description (which you did here)

@@ -150,13 +150,26 @@ func newDefaultComponentConfig() (*kubeschedulerconfig.KubeSchedulerConfiguratio
// Flags returns flags for a specific scheduler by section name
func (o *Options) Flags() (nfs cliflag.NamedFlagSets) {
fs := nfs.FlagSet("misc")
fs.StringVar(&o.ConfigFile, "config", o.ConfigFile, `The path to the configuration file. The following flags can overwrite fields in this file:
fs.StringVar(&o.ConfigFile, "config", o.ConfigFile, `The path to the configuration file. The following flags will be not effective when set --config , we must move into this file:
Copy link
Contributor

Choose a reason for hiding this comment

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

I think @alculquicondor's intent was to keep the original (shorter) list of flags that do work with --config, and only note in the description of those that don't work.

This change doesn't provide any info to the user about what they can set with the config flag, and having the list of ones that don't work is redundant with having that info added to the flag description, as you have done

Copy link
Member

Choose a reason for hiding this comment

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

+1

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, your suggestion is really pertinent. We need to care about the parameters that are in effect, and remind users to pay attention to those that are not. : )

Copy link
Contributor Author

@changshuchao changshuchao Jan 23, 2021

Choose a reason for hiding this comment

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

  1. The command line parameters that do work when --config is set, need to remove --port and --address. The code before modification is as follows( in cmd/kube-scheduler/app/options/options.go):
    fs.StringVar(&o.ConfigFile, "config", o.ConfigFile, `The path to the configuration file. The following flags can overwrite fields in this file:
    --address
    --port
    --use-legacy-policy-config
    --policy-configmap
    --policy-config-file
    --algorithm-provider`)

2.According to your suggestion--'only note in the description of those that don't work',I can note most of the parameters, but some parameters for leader elect cannot be done, Because the code is in the component-base dependency package(vendor/k8s.io/component-base/config/options/leaderelectionconfig.go),as follows:
--leader-elect
--leader-elect-lease-duration
--leader-elect-renew-deadline
--leader-elect-retry-period
--leader-elect-resource-lock
--leader-elect-resource-name
--leader-elect-resource-namespace
For this reason, I keep the following notes:
https://github.com/kubernetes/kubernetes/blob/078cfa486e0b9390eb8e96d29076bc9a7fee7370/cmd/kube-scheduler/app/options/options.go#L158-L177

Copy link
Contributor

Choose a reason for hiding this comment

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

@changshuchao I see, then in my opinion it makes sense to note here which flags will not be effective for the flags which we import from other packages (and therefore can't update the description of).

Are all of the flags you listed in your comment imported? some like scheduler-name we should have the ability to update the description right? Though, it may be less confusing to have all of the affected flags in one spot. In other words, as a user I would expect this list to be complete if it's here at all.

So, since we don't have control over every flag's description that isn't effective with the config file I think it does make sense to list them all here. Sorry to flip flop on that, I wasn't originally thinking about the ones we can't update the description for (@alculquicondor may have missed that too, do you agree Aldo?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@damemi
'Are all of the flags you listed in your comment imported?' --Yes,i think it's all included.
'some like scheduler-name we should have the ability to update the description right? ' --Yes, I have modified everything that can be modified.

@changshuchao changshuchao force-pushed the scheduler-config-help-line branch from b7df393 to 078cfa4 Compare January 23, 2021 09:25
@damemi
Copy link
Contributor

damemi commented Jan 28, 2021

At this point this lgtm. I originally agreed that we should keep the list of affected flags short in --config's description, but after it was pointed out that some of them are imported it makes sense to have a complete list in one spot. The deprecation notices on the individual flags we do control are good too.

/approve
/hold cancel

I'll leave lgtm to Aldo if there's anything else :)

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jan 28, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: changshuchao, damemi

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

… is inaccurate

Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>
Copy link
Member

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 29, 2021
@changshuchao
Copy link
Contributor Author

@alculquicondor Sorry, can this pr be merged?

@damemi
Copy link
Contributor

damemi commented Feb 1, 2021

@changshuchao the release-note block in your main comment needs a description, since this is a user-facing change

@changshuchao
Copy link
Contributor Author

changshuchao commented Feb 2, 2021

@damemi I'm sorry, I didn't understand what you mean, can you give me more detailed instructions?

@damemi
Copy link
Contributor

damemi commented Feb 2, 2021

@damemi I'm sorry, I didn't understand what you mean, can you give me more detailed instructions?

@changshuchao this has the do-not-merge/release-note-label-needed flag, which means in your main PR description you need to update the "User facing change?" section to include a note in the release-note code block (this is a user facing change). For example:

Screen Shot 2021-02-02 at 8 57 03 AM

For non-user-facing changes, you need to write NONE in that block

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 3, 2021
@changshuchao
Copy link
Contributor Author

@damemi Sorry, I am ignorant. I just added some descriptions in release-note block. Is it OK to write like this? : )

@k8s-ci-robot k8s-ci-robot merged commit 356ee4c into kubernetes:master Feb 3, 2021
@k8s-ci-robot k8s-ci-robot added this to the v1.21 milestone Feb 3, 2021
@changshuchao changshuchao deleted the scheduler-config-help-line branch February 3, 2021 06:02
@damemi
Copy link
Contributor

damemi commented Feb 3, 2021

@changshuchao not to worry, the release-note block is a bit unclear for many people :)

@alculquicondor
Copy link
Member

Should we cherrypick to 1.20 or earlier?

@alculquicondor
Copy link
Member

FYI, this release note is too detailed. You could say something like:

Fix the description of command line flags that can override --config

You can still change the release note, I think. They are all put together when the release happens.

@changshuchao
Copy link
Contributor Author

@alculquicondor I have modified it, thanks for the guidance.

@alculquicondor
Copy link
Member

@changshuchao
Copy link
Contributor Author

changshuchao commented Feb 5, 2021

@alculquicondor ok,i will give a try :) #98786

changshuchao added a commit to changshuchao/kubernetes that referenced this pull request Feb 5, 2021
…iption of the --config parameter is inaccurate

Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>
changshuchao added a commit to changshuchao/kubernetes that referenced this pull request Feb 8, 2021
…ry's description of the --config parameter is inaccurate

Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>
changshuchao added a commit to changshuchao/kubernetes that referenced this pull request Feb 8, 2021
…ry's description of the --config parameter is inaccurate

Signed-off-by: changshuchao <chang.shuchao1@zte.com.cn>
k8s-ci-robot added a commit that referenced this pull request Feb 12, 2021
…1-19

Cherry pick of #98254 for 1.19: Fix the kube-scheduler binary's descr…
k8s-ci-robot added a commit that referenced this pull request Feb 12, 2021
Cherry pick of #98254:Fix the kube-scheduler binary's description of …
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Mar 29, 2021
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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. needs-triage Indicates an issue or PR lacks a `triage/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-none Denotes a PR that doesn't merit a release note. sig/scheduling Categorizes an issue or PR as relevant to SIG Scheduling. 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.

4 participants