Closed parth-gr closed 1 week ago
cc @gnufied
@Madhu-1 @gnufied we need to use the klog.InitFlags(nil)
with the main function to bring back the klog flags,
But the problem is klog and k8s.io/component-base/logs has a common defined flag v
, so if we try to initialize both the libraries flag at the same time, We get error from Go,
Existing -v flag found, removing it.
/csi-resizer flag redefined: v
panic: /csi-resizer flag redefined: v
And according to mine findings we cannot re-define any flag, so any suggestion for this.
And the last way is to revert the k8s.io/component-base/logs
https://github.com/kubernetes-csi/external-resizer/pull/330 and just use the klogs
cc @saku3 any suggestions?
Or we should ask here to support editing of flag values https://github.com/golang/go/blob/master/src/flag/flag.go#L1010
The flags of klog are being deprecated as per accepted KEP - https://github.com/kubernetes/enhancements/tree/master/keps/sig-instrumentation/2845-deprecate-klog-specific-flags-in-k8s-components
What is the use case ? Why you want to log to a file? cc @pohly
What is the use case ? Why you want to log to a file?
@gnufied we need to persist the log for the pod containers, and also support log rotation specific to the pod, so for that we need to create a log file, which is govern by klog.
@gnufied all other sidecars have klog and only it's not present in the resizer, For now sidecars are not consistent with this functionality, if we are moving away from klog
Based on these the users can plan accordingly
Are we planning to update all the sidecars to move away from klog, If yes, when it is planned?
Technically, we are not moving away from klog, but we are are going to be adopting https://github.com/kubernetes/enhancements/issues/2845. So I suspect - -log_file
option is going away from other sidecars too, sooner or later. So it might be better to design around non-availability of that option.
The Kubernetes project currently lacks enough contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle stale
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues.
This bot triages un-triaged issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/remove-lifecycle rotten
/close
Please send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle rotten
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.
This bot triages issues according to the following rules:
lifecycle/stale
is appliedlifecycle/stale
was applied, lifecycle/rotten
is appliedlifecycle/rotten
was applied, the issue is closedYou can:
/reopen
/remove-lifecycle rotten
Please send feedback to sig-contributor-experience at kubernetes/community.
/close not-planned
@k8s-triage-robot: Closing this issue, marking it as "Not Planned".
External-resizer uses the klog for it's logging mechanism. Klog provides various methods to be used, including logging into the file by setting the flag,
flag.Set("log_file", "var/a5.log")
.But using the flag looks like it throughs error,
PS: Using it with ceph-csi pod container, https://github.com/rook/rook/pull/14305
I suspect it is because
klog.InitFlags(nil)
andklog.Flush()
isn't called, but there can be some other bug too at the same time