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

Avoid discarding klog logs at the highest log level #4960

Open
dmarkhas opened this issue Dec 18, 2024 · 0 comments · May be fixed by #4961
Open

Avoid discarding klog logs at the highest log level #4960

dmarkhas opened this issue Dec 18, 2024 · 0 comments · May be fixed by #4961
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@dmarkhas
Copy link

What would you like to be added:

Currently, external-dns completely discards all klog logs emitted by the underlying client-go, regardless of the desired log level.
This behavior was added here, as these logs were deemed noisy and unnecessary.

We would like to be able to avoid discarding these logs, if not by default then at least when using the highest log level.

Why is this needed:

The client-go logs are necessary to understand why certain failures occur, for example failures to authenticate to the API server.

Without klog logs there's no way for the user to understand what's going on:

{"level":"info","msg":"running in dry-run mode. No changes to DNS records will be made.","time":"2024-12-18T09:34:30+02:00"}
{"level":"info","msg":"Instantiating new Kubernetes client","time":"2024-12-18T09:34:30+02:00"}
{"level":"debug","msg":"apiServerURL: ","time":"2024-12-18T09:34:30+02:00"}
{"level":"debug","msg":"kubeConfig: /Users/danmarkhasin/.kube/config","time":"2024-12-18T09:34:30+02:00"}
{"level":"info","msg":"Using kubeConfig","time":"2024-12-18T09:34:30+02:00"}
{"level":"info","msg":"Created Kubernetes client https://xxxxx.gr7.eu-west-1.eks.amazonaws.com","time":"2024-12-18T09:34:30+02:00"}
{"level":"fatal","msg":"failed to sync *v1.Endpoints: context deadline exceeded","time":"2024-12-18T09:35:30+02:00"}

Process finished with the exit code 1

With klog logs:

{"level":"info","msg":"running in dry-run mode. No changes to DNS records will be made.","time":"2024-12-18T09:42:29+02:00"}
W1218 09:42:30.568675   56293 reflector.go:569] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: failed to list *v1.Node: Unauthorized
W1218 09:42:30.568748   56293 reflector.go:569] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: failed to list *v1.Service: Unauthorized
E1218 09:42:30.568775   56293 reflector.go:166] "Unhandled Error" err="pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: Failed to watch *v1.Node: failed to list *v1.Node: Unauthorized" logger="UnhandledError"
E1218 09:42:30.568807   56293 reflector.go:166] "Unhandled Error" err="pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: Failed to watch *v1.Service: failed to list *v1.Service: Unauthorized" logger="UnhandledError"
W1218 09:42:30.568809   56293 reflector.go:569] pkg/mod/k8s.io/[email protected]/tools/cache/reflector.go:251: failed to list *v1.Pod: Unauthorized
@dmarkhas dmarkhas added the kind/feature Categorizes issue or PR as related to a new feature. label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant