History

ice originally started off as a quick one liner that went something like the following:

kubectl get pods -o jsonpath='{range .status.containerStatuses[*]}{@.name}{" "}{@.restartCount}{"\n"}{end}' trial-nginx-ingress-559d574cd5-nv4gx

the above allowed me to list the container names and their restart count, meaning I could easily field the “which container is restating” questions and to be honest this worked well (for a few days) until I got bored of the copy pasting and created an alias instead, then when I was asked “what’s the current memory limit for container xyz in pod abc?” the alias was accompanied with another, that also went something like:

kubectl get pods -o jsonpath='{range .spec.containers[*]}{@.name}{" "}{@.resources.limits.cpu}{"\n"}{end}' mypod-2mhhp

this soon turned into a bash script (which worked, I might add) but I kept hitting issues when trying to list containers from multiple pods or when listing the container restart count of all pods in a namespace. This was to become the foundations of kubectl-ice, a python proof of concept quickly gave way to the go program we have now, which allow listing single containers across multiple pods over multiple namespaces (the bash scripts would neve have coped)

Today

kubectl-ice now allows you to view much more that just the restart count of a container are the memory limit that has been set. With it you can also view:

  • volume information
  • memory/cpu usage as a percent of the limits and requests
  • container status information
  • Unix capabilities and plenty more.

If your looking for a tree view similar to the DOS/Unix tree command ice can do that. If you want to sort the cpu table by the used column, that can also be done, or maybe you would prefer to view a specific node/pod label as a column in the output then guess what… that can be done as well. Oh wait, I hear you say. I bet it can’t read yaml files! At which point I reply with a smug grin “yes it can! it can even read yaml from stdin so you can run commands like helm template mychart | kubectl-ice image to get a list of images that are used with mychart”

In short kubectl-ice is the goto tool when you want quick cli based access to advanced container information along with some nice added bells and whistles.