# Programatically get all the containers from EKS cluster

**URL:** <https://discuss.kubernetes.io/t/programatically-get-all-the-containers-from-eks-cluster/26849>\
**Category:** General Discussions\
**Tags:** development, security\
**Created:** [January 25, 2024, 3:21pm UTC](https://discuss.kubernetes.io/t/programatically-get-all-the-containers-from-eks-cluster/26849 "2024-01-25T15:21:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Karthikeyan\_Subraman](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/karthikeyan_subraman/32/14130_2.png) [@Karthikeyan\_Subraman](https://discuss.kubernetes.io/u/Karthikeyan_Subraman)\
**Post date:** [January 25, 2024, 3:21pm UTC](https://discuss.kubernetes.io/t/programatically-get-all-the-containers-from-eks-cluster/26849/1 "2024-01-25T15:21:03Z")

</div>

Asking for help? Comment out what you need so we can get more information to help you!

### Cluster information:

Kubernetes version: 1.25  
Cloud being used: AWS (EKS)  
Host OS: RHEL 9

I am getting all the pods and containers information for a given cluster using /api/v1/pods k8s api. But this api does not tell me how long pod or containers in that pod have been running. Is there any way to get this information using any of the kubernetes api? This information is necessary for my application.

Any help in this regard is highly appreciated!

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

---

<div class="post-metadata">

**Author:** ![fox-md](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/fox-md/32/10613_2.png) [@fox-md](https://discuss.kubernetes.io/u/fox-md)\
**Post date:** [January 25, 2024, 4:20pm UTC](https://discuss.kubernetes.io/t/programatically-get-all-the-containers-from-eks-cluster/26849/2 "2024-01-25T16:20:16Z")

</div>

Hi,  
Each running pod has `.status.containerStatuses[*].state.running.startedAt` field that I assume is what you are looking for.
