Schedule a FREE onboarding and start making pipelines fast.

Three ways to identify which images are running in a Kubernetes cluster

Kubernetes Tutorial | December 29, 2017

There are three ways to get information about the images running in Kubernetes.

Using Kubectl

The easiest way to find out which image is running is to parse the Kubernetes json api. This command will show you every image running in a cluster. To narrow it down to a namespace just change --all-namespaces  to --namespace=mynamespace

Here’s the command

This will parse the json using some regex. It’s not particularly useful, especially if you have lots of images!

Using the Kubernetes UI

Fire up  kubectl proxy and look under workloads. You’ll see something like this:

One of the limitations here is that if the image name is really long (like if you’re using a private registry url) it will be truncated so you may not actually be able to see the image.

Which is why I recommend using Codefresh.

Using Codefresh (Bonus info)

Once you’ve connected your cluster to Codefresh, just navigate to the Kubernetes -> Services page.

You can filter out multiple clusters, namespaces etc to get a view like this.

Here you can see in this namespace I have two images deployed. One is mongo:latest and the other is a private image I built and deployed. The bonus here is that you can click on that image to get a full report about it.

Here I get way more information about the image including testing data and the commit id. One more click and I can even see the diff of what changes went into an image.

Conclusion

So there you have it! The first two methods have a lot of limitations. Using Codefresh ultimately gives you a lot more information. Go ahead and signup, it’s free!

Bonus Video

About Dan Garfield

Dan is a full-stack web developer and VP of the Marketing at Codefresh. Dan is a *nix native and all around technology enthusiast.

Reader Interactions

Enjoy this article? Don't forget to share.

Follow me on Twitter