You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This completes the deprecation of klog flags which are no longer supported.
klog itself continues to support them, but Kubernetes components don't. This
makes the command line interfaces simpler and reduces the attack surface
because less functionality is exposed.
For example, kube-controller-manager now has:
Logs flags:
--log-flush-frequency duration
Maximum number of seconds between log flushes (default 5s)
--log-json-info-buffer-size quantity
[Alpha] In JSON format with split output streams, the info messages can be buffered for a while to increase performance. The default value of zero
bytes disables buffering. The size can be specified as number of bytes (512), multiples of 1000 (1K), multiples of 1024 (2Ki), or powers of those (3M,
4G, 5Mi, 6Gi). Enable the LoggingAlphaOptions feature gate to use this.
--log-json-split-stream
[Alpha] In JSON format, write error messages to stderr and info messages to stdout. The default is to write a single stream to stdout. Enable the
LoggingAlphaOptions feature gate to use this.
--logging-format string
Sets the log format. Permitted formats: "json" (gated by LoggingBetaOptions), "text". (default "text")
-v, --v Level
number for the log level verbosity
--vmodule pattern=N,...
comma-separated list of pattern=N settings for file-filtered logging (only works for text log format)
Misc flags:
--kubeconfig string
Path to kubeconfig file with authorization and master location information.
--master string
The address of the Kubernetes API server (overrides any value in kubeconfig).
Global flags:
-h, --help
help for kube-controller-manager
--version version[=true]
Print version information and quit
For details see
https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components
fs.StringVar(&c.Format, "logging-format", c.Format, fmt.Sprintf("Sets the log format. Permitted formats: %s.\nNon-default formats don't honor these flags: %s.\nNon-default choices are currently alpha and subject to change without warning.", formats, unsupportedFlags))
Copy file name to clipboardExpand all lines: staging/src/k8s.io/component-base/logs/logs.go
+11-37
Original file line number
Diff line number
Diff line change
@@ -27,16 +27,11 @@ import (
27
27
28
28
"github.com/spf13/pflag"
29
29
logsapi "k8s.io/component-base/logs/api/v1"
30
+
"k8s.io/component-base/logs/klogflags"
30
31
"k8s.io/klog/v2"
31
32
)
32
33
33
-
constdeprecated="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"
34
-
35
-
// TODO (https://github.com/kubernetes/kubernetes/issues/105310): once klog
36
-
// flags are removed, stop warning about "Non-default formats don't honor these
37
-
// flags" in config.go and instead add this remark here.
38
-
//
39
-
// const vmoduleUsage = " (only works for the default text log format)"
34
+
constvmoduleUsage=" (only works for the default text log format)"
0 commit comments