-
Notifications
You must be signed in to change notification settings - Fork 1.4k
🌱 Add --etcd-client-log-level flag to KCP #12271
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
🌱 Add --etcd-client-log-level flag to KCP #12271
Conversation
/area provider/control-plane-kubeadm |
Wondering if kubernetes has a similar use case and how are they handling it (e.g. in the kube-apiserver) |
This is a very good point. It doesn't work in kube-apiserver at the moment, because community copied/pasted (https://github.com/kubernetes/kubernetes/blob/b35c5c0a301d326fdfa353943fca077778544ac6/staging/src/k8s.io/apiserver/pkg/storage/storagebackend/factory/etcd3.go#L97-L111) the I requested an export of this function in the PR etcd-io/etcd#20006. But as far as I understand, there are no plans to backport it to etcd 3.5. The only downside to this approach is that it won't work natively. We can have both approaches at the same time to get a universal solution. That is, set the logger via a function and change the logging level via ETCD_CLIENT_DEBUG variable. The only thing is that at the moment we will also have to copy/paste the function until the release of etcd 3.6 with this fix is released and we will not switch to it. I could create and track this issue. |
I was wondering if there is a way to "reuse" our regular log level for the etcd logger |
Seems to with some trick like that, it could be possible, but should be validated func (r *KubeadmControlPlaneReconciler) SetupWithManager(ctx context.Context, mgr ctrl.Manager, options controller.Options) error {
logger, _ := logutil.CreateDefaultZapLogger(zapcore.Level(ctrl.LoggerFrom(ctx).GetV()))
etcd.SetLogger(logger) But in this case, it would be nice to redefine log destination also in advance to log level. |
f287221
to
9bbad37
Compare
9bbad37
to
35ee04e
Compare
d82f0f3
to
2e898fa
Compare
/test pull-cluster-api-test-main |
/retest |
8734a21
to
a64e1a1
Compare
506814b
to
32a60a0
Compare
/test pull-cluster-api-test-main |
32a60a0
to
686878c
Compare
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.
Thx! last two minor findings
354b444
to
0c5afc7
Compare
Thx! /lgtm |
LGTM label has been added. Git tree hash: c40e44e7fbe2c9de639467e13dbc8a55d59729b8
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: sbueringer 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 |
/cherry-pick release-1.10 |
@dmvolod: new pull request created: #12463 In response to this:
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-sigs/prow repository. |
/cherry-pick release-1.9 |
@sbueringer: #12271 failed to apply on top of branch "release-1.9":
In response to this:
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-sigs/prow repository. |
What this PR does / why we need it:
For some reasons, we need to adjust ECTD client logger level to avoid have an unpredictable number of warnings in the log, like
But now, ETCD log level is hardcoded to the
zapcore.InfoLevel
. This PR allows to redefine it on init in the embedded controllers. If we need to redefine it globally with env variable or run option for any deployment, please let me know.Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #