How to send the logs from kubernetes pod to host pc

6/8/2021

I use k9s to access the bash from the pod where I keep the logs of my project.

Reading the logs with a cat is annoying, so I want to send them to my pc.

img

How can I do this?

-- Luis Fernandez
kubernetes
logging

1 Answer

6/8/2021

You can use kubectl cp command.

kubectl cp default/<some-pod>:/logs/app.log app.log

-- efdestegul
Source: StackOverflow