I need to do an audit of our AWS-managed kubernetes cluster (EKS). Specifically, I want to generate a list of all pods that were in a state of Running at some point.
Is there any functionality in kubectl that will get this information for me?
The cluster has been running for about 10 weeks.
Please execute:
$ kubectl get pods --all-namespaces | grep Running
This command will show you not only all pods in Running state but also namespaces where this pod have been deployed.
More information you can find here: kubectl-cheatsheet.
Please let me know if it helps.
I found a complete history in AWS CloudWatch logs. You simply need to enable "Audit" logging in the "Logging" section of the EKS console.
See https://docs.aws.amazon.com/eks/latest/userguide/control-plane-logs.html for more info
I don't think you can get it from the pod itself, but you can do:
kubectl get events | grep Started