Skip to content

Where does kubectl logs -f collect logs from? #1733

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

Closed
khteh opened this issue Apr 5, 2025 · 6 comments
Closed

Where does kubectl logs -f collect logs from? #1733

khteh opened this issue Apr 5, 2025 · 6 comments
Labels
kind/support Categorizes issue or PR as a support question. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@khteh
Copy link

khteh commented Apr 5, 2025

My application uses EFK stack which uses emptyDir for log files. Is this mutually exclusive with kubectl logs -f? I don't see any log at all using this command now. Where does kubectl logs -f collect logs from? I don't find this information in https://kubernetes.io/docs/reference/kubectl/generated/kubectl_logs/

@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

SIG CLI takes a lead on issue triage for this repo, but any Kubernetes member can accept issues by applying the triage/accepted label.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Apr 5, 2025
@xyz-li
Copy link

xyz-li commented Apr 7, 2025

kubectl connects to kube-apiserver and kube-apiserver forwards the request to the kubelet. kubelet reads logs from dir /var/log/pods/.

https://github.com/kubernetes/kubernetes/blob/195803cde570ad1025a78e36cdbef76bddbc4c33/pkg/kubelet/apis/config/types.go#L81-L95

@khteh
Copy link
Author

khteh commented Apr 8, 2025

How to tail/show application's log on both console and files?

@Suknna
Copy link

Suknna commented Apr 18, 2025

如何在控制台和文件上跟踪/显示应用程序的日志?

Using a Sidecar to Read Log Files from EmptyDirt Storage

@mpuckett159
Copy link
Contributor

/kind support
/close
Hi, I am going to close this ticket for now, if you need further support please feel free to re-open it.

@k8s-ci-robot k8s-ci-robot added the kind/support Categorizes issue or PR as a support question. label Apr 23, 2025
@k8s-ci-robot
Copy link
Contributor

@mpuckett159: Closing this issue.

In response to this:

/kind support
/close
Hi, I am going to close this ticket for now, if you need further support please feel free to re-open it.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/support Categorizes issue or PR as a support question. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

5 participants