How to access Logs of Pods in Kubernetes after its deletion

9/30/2018

We have CentOS based infra for kubernetes and also using Openshift on top of tis. We have terminated a pod and now its not visible on master controller any more. However we are willing to analyze its logs.Can we still access its logs?How ?

-- knowdotnet
kubectl
kubernetes

3 Answers

10/1/2018

If you have access to the Kubernetes Dashboard, you can access logs for deleted/completed pods in the desired namespace.

--
Source: StackOverflow

10/1/2018

Looks like the container is removed (docker rm) once the kubectl delete of the pod is done and the log files are gone. One way I can think of is using fluentd or something similar for log aggregation.

-- Praveen Sripati
Source: StackOverflow

10/1/2018

Containers together with its logs get deleted when you issue a kubectl delete pod <pod-name>. You can use something like Fluentd or logspout to pipe your logs to say an ELK or an EFK stack.

-- Rico
Source: StackOverflow