Anyone figured out how to get logs from pods via the API

I can’t seem to find this in the API. I want to get things like container exit codes and container stdout thru the API… preferably by pod id or name.

Thanks for any help,

Logs come straight from the kubernetes API, there is no wrapper around that specific call in the rancher API. If you open up the browser Dev tools -> network tab and then view lots in the UI you can see the call that is made.

You could make a call for the logs via the old api. Is there no way to do this in the new API?
https://(URL)/clusters/c-n822f/api/v1/namespaces/(namespace)/pods/{}/log

All of the k8s API is available, and as I’ve already said is the only way to do this. There is no Rancher-specific wrapper around logs in 2.x.

1 Like

Sorry, it was me having a long Monday. You are correct, using the k8s api i was able to pull and view the logs thank you.