# How get all the containers of a pod

**URL:** <https://forum.ansible.com/t/how-get-all-the-containers-of-a-pod/34826>\
**Category:** Ansible Developer\
**Tags:** kubernetes\
**Created:** [March 22, 2021, 11:14am UTC](https://forum.ansible.com/t/how-get-all-the-containers-of-a-pod/34826 "2021-03-22T11:14:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![George\_Tsoumplekas](https://avatars.discourse-cdn.com/v4/letter/g/9e8a1a/32.png) [@George\_Tsoumplekas](https://forum.ansible.com/u/George_Tsoumplekas)\
**Post date:** [March 22, 2021, 11:14am UTC](https://forum.ansible.com/t/how-get-all-the-containers-of-a-pod/34826/1 "2021-03-22T11:14:01Z")

</div>

try to get all the containers that are included in a pod using ansible… I have no experience in ansible and kubernetes. It is the first I have worked with ansible and kubernetes

I use an iteration through the pods to get name’s of the containers that are include in a pod. I face two problems . The first is that when the script is called , I get an error that _ **item is undefined** _ . The second one is how I will get containers name, image version?

Below is the script
