<p>I am currently using Kubernetes Python SDK to fetch relevant information from my k8s cluster. I am running this from outside the cluster.</p>

<p>I have a requirement of fetching the images of all the POD's running within a namespace. I did look at Docker python SDK but that requires me to be running the script on the cluster itself which i want to avoid.</p>

<p>Is there a way to get this done ?</p>

<p>TIA</p>

Rakshith Venkatesh
<blockquote>
  <p>that requires me to be running the script on the cluster itself</p>
</blockquote>

<p>No, it should not: the <a href="https://github.com/kubernetes-client/python" rel="nofollow noreferrer">kubernetes-client python</a> performs operations similar to <strong><a href="https://kubernetes.io/docs/reference/kubectl/overview/" rel="nofollow noreferrer"><code>kubectl</code></a></strong> calls (as <a href="https://github.com/kubernetes-client/python/blob/e057f273069de445a2d5a250ac5fe37d79671f3b/examples/notebooks/intro_notebook.ipynb" rel="nofollow noreferrer">detailed here</a>).<br>
And <code>kubectl</code> calls can be done from any client with a properly set <code>.kube/config</code> file.</p>

<p>Once you get the image name from a <code>kubectl describe po/mypod</code>, you might need to docker pull that image locally if you want more (like a docker history).</p>

<p>The <a href="https://stackoverflow.com/users/3219658/raks">OP Raks</a> adds <a href="https://stackoverflow.com/questions/52685119/fetching-docker-image-information-using-python-sdk/52686099?noredirect=1#comment92326426_52686099">in the comments</a>:</p>

<blockquote>
  <p>I wanted to know if there is a python client API that actually gives me an option to do docker pull/save/load of an image as such</p>
</blockquote>

<p>The <a href="https://docker-py.readthedocs.io/en/stable/images.html" rel="nofollow noreferrer"><strong>docker-py</strong></a> library can pull/load/save images.</p>
