Mark
Mark

Reputation: 5632

How can I tail an arbitrary file using kubectl?

Is it possible to tail an arbitrary file from a Kubernetes pod using kubectl? kubectl cp doesn't appear to support this. And I don't want to tail all the logs, which I know I could do with kubectl logs -f.

Upvotes: 1

Views: 877

Answers (1)

Rory Browne
Rory Browne

Reputation: 687

Perhaps with kubectl exec.

Untested, and I haven't done a lot with k8s but:

kubectl exec -i podname -- tail -f filename

Might work.

Upvotes: 4

Related Questions