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
deprecate klog flags #105042
deprecate klog flags #105042
Conversation
pflag.CommandLine = flags | ||
|
||
kubeConfigFlags := genericclioptions.NewConfigFlags(true).WithDeprecatedPasswordFlag() | ||
kubeConfigFlags.AddFlags(flags) | ||
logs.AddFlags(flags) |
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.
Note that this adds --log-flush-frequency
to the command line flags. Previously, that flag got lost when overwriting pflag.CommandLine
.
However, the flag is not working properly yet because its value gets used in logs.InitLogs
before parsing command line flags. This may be a common problem. Needs more thought on how to avoid this.
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 fixed the problem with --log-flush-frequency
not having an effect in #105076 and in this PR avoided adding it to kubectl-convert.
a38533a
to
200d572
Compare
/assign @logicalhan Thank you! /triage accepted |
/hold #105076 should be merged first, then I'll rebase. In the meantime I am looking forward to comments whether the revised kubelet command line looks okay:
|
200d572
to
277367e
Compare
@pohly: The following test failed, say
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. |
Upstream klog continues to support all of its flags, but in Kubernetes only some will be supported going format (-v, -vmodule). With this change, the kubelet flags now look like this: $ go run ./cmd/kubelet --help | grep -e --log-dir -e '--v ' -e --vmodule -e --logging-format --log-dir string If non-empty, write log files in this directory (DEPRECATED: will be removed in a future release, see https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components) --logging-format string Sets the log format. Permitted formats: "json", "text". Non-default formats don't honor these flags: --add_dir_header, --alsologtostderr, --log_backtrace_at, --log_dir, --log_file, --log_file_max_size, --logtostderr, --one_output, --skip_headers, --skip_log_headers, --stderrthreshold, --vmodule, --log-flush-frequency, --add_dir_header, --alsologtostderr, --log_backtrace_at, --log_dir, --log_file, --log_file_max_size, --logtostderr, --one_output, --skip_headers, --skip_log_headers, --stderrthreshold, --vmodule. -v, --v Level number for the log level verbosity --vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
14982ca
to
27d6ce4
Compare
/assign @serathius |
/retest |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pohly, serathius 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 |
/hold cancel |
What type of PR is this?
/kind cleanup
What this PR does / why we need it:
As discussed in "Deprecate klog specific flags in Kubernetes Compnents", several of the currently available klog flags will eventually get removed from Kubernetes components.
A first step towards that is to make all components use
k8s.io/component-base/logs
consistently and in that package handle the klog flags so that they are added with a deprecation remark. That is part of #105076 which needs to be merged first.Special notes for your reviewer:
Ref: kubernetes/enhancements#2845
Does this PR introduce a user-facing change?
Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.: