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

[kubelet] help to describe the schema for config options #84949

Open
drnic opened this issue Nov 7, 2019 · 4 comments

Comments

@drnic
Copy link

@drnic drnic commented Nov 7, 2019

What would you like to be added:

Currently kubelet -h includes 150 flags, of which 80+ flags that are "DEPRECATED: This parameter should be set via the config file specified by the Kubelet's --config flag."

But it does not indicate what the YAML/JSON path is for that same config value in the KubeletConfiguration file.

The URL that it provides for more information https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ also does not provide a mapping of flags to paths within the config file.

Nor does the formal type declaration provide a mapping https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/kubelet/config/v1beta1/types.go

I would like to start updating the 80+ deprecated-to-config-file flags with their mapping, so that ppl who run kubelet -h can more easily migrate from flags to config files.

Why is this needed:

We are telling ppl to stop using flags and migrate to config files, but we don't make it as easy as it could be. I'd like to document this for users within the kubelet -h help.

Proposed text:

Before I submit an initial PR for some flags to kick things off, I'll propose the new text for agreement:

Currently a deprecated-to-config-file flag looks like:

$ kubelet -h
 --pod-manifest-path string    Path to the directory containing static pod files to run, or the path to a single static pod file. Files starting with dots will be ignored. (DEPRECATED: This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.)

I propose we change this to:

$ kubelet -h
 --pod-manifest-path string    Path to the directory containing static pod files to run, or the path to a single static pod file. Files starting with dots will be ignored. (Set via .staticPodPath in --config file.) (DEPRECATED: This parameter should be set via the config file specified by the Kubelet's --config flag. See https://kubernetes.io/docs/tasks/administer-cluster/kubelet-config-file/ for more information.)

The "(DEPRECATED: ...)" message is automatically suffixed to the 80 flags and is not easily modified. Instead the suggested text above could be implemented by adding "(Set via .X.Y.Z ... in --config file.)" to each flag's own description:

fs.StringVar(&c.StaticPodPath, "pod-manifest-path", c.StaticPodPath, "Path to the directory containing static pod files to run, or the path to a single static pod file. Files starting with dots will be ignored. (Set via .staticPodPath in --config file.)")

/sig cli

@drnic drnic added the kind/feature label Nov 7, 2019
drnic added a commit to drnic/kubernetes that referenced this issue Nov 7, 2019
@k8s-ci-robot k8s-ci-robot added sig/cli and removed needs-sig labels Nov 8, 2019
@zouyee

This comment has been minimized.

Copy link
Member

@zouyee zouyee commented Nov 8, 2019

/sig node
/area kubelet
/remove-sig cli

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Nov 8, 2019

@zouyee: The label(s) sig/kubelet cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

/sig kubelet
/remove-sig cli

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

This comment has been minimized.

Copy link
Contributor

@k8s-ci-robot k8s-ci-robot commented Nov 8, 2019

@zouyee: Those labels are not set on the issue: sig/cli

In response to this:

/sig node
/area kubelet
/remove-sig cli

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 area/kubelet and removed needs-sig labels Nov 8, 2019
@liggitt

This comment has been minimized.

Copy link
Member

@liggitt liggitt commented Nov 8, 2019

There can be multiple versions of the config file (current version is v1beta1, v1 can restructure options if required). I think it would make more sense to have example config files that output commented versions of every possible field, along with their API doc, and the CLI flag they correspond to in a comment, than to try to put the config file structure in the flag help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.